Archives For Qt5

Found that Qt5 based applications (e.g., VLC, qBittorrent, Virtualbox, Audacious, etc.) look ugly on Ubuntu Desktop? That’s because they don’t inherit the global GTK theme.

You can apply a custom theme to Qt5 applications to make them look native on Ubuntu Gnome desktop. And Kvantum, an SVG-based theme engine, can do the job.

First let’s see the change before and after applying the changes:

And here’s step by step guide shows how to to this in Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10.

1. First open terminal (Ctrl+Alt+T) and run command to add the PPA:

sudo add-apt-repository ppa:papirus/papirus

This step is optional for Ubuntu 20.04 and higher, as the packages are already made into main repositories.

2. Install the qt5-style-kvantum package by running command:

sudo apt install qt5-style-kvantum

3. Add rule to user’s profile, so the theme engine will handle Qt apps for single user.

echo "export QT_STYLE_OVERRIDE=kvantum" >> ~/.profile

For global, you can edit /etc/environment file and add the line export QT_STYLE_OVERRIDE=kvantum as new line in the end.

4. Log out and log back in. Then launch Kvantum Manager from system app menu.
Navigate to “Change/Delete Theme”, then select and apply KvYaru theme.

Now Qt5 apps should look native if you’re running with default Yaru GTK theme.

Uninstall and restore the changes:

To uninstall the PPA, open terminal and run command:

sudo add-apt-repository --remove ppa:papirus/papirus

To remove the theme engine, run command:

sudo apt install qt5-style-kvantum qt5-style-kvantum-themes

And remember to edit ~/.profile to remove the last line.

gedit ~/.profile

Miam Player

Miam-Player is a cross-platform open source music player using QtAv media library which is based on Qt and FFmpeg.

Miam-player aims to be fast and reliable. It can read almost all music file formats: .mp3, .m4a (MP4), .flac, .ogg, .oga (OGG Vorbis), .asf, .ape (Monkey Audio), .opus and more!

It provides a built-in tag editor (using tablib), plugins, and customizable user interface, covers, and themes. And it’s still under development to add Soundcloud, Spotify streaming and other more features.

Miam Player Playlist mode

Miam Player library mode

How to Install Miam Player in Ubuntu:

The software has an official PPA repository for Ubuntu and based systems. So far, only Ubuntu 15.10 is supported.

Open terminal from app launcher or via Ctrl+Alt+T shortcut key, and follow the steps below:

1. Paste below command and hit run to add PPA for QtAv media library:

sudo add-apt-repository ppa:wbsecg1/qtav

QtAv PPA

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

2. Add Miam-Player PPA:

sudo add-apt-repository ppa:bachelier-matthieu/ppa

3. Finally refresh your system cache and install the player via Synaptic Package Manager, or by running following commands one by one:

sudo apt-get update

sudo apt-get install miam-player

May need log out (or restart) and back in to be able to launch it from the Dash.

4. (Optional) You can always manage these PPAs via Software & Updates -> Other Software tab,

manage-ppas

and remove the music player via either Synaptic or below command:

sudo apt-get remove miam-player && sudo apt-get autoremove

Install Sigil from Source in UbuntuSigil is a multi-platform EPUB ebook. It supports both WYSIWYG and code-based editing of EPUB files, as well as the import of HTML and plain text files.

Since version 0.7.4, Sigil requires higher version of Qt5 libraries which is not available in Ubuntu’s universe repository. This tutorial will show you how to install the latest Qt5 and build sigil from source code. Works on Ubuntu 13.10, Ubuntu 14.04, Ubuntu 13.04, Ubuntu 12.04.

1. Download & Install Qt5

The qt-project website provides the latest installer for Linux. So it’s easy to install it by following the steps below:

1. Go to qt-project.org/downloads, download Qt (so far it’s 5.2.0) for Linux.

To check out OS type 32 bit or 64 bit, go to System Settings -> Details -> Overview

2. Right-click on the downloaded installer (.run file), select Properties and navigate to Permissions tab. Check the box between “Execute” and “Allow executing file as problem”.

make qt installer executable

3. Press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to start the installer (assume that you save the downloaded file in the default USER Downloads folder):

cd ~/Downloads/ && sudo ./qt-linux-opensource-*-offline.run

It brings up the install wizard. Just follow it to install Qt5 into the default /opt/ directory.

Qt 5 install wizard

2. Build Sigil against Qt5

To get started, press Ctrl+Alt+T on keyboard to open terminal and follow the below steps:

1. Run command below and type in your user password when prompt to get the super user privilege:

sudo -i

Now your terminal should starts like this:

[email protected]_HOST_NAME:~#

2. Navigate to /opt/ directory:

cd /opt/

3. Create folders for Sigil source and build:

mkdir -p /opt/sigil/src /opt/sigil/build

4. Navigate to Sigil source folder and download 0.7.4 source code via wget:

cd /opt/sigil/src && wget https://sigil.googlecode.com/files/Sigil-0.7.4-Code.zip

5. Unzip the package:

unzip Sigil-0.7.4-Code.zip

6. Build the editor:

For 32 bit system:

cd /opt/sigil/build && cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/opt/Qt5.2.0/5.2.0/gcc/lib/cmake -DCMAKE_BUILD_TYPE=Release -DFORCE_BUNDLED_COPIES=1 /opt/sigil/src && sudo make install

For 64 bit system:

cd /opt/sigil/build && cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/opt/Qt5.2.0/5.2.0/gcc_64/lib/cmake -DCMAKE_BUILD_TYPE=Release -DFORCE_BUNDLED_COPIES=1 /opt/sigil/src && sudo make install

NOTE: you need to change 5.2.0 to the Qt version you installed. This command will take a few minutes building packages.

7. Now create a script to run Sigil:

echo "LD_LIBRARY_PATH=/opt/Qt5.2.0/5.2.0/gcc_64/lib /usr/local/bin/sigil" > /opt/sigil/sigil.sh

NOTE: you need to change 5.2.0 to the Qt version you installed. And remove _64 for 32 bit system.

8. Finally, you can start Sigil via this command:

/opt/sigil/sigil.sh

3. Create a Launcher for Sigil

Run exit in previous terminal or open another one, then install required package:

sudo apt-get install gnome-panel --no-install-recommends

Start the “Create Launcher” window:

sudo gnome-desktop-item-edit /usr/share/applications/ --create-new

Type in name Sigil and command /opt/sigil/sigil.sh and click OK.

Create Launcher for Sigil

Now you’re able to start Sigil from Menu or Unity Dash.

Sigil 0.7.4 in Ubuntu 13.10