1 (edited by aloniv 2022-03-30 12:26:25)

Topic: Hyperbola 0.4 setup - Openbox with a dark theme

I thought this guide would be useful for anyone who wants a basic desktop using a dark theme.

First install Openbox packages, a dark GTK theme and a theme switcher application:

# pacman -S openbox obconf e17-gtk-theme lxappearance

Then run lxappearance and set the dark theme. In order for the new theme to work properly you might need to log out and log back in.

Qt applications can also use the GTK theme. First install the following package.

# pacman -S qtct


You'll also need to install the package qt5-styleplugins (from AUR) so that Qt can use GTK themes.
Then add the following line to the file .bashrc

export QT_QPA_PLATFORMTHEME=qt5ct

After logging out and back in, Qt applications when run from the terminal should use the dark theme.

In order to edit the items in Openbox's menu, it's best to install a menu editor. I installed obmenu3 from AUR.

When a Qt application is run from Openbox's menu it will not use the dark theme unless the execute command is altered e.g. via obmenu3. A command such as this one for Avidemux works (just replace avidemux 3_qt5 with the command needed to run the Qt application).

sh -c 'export QT_QPA_PLATFORMTHEME=qt5ct && avidemux3_qt5'

If you want a task manager as well you can install tint2.

# pacman -S tint2

In order for it to run after login add the line

tint2 &

to .config/openbox/autostart

Qt applications when run from tint2 will not use the dark theme unless you edit the .desktop files.
Copy the relevant files to .local/share/applications (you might need to create the latter directory), e.g. for Avidemux.

cp /usr/share/applications/org.avidemux.Avidemux.desktop .local/share/applications/

Then edit the Exec line - I use this one.

Exec=sh -c 'export QT_QPA_PLATFORMTHEME=qt5ct && avidemux3_qt5'  %f

What's still left to do: get PDF and EPUB files to use a dark theme (using mupdf and epdfview).

2

Re: Hyperbola 0.4 setup - Openbox with a dark theme

Very cool. Thanks for sharing.

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

3 (edited by aloniv 2022-03-31 11:49:30)

Re: Hyperbola 0.4 setup - Openbox with a dark theme

EPUB files are just ZIP files containing HTML documents and images so a possible dark theme solution is simply unpacking them using the unzip command and opening the HTML files using the browser (which supports a dark theme).

4

Re: Hyperbola 0.4 setup - Openbox with a dark theme

aloniv wrote:

EPUB files are just ZIP files containing HTML documents and images so a possible dark theme solution is simply unpacking them using the unzip command and opening the HTML files using the browser (which supports a dark theme).

Wrapper script:

>cat bin/epub.sh
#/bin/sh
unzip -qcp "$1" "*ml" "*.htm"   | lynx -force-html -dump -stdin -nolist | less -r  -M +Gg

With a few tweaks it's possible to use a tmp directory with mktemp and read
epubs with images with something lightweight such as dillo.

5 (edited by aloniv 2022-05-02 08:27:52)

Re: Hyperbola 0.4 setup - Openbox with a dark theme

After editing the Openbox menu (using obmenu3) one can view the new menu without logging out and in by simply running the following command.

$ openbox --reconfigure

6

Re: Hyperbola 0.4 setup - Openbox with a dark theme

Bookworm eBook reader in the repos supports dark mode so no need to unpack EPUBs anymore.