Archives For November 30, 1999

The new tiling assistant extension in Ubuntu 23.10 and Ubuntu 24.04 has indicator support! Here’s how to enable it and fix the missing icon.

Ubuntu introduced a new system extension called “Tiling Assistant” since 23.10. With it, user can easily tile window to half or quarter of screen either via mouse dragging or keyboard shortcut.

The extension also has an indicator applet on panel, allows user to select a layout to start tiling with ‘Super + Tab’ look like menu for all opened windows. See the short video:

The feature is useful, however lack of indicator icon on panel, possibly due to bug or building issue. This tutorial is going to show you how to enable the indicator as well as add back the icon, so it will look like the screenshot below:

Step 1: Enable the Indicator Applet

To enable the indicator, user can either run single command in terminal or use ‘Dconf Editor’ configuration tool.

Option 1: Press ‘Ctrl + Alt + T’ key combination on keyboard to open terminal. When terminal opens, run the single command below to do the job:

gsettings set org.gnome.shell.extensions.tiling-assistant show-layout-panel-indicator true

Option 2: Or, first search for and install “Dconf Editor” from App Center.

Then, launch “Dconf Editor” and navigate to org/gnome/shell/extensions/tiling-assistant. Finally, scroll down, find out and turn on ‘show-layout-panel-indicator’.

Step 2: Fix missing icon issue

As mentioned, the indicator is missing icon on panel. To fix it, you may install the community version of “Tiling Assistant” from EGO (extensions.gnome.org), then copy the icon files to use for system built-in extension.

1. First, open App Center, then search for and install “Extension Manager“.

Install Extension Manager in Ubuntu Software/App Center

2. Then, launch “Extension Manager” and use it to search and install “Tiling Assistant” community edition under Browse tab.

3. You do NOT need to turn on the new installed ‘Tiling Assistant’ extension. Here, we just need the icon file from it.

Press Ctrl+Alt+T on keyboard to open terminal, when terminal opens, run commands:

  • navigate to the user installed extension directory:
    cd ~/.local/share/gnome-shell/extensions/tiling-assistant@leleat-on-github/
  • after that, just copy the ‘media‘ sub-folder to system extension directory. To do so, run command:
    sudo cp -R media /usr/share/gnome-shell/extensions/tiling-assistant@ubuntu.com/

    Type user password (no asterisk feedback) when it asks and hit Enter.

Finally, use “Extension Manager” to turn off and turn back on ‘Ubuntu Tiling Assistant’ to apply change. And, remove the user installed ‘Tiling Assistant’ extension. Or, simply log out and back in.

This simple tutorial shows what’s new in gThumb 3.12.4, and how to install it in all current Ubuntu releases.

gThumb image viewer and organizer has rolled out version 3.12.3 and 3.12.4 recently, while Ubuntu still has v3.12.2 in system repositories.

The new releases introduced some new features as well as various bug-fixes. According to the NEWS file, gThumb now supports transparency for Tiff and TGA files, has a new internal video thumbnailer (/usr/libexec/gthumb/video-thumbnailer), though as a beginner I didn’t figure out how to use it.

For better user experience, the image viewer now has zoom gesture support; Zoom slider can zoom in/out in range of 5% and 1000%; Crop tool has new 1.91:1 predefined ratio; And, there are other changes include:

  • Open the image from clipboard with Ctrl+Shift+V.
  • Sort folders by modification time.
  • Ability to copy the current frame to the clipboard with Ctrl+Shift+C.
  • Drag’n’Drop allow to copy pressing Shift.
  • Image tools allow to use Return to apply the changes.
  • Ability to specify the current time
  • Make keypad keys equivalent to the non-keypad counterpart.
  • Reduce memory usage by keeping in memory only the visible thumbnails.

Zoom 1000%

How to Install gThumb 3.12.4 in Ubuntu:

1. Add the Ubuntu PPA.

The PPA so far provides packages for Ubuntu 20.04, Ubuntu 22.04, Ubuntu 23.04, and Ubuntu 23.10.

Firstly open terminal either from start menu or by pressing Ctrl+Alt+T on keyboard. When it opens, paste the command below into terminal and hit run:

sudo add-apt-repository ppa:ubuntuhandbook1/apps

Type user password (no asterisk feedback) when it asks for sudo authentication, then hit Enter to continue.

2. Update system package cache.

Adding PPA will automatically refresh the package cache in Ubuntu 20.04 and higher. However old versions and some Ubuntu based systems does not. To do it manually, simply run command in terminal:

sudo apt update

3. Install / Upgrade gThumb.

Finally, either run the apt install command in a terminal window to install the image viewer:

sudo apt install gthumb


Or use the Software Updater (Update Manager) utility to receive package updates. Un-check other packages from the PPA if you don’t want them.

Uninstall / Restore gThumb:

You can restore to the stock version of the image viewer and organizer by purging the PPA repository. To do so, simply run command:

sudo apt install ppa-purge && sudo ppa-purge ppa:ubuntuhandbook1/apps

To remove the gThumb package, simply run command:

sudo apt remove --autoremove gthumb gthumb-data

You may also keep the gThumb package but remove the Ubuntu PPA, since it contains many other software packages that you don’t prefer. To do so, either run command in terminal:

sudo add-apt-repository --remove ppa:ubuntuhandbook1/apps

Or remove the repository line under ‘Other Software’ tab via Software & Updates utility.

Ubuntu has a “Folder Color” package in system repository, allows to change the color and add emblem for individual folder. However, it’s only available for Ubuntu LTS, and uses the old default ‘Humanity’ icon theme, which looks very outdated.

To fix the issue, a free open-source yaru-colors-folder-color project was created to work along with system default ‘Folder Color‘, so to have folder icon in different colors while keep using default Yaru theme.

The project is discontinued, due to switch to the new “Folder Color” project, which works out-of-the-box with Yaru colors integration. And, not only for Ubuntu LTS, but also supports all current short-term releases, such as Ubuntu 24.04.

With it, user can right-click on any folder, to get the menu to change folder color to ‘Blue’, ‘Brown’, ‘Green’, ‘Grey’, ‘Pink’, ‘Purple’, ‘Red’, and ‘Yellow’. As well as adding emblem such as ‘Important’, ‘In Progress’, ‘Favorite’, ‘Finished’, and ‘New’.

After changing color or adding emblem, the folder will also have a ‘Default‘ option in that menu, to restore to default.


Continue Reading…

Hugin, the free open-source panorama photo stitching and HDR merging software, rolled out the Beta release of 2023 version few weeks ago.

This Beta so far does not have any release note for changes. But only the changelog according to the changes.txt file in source tarball:

  • PTBatcherGUI can now also queue user defined assistant and user defined output sequences.
  • PTBatcherGUI: Added option to generate panorama sequences from an existing pto template.
  • Assistant: Added option to select different output options like projection, FOV or canvas size depending on different variables (e.g. image count, field of view, lens type).
  • Allow building with epoxy instead of GLEW for OpenGL pointer management.
  • Several improvements to crop tool (outside crop, aspect ratio, …).

Install Hugin 2023 Beta in Ubuntu:

NOTE 1: This is so far a Beta release for testing purpose!

For those who want to try out the new features, I’ve uploaded the package into this unofficial PPA for Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, Ubuntu 23.04, and Ubuntu 23.10 on both X86_64 and Arm64/hf CPUs.

1. First, press Ctrl+Alt+T key combination on keyboard to open terminal. When it opens, run command to add the PPA:

sudo add-apt-repository ppa:ubuntuhandbook1/hugin-unstable

Type user password when it asks (no asterisk feedback) and hit Enter to continue.

2. Ubuntu 18.04, and some Ubuntu based systems may need to manually refresh package cache after adding PPA, though it’s done automatically sine Ubuntu 20.04.

To do so, just run command:

sudo apt update

3. Finally, install the Beta release of Hugin by running command:

sudo apt install hugin

Uninstall:

To downgrade the stock version of Hugin in your system repository, simply open terminal and run command to purge the PPA:

sudo apt install ppa-purge && sudo ppa-purge ppa:ubuntuhandbook1/hugin-unstable

Or, remove the software package by running command:

sudo apt remove --autoremove hugin

And, remove the Ubuntu PPA either by running command in terminal:

sudo add-apt-repository --remove ppa:ubuntuhandbook1/hugin-unstable

Or use “Software & Updates” by remove the source line under “Other Software” tab.

This simple tutorial shows how to make Qt-based applications automatically change their theme to be light or dark, according to system color style in Ubuntu 22.04.

Ubuntu has global option to change system color scheme to light or dark since 22.04. However, Qt apps (e.g., VirtualBox, qBittorrent, keepassxc) always stick to their own color style, except for the title-bar.

To make Qt applications fit into GNOME environment as well as possible, Fedora Linux is working on some projects to do the job.

So far, QGnomePlatform theme is a good choice, though the upstream has been switching to QAdwaitaDecorations.

With it, your Qt applications will:

  • take use GNOME Adwaita style theme.
  • automatically switch to light or dark, depends on system color style.
  • have native header-bar and borders, even when running against Wayland

Install the QGnomePlatform Theme

The QGnomePlatform Theme package is available in system repositories since Ubuntu 23.04. Sadly, it’s built for Qt5 applications only!

For Ubuntu 22.04, I’ve made it into this unofficial PPA for amd64, arm64/hf architectures support.

To install it, press Ctrl+Alt+T on keyboard to open terminal. Then, run the 2 commands below one by one:

  1. Run command to add the PPA:
    sudo add-apt-repository ppa:ubuntuhandbook1/qgnomeplatform

  2. Then install the theme package:
    sudo apt install qgnomeplatform-qt5

NOTE: Ubuntu 23.04 and Ubuntu 23.10 users can directly run the last apt install command without adding PPA.

After installation, the new theme package should be automatically taken use for your Qt (qt5) apps. Some Qt apps use their own theme options, you have to open their ‘Preferences’ or ‘Settings’ dialog to switch to default or system theme.

If NOT, open ‘Files’ and press Ctrl+H to view hidden files. Then, click editing the ‘.profile‘ file and adding the new line below in the end:

export QT_QPA_PLATFORMTHEME='gnome'

Finally, log out and back in to apply change.

Uninstall:

You can remove the Ubuntu PPA after installation, since it will no longer receive updates. To do so, open terminal and run command:

sudo add-apt-repository --remove ppa:ubuntuhandbook1/qgnomeplatform

To remove the theme package, run:

sudo apt remove --autoremove qgnomeplatform-qt5

Also remember to restore the .profile file in your user home.

Your apps do NOT have window border and shadow in Ubuntu 24.04? Here are the quick workarounds for the applications based on Qt UI toolkit.

In Linux Desktop, applications are built with different UI toolkit. While, GNOME, Cinnamon, and XFCE use GTK3/4, KDE and LxQt use Qt for their applications.

Ubuntu by default uses GNOME as default desktop environment, but user may also use Qt applications, such as qbittorrent, ksnip screenshot tool, kdenlive video editor, and more.

Since Ubuntu 23.10, the Qt applications are looking weird. They have very thin border without shadow, that look kinda borderless. This is an upstream issue that also happen in Debian 12 bookworm.

Qt apps in Ubuntu 23.10

If you have similar issue, then this tutorial is going to show you how to fix (workaround) it by 2 ways:

  • xcb QPA plugin – for Qt apps run against X11.
  • QGnomePlatform Theme – Qt app inclusion in GNOME, but lack Qt6 support in Ubuntu so far.

NOTE: You can do both ‘Option 1’ and ‘Option 2’ in Ubuntu. They do not conflict with each other.

Option 1: Set xcb QPA environment

If most of your Qt apps are running against X11, then this option is a good choice.

1. Simply open “Files“, press Ctrl+H to show hidden files/folders.

Then find out the .profile file, right-click on it and select “Open With Text Editor”.

2. When the file opens, scroll down and add the new line below in the end:

export QT_QPA_PLATFORM=xcb

After saving the file, log out and back in. Then, try launching your Qt applications to see the result.

Tips: without log out and back in, you may press Ctrl+Alt+T to open terminal. Then run command export QT_QPA_PLATFORM=xcb to set the environment for this terminal window. Finally, launch Qt app from this terminal.

Option 2: Use QGnomePlatform Theme

Fedora Linux has QGnomePlatform project to allow Qt applications to fit into the GNOME environment as well as possible, though it’s no longer maintained due to switch to QAdwaitaDecorations.

The theme works great, and even let your Qt apps automatically switch between light and dark mode according to desktop color style.

Ubuntu 23.04 and Ubuntu 23.10 include the package in system repository, sadly for Qt5 apps only!

1. First, press Ctrl+Alt+T on keyboard to open terminal. When terminal opens, run command to install the theme package:

sudo apt install qgnomeplatform-qt5

2. Next, also open “Files”, press Ctrl+H to view hidden files. Then, edit the ‘.profile‘ file and add new line in the end:

export QT_QPA_PLATFORMTHEME='gnome'

Finally, log out and back in to apply change.

After doing both ‘Option 1’ and ‘Option 2’, all my Qt applications have native window borders, though the Qt6-based qBittorrent is still not fitting well in GNOME.

Qt apps in Ubuntu 23.10 after this tutorial

Run Qt app against Wayland

After doing ‘Option 1’, your Qt applications will run against X11.

If you do need to run app against Wayland, then either launch the app from terminal. For example, launch kdenlive using wayland:

env QT_QPA_PLATFORM=wayland kdenlive

Tips: some apps may be running silently in the background. You need to close it first before running the similar command above.

Or, edit the app shortcut file (usually under /usr/share/appliations), and set the environment by changing the value of ‘Exec’.

For example, edit the app shortcut for Kdenlive, to make it run against wayland:

sudo gnome-text-editor /usr/share/applications/org.kde.kdenlive.desktop

This simple tutorial shows how to fix broken pip installer after installing Python 3.12 from Deadsnakes PPA in Ubuntu 22.04 and Ubuntu 20.04.

Due to removal of long deprecated pkgutil.ImpImporter class, pip command may not work for Python 3.12 in your Linux with old setuptools. It either just does not work or outputs following error, when installing anything via pip install:

ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 165, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 285, in run
    session = self.get_default_session(options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 75, in get_default_session
    self._session = self.enter_context(self._build_session(options))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 89, in _build_session
    session = PipSession(
              ^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/network/session.py", line 282, in __init__
    self.headers["User-Agent"] = user_agent()
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/network/session.py", line 157, in user_agent
    setuptools_dist = get_default_environment().get_distribution("setuptools")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/metadata/__init__.py", line 24, in get_default_environment
    from .pkg_resources import Environment
  File "/usr/lib/python3/dist-packages/pip/_internal/metadata/pkg_resources.py", line 9, in 
    from pip._vendor import pkg_resources
  File "/usr/lib/python3/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2164, in 
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

To fix the issue, you just have to manually install pip for Python 3.12. And, here’s how to do the job in 2 ways.

Method 1: Install pip via ensurepip

Python has a built-in module ensurepip, to provide support for bootstrapping the pip installer into an existing Python installation.

First, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command:

python3.12 -m ensurepip --upgrade

After that, you should be able to use the pip installer for Python 3.12 by either pip3.12 or python3.12 -m pip command.

Method 2: Install pip via get-pip.py

In case the previous method does not work for you, Pypa.io provides a script that can do the same job.

First, open terminal (Ctrl+Alt+T) and run command to download the script via wget command:

wget https://bootstrap.pypa.io/get-pip.py

Then, just run the script to download & install pip:

python3.12 get-pip.py

After installation, you may run python3.12 -m pip command to use the pip installer. To bind it to pip3.12, just run alias pip3.12="python3.12 -m pip".

That’s all. Enjoy!

Python 3.12.0 final was officially announced this Monday! Ubuntu LTS can easily install it from PPA.

New features in Python 3.12.0:

  • More flexible f-string parsing, allowing many things previously disallowed.
  • Python-level API for the buffer protocol
  • New API for monitoring Python programs running on CPython at low cost.
  • Per-Interpreter Global Interpreter Locks
  • Support for the Linux perf profiler to report Python function names in traces.
  • New type annotation syntax for generic classes
  • New decorator typing.override() in the typing module.

The new Python release also removed a few deprecated modules, including smtpd and distutils. For Ubuntu 22.04, Ubuntu 20.04, it causes a broken pip. As a workaround, you need to manually install pip for Python 3.12.

How to Install Python 3.12.0 in Ubuntu:

For Ubuntu 22.04, Ubuntu 20.04, and their derivatives such as Linux Mint 21, the Deadsnakes PPA has made the packages for all supported CPU architecture types: amd64, arm64/armhf, ppc64el, and s390x.

1. First, press Ctrl+Alt+T on keyboard to open terminal. Then paste the command below and hit run to add PPA:

sudo add-apt-repository ppa:deadsnakes/ppa

Type user password (no asterisk feedback) when it asks and hit Enter to continue.

2. Ubuntu 20.04+ automatically refresh package cache while adding PPA. However, Linux Mint user may need to do this job manually by running command:

sudo apt update

3. Finally, run command to install Python 3.12:

sudo apt install python3.12

For other Ubuntu editions, you may manually compile Python 3.12 from source tarball.

This simple tutorial shows how to install GDM Settings tool to configure the Gnome Login Screen in Ubuntu 22.04 and Ubuntu 24.04 LTS.

GDM Settings, aka Login Screen Manager, is a graphical configuration tool for GNOME Login Screen. With it, user can easily configure following things for the login screen:

  • Background image or color.
  • Theme, icons, and cursor.
  • font and scaling factor.
  • top bar text color and background color.
  • Mouse and touchpad settings.
  • Disable user list.
  • Sound, night light, logo, etc.

Continue Reading…

This simple tutorial shows how to switch CPU power mode between ‘Performance’, ‘Balanced’, and ‘Power Saver’ using Linux command in Ubuntu 22.04, Ubuntu 23.10, and Ubuntu 24.04.

GNOME has options in both ‘Settings’ and top-right system status menu to change CPU frequency by switching between ‘Performance’, ‘Balanced’, and ‘Power Saver’.

It’s useful for saving battery life while being able to get better performance when gaming or doing heavy work.

For users who want to bind the options to keyboard shortcuts, or make the function into script or even application, here’s the single command to switch the power mode.

Single command to change Power Mode in Ubuntu

NOTE: This tutorial is only tested in Ubuntu (GNOME ONLY) with Intel CPU, though it should also work in Fedora workstation and Debian 12 with GNOME desktop.

The power mode setting option is handled by the power-profiles-daemon. It has a command line tool powerprofilesctl to check current and switch power profile.

To switch power mode to ‘power-saver’ for example, just press Ctrl+Alt+T on keyboard to open terminal and run command:

powerprofilesctl set power-saver

In command, replace power-saver with balanced or performance as you want.

After making change, verify by running command:

powerprofilesctl

In the output, the one with an asterisk ‘*’ in the beginning is the power profile currently in use.

For those who want to do the job through D-Bus interface, run the single command below instead:

gdbus call --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' "<'power-saver'>"

Also, change power-saver in command with balanced or performance as need.

View CPU Speed / frequency in Real Time

As mentioned, you can verify CPU power mode by simply running powerprofilesctl command.

For choice, you may also see CPU frequency (aka clock speed) in real-time by running command in terminal:

watch -n 1 "grep \"^[c]pu MHz\" /proc/cpuinfo"

It will show you the speed for all CPU cores, and update every 1 second. As you want, you may replace number 1 in seconds (e.g., 2 for 2 s, or 0.5 for 500 ms).