Archives For November 30, 1999

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 seem not conflicting 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. First, press Ctrl+Alt+T to open up a terminal window. When it opens, run command to install the required libraries:

sudo apt install libxcb-cursor0 libxcb-composite0

Then, you can try to launch a Qt app, qBittorrent from example, from command line with xcb plugin to see if it works:

export QT_QPA_PLATFORM=xcb && qBittorrent

2. If it works, then 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”.

3. 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

Ubuntu 24.10 user can also install the qgnomeplatform-qt6 package for Qt6 apps support!

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!

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).

This simple tutorial shows how to install the latest Whisker Menu, the main menu for launching apps, in XUbuntu 22.04, Linux Lite 6.6, and Linux Mint 21 XFCE Edition.

The default main menu (aka applications menu, or start menu) in Debian and Ubuntu with XFCE Desktop is Whisker Menu. It’s a free and open-source project being developed by gottcode.org.

XUbuntu 22.04 includes Whisker Menu 2.7.1, while the latest version has now reached v2.8.0. For users who want to try out new features and receive bug-fixes, here’s how to install it step by step.

What’s New in Whisker Menu 2.8.0

For multiple monitors, you may have more than one instances of the menu in panel. In the case, the default Super shortcut key always open the menu in primary monitor.

To trigger the Whisker Menu in other monitors, user can bind xfce4-popup-whiskermenu -i ID-number to a keyboard shortcut. To get the ID-number, open ‘Panel Preferences -> Items’ and move mouse over the Whisker Menu applet to see the tooltip. It’s NOT the PID, but seems to be applet sequence number.

Also for keyboard users, the new release can trigger the menu in screen center by binding xfce4-popup-whiskermenu -c to a shortcut key.

The appearance settings menu has been redesigned in the release. There’s a new “Position profile on buttom” option. With it, user can put the user figure, Settings, Logout buttons in either top or bottom of the menu.

There’s also a “downside” in the release. User can no longer drag menu border to resize it. Instead, there are new “Menu width” and “Menu height” setting options to resize the menu. For more about the new release changes, see its official page.

Install Whisker Menu 2.8.0 via its Official PPA

The software developer has an official PPA contains the latest Whisker Menu packages for Ubuntu 22.04, Ubuntu 23.04, Ubuntu 23.10, and their derivatives.

(X)Ubuntu, Linux Mint XFCE Edition, and Linux Lite users can follow the steps below one by one to install it:

1. First, press Ctrl+Alt+T on keyboard to open up a terminal window. When terminal opens, run command to add the PPA:

sudo add-apt-repository ppa:gottcode/gcppa

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

2. Then, Linux Mint users need to manually refresh the system package cache, by running command:

sudo apt update

3. Finally, install the latest version of Whisker Menu by running command:

sudo apt install xfce4-whiskermenu-plugin


After installing the package, log out and back in. Then, right click on the menu and go to ‘About‘ to verify its version!

For Debian 12 with XFCE Desktop, user can download and install the .deb package directly from the PPA packages page.

How to Uninstall

To restore the original Whisker Menu, open terminal (Ctrl+Alt+T) and run command to install ppa-purge tool:

sudo apt install ppa-purge

Then, purge the PPA which will also downgrade the menu to the original version:

sudo ppa-purge ppa:gottcode/gcppa

In case the command above failed for you, you may manually remove the PPA by running command:

sudo add-apt-repository --remove ppa:gottcode/gcppa

Then, remove the Whisker Menu package by running command:

sudo apt remove xfce4-whiskermenu-plugin

And, install back the original version via command:

sudo apt install --reinstall xfce4-whiskermenu-plugin

This is a beginner’s guide shows how to set custom keyboard shortcut to tile windows in Ubuntu 24.04 Noble Numbat

Ubuntu (since 23.10) introduced enhanced tiling window support with a new system extension. With it, user can easily arrange all opened windows side by side by either mouse dragging or keyboard shortcuts.

The extension supports both “edge tiling” to automatically resize and fill a window to left, right, top, or bottom screen half, and “corner tiling” to tile a window to top-left, top-right, bottom-left, and bottom-right screen quarter.

The default keyboard shortcuts use “Super + number pad key” combination. But, some laptop and PC don’t even have a number pad. In the case, you have to set custom shortcuts. And, here’s how to do the job in 2 ways.

Method 1: Use Extension Manager

Firstly, press Super (Windows Logo) key to open overview screen. Search for and launch the new “App Center”.

When it opens, search and install “Extension Manager” app.

Install Extension Manager in Ubuntu Software/App Center

Next, launch “Extension Manager” by searching from the overview screen.

When the tool opens, scroll down and find out “Ubuntu Tiling Assistant“. Finally, click its setting icon to open the configuration dialog.

In the pop-up dialog, navigate to “Keybindings” tab, scroll down and click your desired tile action under “Edge Tiling” and “Corner Tiling” and press a key combination on keyboard to set as new shortcut.

Method 2: Use single command to set custom tiling shortcut

For those who are familiar with Linux command, the thing can be done by running gsettings command.

Firstly, search for and launch a terminal window from the overview screen.

When terminal opens, run command to set custom shortcut (Alt + q for example) for tiling to top-left quarter:

gsettings set org.gnome.shell.extensions.tiling-assistant tile-topleft-quarter "['<Alt>q']"

In command you may replace tile-topleft-quarter with one of the tile actions below:

  • tile-left-half
  • tile-right-half
  • tile-top-half
  • tile-bottom-half
  • tile-topright-quarter
  • tile-bottomleft-quarter
  • tile-bottomright-quarter

For the shortcut value, there must be quotation marks both inside and outside of bracket. And, the commonly used functions keys include <Control>, <Alt>, <Super> and <Shift>.

For example, set Ctrl + Alt + E to tile window to top-right corner by running command:

gsettings set org.gnome.shell.extensions.tiling-assistant tile-topright-quarter "['<Control><Alt>e']"

One tiling action can have 2 or more shortcut keys, for example, set both Alt+a and Ctrl + Left Arrow to tile a window to left half:

gsettings set org.gnome.shell.extensions.tiling-assistant tile-left-half "['<Alt>a', '<Control>Left']"

 

This simple tutorial shows how to install the latest Clang compiler 17 and/or 16 in Ubuntu 20.04, Ubuntu 22.04, and Ubuntu 23.10.

Ubuntu includes several versions of Clang in its system repositories. But, it rarely builds newer releases into Ubuntu stable repositories.

You can easily install Clang 10, 11, 12, 13, 14, and 15 by running sudo apt install clang-xx (replace xx with major version number) command in terminal.

For the most recent 16 and 17, they are also easy to install via the official apt repository.

Step 1: Download the Automatic installation script

The official Clang repository, so far supports Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, Ubuntu 23.04, and Ubuntu 23.10. It has a script to make adding repository and installing Clang as easy as few Linux commands.

1. First, press Ctrl+Alt+T on keyboard to open terminal. When terminal opens, run command to download the official installation script:

wget https://apt.llvm.org/llvm.sh

You may also use the script in Debian stable, though you may need to install wget first.

2. After downloading the script, add executable permission by running command:

chmod u+x llvm.sh

Step 2: Use the script to install Clang

The script automate the process of adding the official apt repository, updating package cache, and installing specific Clang version into your system.

All this can be done by running a single command. For example, install Clang-17:

sudo ./llvm.sh 17

Replace 17 with 16 for installing Clang-16, or even 18 if it’s already released when you see this tutorial

During the process, it will ask to hit Enter to confirm adding the apt repository. Then, you may just wait until the process done.

Step 3: Verify

If everything’s done successfully, just run clang-xx --version and/or locate clang-xx to verify.

Uninstall

To remove the repository added by the script, just open terminal (Ctrl+Alt+T) and run command to remove the corresponding source file:

sudo rm /etc/apt/sources.list.d/archive_uri-http_apt_llvm_org_*.list

And, remove the repository key file via command:

sudo rm /etc/apt/trusted.gpg.d/apt.llvm.org.asc

Or, launch “Software & Updates” and remove source line and key from “Other Software” and “Authentication” tabs.

To remove Clang packages (replace 17 accordingly), just run command:

sudo apt remove --autoremove clang-17 lldb-17 lld-17 clangd-17