How to make LXQt purer and leaner without GTK

From Manjaro Linux
Jump to: navigation, search


This tutorial is about removing all GTK2 and GTK3 dependencies from your LXQt system without introducing KDE dependencies.

Please look at our List of Qt Applications first for programs you might need. Then, read this tutorial (or parts of it).



WARNING: Before uninstalling GTK2 and GTK3 you’d better see first what you’ll lose as the below alternatives may not meet every package you’ll lose or may not meet your needs, though you can re-install everything if you’re not satisfied with the result.

WARNING: Uninstalling GTK2 and GTK3 may remove network-manager as well. So uncheck it in the octopi window of dependencies to be removed.

WARNING: Since it may cause issues, remove ~/.gksu.lock which is a hidden file in your /home/YOUR_USERNAME (~/) — as all files/folders with an initial dot are — and which can be made visible by Ctrl+h when pcmanfm-qt is active.


Archiving

If not pre-installed from the ISO,

sudo pacman -S b1-free-archiver p7zip


Password authentication and GUI package management

Without gtk the package manager octopi will not function as well despite being a Qt application itself, as it can (as of this writing) only use either kdesu or gksu for password authentication. So you need another GUI package manager and another password authentication utility without GTK dependencies.

For package management install either of these from AUR by entering either this command in terminal:

yaourt -S tkpacman

or that one:

yaourt -S pacmanxg4-bin lib32-libxft

For password authentication install either of these: gtksu (don’t pay attention to its name, it’s built as a Qt5 app) and ssx (using only 32bit X11 libraries, no GTK or Qt, like pacmanxg).

You can install ssx by entering this command in terminal:

yaourt -S ssx

gtksu’s AUR package is out of date and has unnecessary dependency of gtk2. So download the source, extract the archive and enter into the extracted directory. Normally this is unnecessary but here it was in my experience –make the “configure” file executable either via file manager or by entering this terminal command (launching terminal from the pcmanfm-qt “Tool” menu):

chmod a+x configure

Then without closing terminal enter these commands one at a time:

./configure --enable-qt5 --prefix=/usr
make
sudo make install

Continue to use the fake gksu:

Finally, instead of entering gtksu when necessary and replacing (for instance) the pcmanfm-qt’s default authentication parameter (gksu) with it, create a fake gksu to fool the system by enter this command (replace gtksu with ssx if you’ve previously installed it):

sudo ln -s /usr/bin/gtksu /usr/bin/gksu

Now you can continue to (the fake) gksu (which is really gtksu).


Flash

Flashplugin requires gtk2 if you install it from the repo, but if you just download adobe flash package, extract libflashplayer.so and put it in usr/lib/qupzilla and (for other browsers) /usr/lib/mozilla/plugins or ~/.mozilla/plugins you’re done without any gtk.


Mounting

Mounting external storage

Easier Method

sudo pacman -S pmount

Download and compile the systray utility easymount. Autostart easymount with your system.

Prettier Method (if it works)

sudo pacman -S ldm-git

After the above installation, issue these commands in terminal one at a time:

ldm -g
ldm -u

Note your gid and uid numbers. Create (if not already created) and edit /etc/ldm.conf either via file manager or by issuing these commands one at a time (replace juffed with your text editor if different:

sudo touch /etc/ldm.conf
gksu juffed /etc/ldm.conf

Paste these two lines and enter after equal signs your gid and uid numbers you’ve got from the terminal before:

USER_GID=
USER_UID=

Save and close. Then issue these commands one at a time to start and enable ldm.service

sudo systemctl start ldm.service
sudo systemctl enable ldm.service

Your device will be mounted on /mnt To unmount a selected device just issue this command in terminal

ldm -r

or assign a keyboard shortcut for it.

See Arch Wiki for other mounting options.

Mounting digital cameras

yaourt -S gphotofs

When your camera is attached just issue this command in terminal or asign a keyboard shortcut for it:

gphotofs /YOUR/MOUNT/POINT

And for unmounting:

fusermount -u /YOUR/MOUNT/POINT


Mounting network shares

Please look hereor here.


Automatically Mounting in PcManFM-Qt

gvfs, gvfs-afc, gvfs-smb, and other parts of gvfs can be used to automatically mount USB-devices, cameras, network shares, etc. in PcManFm-Qt. This method is really comfortable.

But since the beginning of 2016, gvfs and its components depend on gtk3. If you have already gtk2 installed (and plan to keep it), but do not want gtk3 on your system, you can simply remove gtk3. Before you try this, check which packages require gtk3:

pactree -r gtk3

If gtk3 is a dependency of gvfs only, use the following command to remove gtk3:

sudo pacman -Rdd gtk3

Attention: This might introduce instabilities on your system. On a test system, PcManFm-Qt crashed every time an external storage drive was unmounted. Mounting of external storage and network drives worked.


Printing

Please follow this tutorial.


Scanning

Scanning by command line

You must have already installed sane during the installation of printing packages. If not install it by this terminal command:

sudo pacman -S sane

The GUI application xsane has GTK dependencies, but the command line sane can be used easily for general use. When there’s a material in your scanner to be scanned, just issue this command in terminal:

scanimage >YOUR_IMAGE.pnm

or this command:

scanimage --format=tiff > YOUR_IMAGE.tiff

If it fails with scanimage: sane_start: Invalid argument, you need to first determine your scanner by this command:

scanimage -L

Then you have to specify your device in your scan command like so:

scanimage --device YOUR_DEVICE --format=tiff > YOUR_IMAGE.tiff

For further (complicated) usages see scanimage.

Open the scanned image in phototonic (lightweight picture viewer/editor you’ll install below) and crop easily if necessary.


Scanning by GUI

This Qt app will install gambas libraries as well:

yaourt -S gbscan-git


CD ripping

sudo pacman -S abcde

When you insert a CD to rip just issue this command in terminal:

abcde

Your CD will be copied in your Home directory. Edit ~/.abcde.conf for encoding your CDs to flac instead of ogg and for various other customisations if necessary.

Or you can install ripit from AUR:

yaourt -S ripit


DVD/BD ripping

yaourt -S makemkv

This application will rip your movie quickly and losslessly into MKV. To embed cover art into the newly created YOUR_MOVIE.mkv (if makemkv can’t do this itself yet),

sudo pacman -S mkvtoolnix-cli

And then download cover art, rename it as cover.jpg, put it in the same folder as YOUR_MOVIE.mkv and issue this command in terminal:

mkvpropedit YOUR_MOVIE.mkv --add-attachment cover.jpg

TIP: A movie library with embeded cover arts can be viewed in the library/playlist mode of vlc as a fine and convenient grid of covers like cantata’s for music.


General purpose Qt applications

yaourt -S qgmailnotifier flburn ffmulticonverter convertall xgrabcolor luckybackup goldendict copyq phototonic

See here and here for other Qt applications.

QtCreator as a multi-purpose utility

If you want a lightweight, but more capable, functional text editor like kate or geany you can install qtcreator:

sudo pacman -S qtcreator

QtCreator can be used as an excellent and lightweight text editor, markdown editor/converter, note taker and to-do list/phone/address book manager.


Links

You can find more pages about LXQt in the Manjaro Wiki here.