Tag Archives: desktop

FreeBSD Desktop – Part 16 – Configuration – Pause Any Application

Many desktop oriented operating systems try to provide various usability improvements and features, like quite useful Expose or Dashboard in Mac OS X or useless Tiles concept in recent editions of Microsoft Windows systems.

pause.key.jpg

After using UNIX for so many years I knew that I could freeze (or pause) any process in the system with kill -17 (SIGSTOP) signal and then unfreeze it with with kill -19 (SIGCONT) signal as I described in the Process Management section of the Ghost in the Shell – Part 2 article. Doing it that way for the desktop applications is PITA to say the least. Can you imagine opening xterm(1) terminal and searching for all Chromium or Firefox processes and then freezing them one by one every time you need it? Me neither.

Fortunately with introduction of so called X11 helper utilities – like xdotool(1) – it is now possible to implement it in more usable manner.

Today I will show you how to freeze any X11 application with single keyboard shortcut or mouse gesture if you utilize them in any way with small simple script.

When such feature can be useful (or what for)?

Lets say you have Firefox started with many tabs open (50+) and you know that it drains battery life from your laptop. You can close it but when You will need information from any of those tabs, then You will have to start Firefox again (even more battery usage) and load all needed tabs (battery …). The alternative is to pause all Firefox processes when You do not use them. This will freeze all its processes and subprocesses and it will not use any CPU (or battery) power. When you will need it, then you will unpause it without the need to load all tabs again.

Other example may be some heavy processing. For example you started RawTherapee or Darktable processing of large amount of photos and you are not able to smoothly watch a video. Just pause it, watch the video and unpause it again to finish its work.

Its also usable in single player gaming when You can REALLY pause the game, literally πŸ™‚

You may also check earlier articles of the FreeBSD Desktop series:

First we need to install the so called X11 helpers. Do that with this pkg(8) command.

# pkg install xprop xdotool zenity xbindkeys

Now for the script that would make all this magic happen. The desktop-pause.sh script is available on GitHub as its syntax is nicely colored there. Save it in some place where its searchable through ${PATH} variable like ~/bin or ~/script directory and make it executable.

% fetch -O ~/scripts/desktop-pause.sh https://raw.githubusercontent.com/vermaden/scripts/master/desktop-pause.sh
% chmod +x ~/scripts/desktop-pause.sh
% echo $PATH | grep scripts
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/vermaden/scripts

It has three ways of usage.

% desktop-pause.sh
usage: desktop-pause.sh OPTION [ARGUMENT]

OPTIONS:
  -a  -  Do pause/resume active window.
  -s  -  Do pause/resume interactively selected window.
  -p  -  Do pause/resume specified PID.
  -l  -  Do list paused processes/windows.
  -L  -  Do list paused processes/windows with PIDs.

ARGUMENT:
  PID for '-p' option.

If started with -a option, then it would pause/unpause the currently active window. This option is best used with keyboard shortcut or mouse gesture. It you start desktop-pause.sh script with -s argument, then the cursor will change and you will be able to select which window to freeze (or unfreeze). The -p option is usable in terminal directly as you may want to freeze/unfreeze a process without X11 environment or for some debugging purposes for example. The last -l option will list applications that are currently paused.

pause.key.thinkpad

Most present-day generation laptops have island type limited keyboards so you will have to choose for yourself which keyboard shortcut to use. As I still use 2011 ThinkPad T420s laptop with 7-row keyboard I have little more options. The [Pause Break] key seems to be the best candidate for such feature πŸ™‚ I will use it for the ‘active window freeze/unfreeze’ with -a option and [SHIFT]-[Pause Break] key for the more interactive -s option.

To create such new keyboard shortcut we will use handy xbindkeys(1) tool.

Lets see what code we will have to put into the ~/.xbindkeysrc configuration file.

% xbindkeys --help
xbindkeys 1.8.6 by Philippe Brochard
usage: xbindkeys [options]
  where options are:
  -V, --version           Print version and exit
  -d, --defaults          Print a default rc file
  -f, --file              Use an alternative rc file
  -p, --poll-rc           Poll the rc/guile configs for updates
  -h, --help              This help!
  -X, --display           Set X display to use
  -v, --verbose           More information on xbindkeys when it run
  -s, --show              Show the actual keybinding
  -k, --key               Identify one key pressed
 -mk, --multikey          Identify multi key pressed
  -g, --geometry          size and position of window open with -k|-mk option
  -n, --nodaemon          don't start as daemon

As its single key we will need --key option. Lets do it then.

% xbindkeys --key
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"(Scheme function)"
    m:0x0 + c:110
    Pause

Now lets read the [SHIFT]-[Pause Break] sequence.

% xbindkeys --key
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"(Scheme function)"
    m:0x1 + c:110
    Shift + Pause

We now have all needed information for the ~/.xbindkeysrc configuration file. Here is how it looks configured.

% cat ~/.xbindkeysrc

# [Pause Break] FOR ACTIVE WINDOW
"~/scripts/desktop-pause.sh -a"
  Pause

# [Shift]-[Pause Break] FOR INTERACTIVE WINDOW
"~/scripts/desktop-pause.sh -s"
  Shift + Pause

Now lets start xbindkeys(1) and verify that it works.

% xbindkeys

Press the [Pause Break] key when you are in the terminal where you started xbindkeys(1) utility. Now hit [ENTER] several times, the terminal should be freezed. Now hit [Pause Break] key again. The etnered [ENTER] keys have been passed to it as it was unfreezed.

Lets check the Firefox example.

When processes run like usual they have on of the I*/S*/R* state like shown below.

% ps ax | grep firefox | grep -v grep
67981  -  S       3:28.66 /usr/local/lib/firefox/firefox -contentproc -childID 58 -isForBrowser -prefsLen 31209 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab
41124  0- S      68:44.94 firefox
43940  0- S      25:52.43 /usr/local/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 27620 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab

When you will now freeze Firefox with [Pause Break] key its processes will have T state.

% ps ax | grep firefox | grep -v grep
67981  -  T       3:28.66 /usr/local/lib/firefox/firefox -contentproc -childID 58 -isForBrowser -prefsLen 31209 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab
41124  0- T      68:45.17 firefox
43940  0- T      25:52.85 /usr/local/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 27620 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab

After you unfreeze them again with [Pause Break] key they will get back to normal I*/S*/R* state.

% ps ax | grep firefox | grep -v grep
67981  -  S       3:28.67 /usr/local/lib/firefox/firefox -contentproc -childID 58 -isForBrowser -prefsLen 31209 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab
41124  0- S      68:45.54 firefox
43940  0- S      25:53.01 /usr/local/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 27620 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab

You may of course specify by hand the Firefox PID which is 41124 in current state.

% desktop-pause.sh -p 41124
INFO: kill -17 41124
INFO: kill -17 67981
INFO: kill -17 43940

The Firefox browser will be paused again.

% ps ax | grep firefox | grep -v grep
67981  -  T       3:28.68 /usr/local/lib/firefox/firefox -contentproc -childID 58 -isForBrowser -prefsLen 31209 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab
41124  0- T      68:46.68 firefox
43940  0- T      25:56.22 /usr/local/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 27620 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab

Use it again to unpause it.

% desktop-pause.sh -p 41124
INFO: kill -19 41124
INFO: kill -19 67981
INFO: kill -19 43940

And viola! Firefox runs again.

% ps ax | grep firefox | grep -v grep
67981  -  S       3:28.68 /usr/local/lib/firefox/firefox -contentproc -childID 58 -isForBrowser -prefsLen 31209 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab
41124  0- S      68:46.72 firefox
43940  0- S      25:56.28 /usr/local/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 27620 -schedulerPrefs 0001,2 -appdir /usr/local/lib/firefox/browser 41124 tab

There are no downsides to this feature but one has to remember paused applications will not refresh themselves as their processes are freezed. Below you can see frozen Epiphany browser upon which the xterm(1) window was moved. Pretty Windows like effect.

epiphany.paused

After you unpause the Epiphany it gets back to normal as shown below.

epiphany.unpaused.png

Remember to add xbindkeys(1) command to your ~/.xinitrc (or ~/.xsession file) to make it permanent.

UPDATE 1

One of the Hacker News users named rhn_mk1 explained the lack of window contents refresh while application is freezed. I will just cite his comment below.

That depends on the window manager. The application state is not really affected, it just stops updating (redrawing its area). When another window moves away, the window manager asks the “underlying” application to update that area of the screen. It’s dead, so the WM keeps displaying the last thing that was there, until something else happens in that spot.

On the other hand, compositing window managers will dedicate a separate buffer to each application, where they have exclusive access. That kind of a window manager would not have to ask the application to update anything – it would just take the image from the dedicated application’s buffer and update the screen with it. Since the application’s buffer can’t be modified by anything else, it would have the last state of the application in it. That would in turn find its way to the screen. No glitches.

UPDATE 2

One of the Reddit users 89luca89 pointed me to the browser-suspender solution that ‘simply suspends the browser when not in focus using STOP/CONT’ signals.

UPDATE 3

The Lobsters user seschwar pointed out that there is Stoppable Layout functionality for XMonad which automatically pauses the processes of all windows except for the active one and it also uses SIGCONT and SIGSTOP signals.

UPDATE 4

One of the Hacker News users named imglorp suggested that my “command could also iconify/minify the app’s windows”.

This is really good idea.

I just added -A and -S options that also minimize a window.

% desktop-pause.sh 
usage: desktop-pause.sh OPTION [ARGUMENT]

OPTIONS:
  -a  -  Do pause/resume active window.
  -A  -  Do pause/resume active window and minimize it.
  -s  -  Do pause/resume interactively selected window.
  -S  -  Do pause/resume interactively selected window and minimize it.
  -p  -  Do pause/resume specified PID.
  -l  -  Do list paused processes/windows.
  -L  -  Do list paused processes/windows with PIDs.

ARGUMENT:
  PID for '-p' option.

Here is the changelog for the desktop-pause.sh script:
https://github.com/vermaden/scripts/commit/03591a138b14cededa15a05fe9c77bf1a941795d

EOF
Advertisements

My FreeBSD Story

As Roman Zolotarev asked if I would write an entry for his Tell Your BSD Story page I could not refuse. I really tried to make it short and small but I guess its not that straight πŸ™‚

My first devices/computers/consoles (not at the same time) that I remember were Atari 2600 and Pegasus console which was hardware clone of the Nintendo NES.

atari-2600.png

Back then I did not even knew that it was Atari 2600 as I referred to it as Video Computer System … and I did not even knew any english by then. It took me about two decades to get to know (by accident) that this Video Computer System was Atari 2600 πŸ™‚

This equipment was used for playing computer games only.

Then I got AMIGA 600 computer (or should I say my parents bought it for me) which served both for playing computer games and also other activities for the first time. AMIGA is the computer that had the greatest influence on me, as it was the first time I studied the books about Amiga Workbench operating system and learned commands from Amiga Shell terminal. I loved the idea of Ram Disk icon/directory on the desktop that allowed me to transparently put any things in system memory. I still miss that concept on today’s desktop systems … and I still remember how dismal I was when I watched Amiga Deathbed Vigil movie.

amiga-600.png

At the end of 1998 I got my first PC that of course came with Windows and that computer served both as gaming machine and as well as typical tool. One time I dig into the internals with Windows Registry (which left me disgusted by its concepts and implementation) and its limited command line interface provided by CMD.EXE executable. I remember that the heart of this box was not the CPU or the motherboard but the graphics accelerator – the legendary 3Dfx Voodoo card. This company (3Dfx) – their attitude and philosophy – also left solid fingerprint on my way. Like AMIGA did.

Hence how the top of my laptop looks like now πŸ™‚

laptop.jpg

Some games was even released as special edition with the only feature being support for the 3Dfx Glide driver like Need for Speed II: Special Edition.

nfs.jpg

After ‘migration’ from AMIGA to PC it never again ‘felt right’. The games were cool but the Windows system was horrible. Time has passed and different Windows versions and hardware modifications took place. Windows XP felt really heavy at that time, not to mention Windows 2000 for example with even bigger hardware requirements. I also do not understand all the hate about Windows ME. It crashed with the same frequency as Windows 98 or later Windows 98 Second Edition but maybe my hardware was different πŸ™‚

windowsme.png

I do not have any ‘mine’ screenshots from that period as I lost all my 40 GB (huge then) drive of data when I moved/resized the partition with Partition Magic to get some more space from the less filled C: drive. That day I learned hard that “there are people who do backups and people who will do backups”. I never lost data again as I had multiple copies of my data, but the same as Netheril fall the lost data was was gone forever.

I always followed various alternatives which led me to try Linux in 2003, after reading about various distributions philosophies I decided to run Slackware Linux with KDE 3. My buddy used Aurox Linux by then (one of the few Linux distributions from Poland) and encouraged me to do the same – especially in the context of fixing possible problems as he already knew it and also as he recently dumped Windows system. But Slackware sounded like a better idea so I took that path instead. At first I dual booted between Windows XP and Slackware Linux cause I had everything worked out on the Windows world while I often felt helpless in the Linux world, so I would reboot into Windows to play some games or find a solution for Linux problem if that was required. I remember how strange the concept of dual clipboards (PRIMARY and SECONDARY) was for me by then. I was amazed why ‘so much better’ system as Linux (at least marketed that way) needs a system tray program to literally manage the clipboard. On Windows it was obvious, you do [CTRL]+[C] to copy and [CTRL]+[V] to paste things, but on Linux there (no I know its X11 feature) there were two clipboards that were synchronized by this little system tray program from KDE 3. It was also unthinkable for me that I will ‘lost’ contents of last/recent [CTRL]+[C] operation if I close the application from which the copy was made. I settled down a little on Slackware but not for long. I really did not liked manual dependency management for packages for example. Also KDE 3 was really ugly and despite trying all possible options I was not able to tweak it into something nice looking.

After half a year on Slackware I checked the Linux distributions again and decided to try Gentoo Linux. I definitely agree with the image below which visualizes Gentoo Linux experience, especially when You install it for he first time πŸ™‚

gentoo-fly

Of course I went with the most hardcore version with self building Stage 1 (compiler and toolchain) which was horrible idea at that time because compilation on slow single core machine took forever … but after many hours I got Gentoo installed. I now have to decide which desktop environment to use. I have read a lot of good news about Fluxbox at that time so this is what I tried. It was very weird experience (to create everything in GUI from scratch) but very pleasant one. That recalled me the times of AMIGA … but Linux came in the way too much often. The more I dig into Gentoo Linux the more I read that lots of Gentoo features are based on FreeBSD solutions. Gentoo Portage is a clone of FreeBSD Ports. That ‘central’ /etc/rc.conf system configuration file concept was taken from FreeBSD as well. So I started to gather information about FreeBSD. The (then) FreeBSD website or FreeBSD Ports site (still) felt little outdated to say the least but that did not discouraged me.

Somewhere in 2005 I installed FreeBSD 5.4 on my computer. The beginnings were hard, like the earlier step with Gentoo but similarly like Gentoo the FreeBSD project came with a lot of great documentation. While Gentoo documentation is concentrated within various Gentoo Wiki sites the FreeBSD project comes with ‘official’ documentation in the form of Handbook and FAQ. I remember my first questions at the now nonexistent BSDForums.org site – for example one of the first ones – how to scroll the terminal output in the plain console. I now know that I had to push Scroll Lock button but it was something totally new for me.

How BSDForums.org looked like.

bsdforums.png

This is the earliest screenshot I got from that period, and Gentoo setup looked very similar.

vermaden-2005.11.08.jpg

Why FreeBSD and not OpenBSD or NetBSD? Probably because Gentoo based most their concepts on the FreeBSD solutions, so that led me to FreeBSD instead of the other BSD operating systems. Currently I still use FreeBSD but I keep an steady eye on the OpenBSD, HardenedBSD and DragonFly BSD solutions and improvements.

As the migration path from Linux to FreeBSD is a lot easier – all configuration files from /home can be just copied – the migration was quite fast easy. I again had the Fluxbox configuration which I used on the Gentoo. Now – on FreeBSD – it started to fell even more like AMIGA times. Everything is/has been well thought and had its place and reason. The documentation was good and the FreeBSD Community was second to none.

I even decided to upgrade the hardware to something more exotic. I got Gigabyte-GA-7DPXDW server motherboard with dual CPU sockets – and as Athlon XP (desktop) processors were very easily modified to ‘be’ Athlon MP (server) ones I got also the second one along with 1 GB of ECC RAM.

gigabyte-GA-7DPXDW.jpg

This dual CPU setup – quite unusual at these times – server me very well. I switched from nvidia binary blob driver to software but open nv because nvidia would break my uptime every several days πŸ™‚

I accumulated 30 days of uptime on that desktop box, not bad for a system without any emergency UPS πŸ™‚

uptime-vermaden.png

This was also the last time I used ECC RAM on FreeBSD (at least on my boxes) while ZFS did not even existed on FreeBSD πŸ™‚ But as time flied I started to feel the need for something faster. As I also got interested in Intel graphics card I got the new motherboard with fastest Intel graphics card available then – as silly as it sounds – the Asus P5B-V with Intel X3000 GMA … and that was a terrible idea because FreeBSD graphics stack supported all the Intel graphics cards instead of that one. At the beginning I used software vesa driver but the problem was not the performance of the driver (as I also had quad core Intel Q6600 CPU) but the resolution on the screen. As I got 1280 x 1024 screen by then using limited 1024 x 768 was real PITA. I decided that I will try something else then FreeBSD will Intel X3000 support finally arrives. I needed to do something fast as I also needed to write my Masters Thesis at that time.

That was in the middle of 2007. I wanted to try the other end of the Linux distributions spectrum. Ubuntu. I could not go more ‘desktop’ way πŸ™‚ It of course installed gently with GNOME 2 environment and pulseaudio already unfortunately existed. As I preferred to run my computer all the time back then (I did not payed the electricity bills) there were several things that annoyed my very much. For example the mentioned pulseaudio – the sound freezed after one-two days of using the computer (even if I did not played any music or videos) and it stayed that way. I could restart pulseaudio or reload the ALSA modules but it stayed in this SUSFU state (situation unchanged still fucked up) until reboot. As I needed to finish my Masters Thesis I did not had time to reinstall into something else as pulseaudio will be probably similarly broken on other Linux distributions and FreeBSD was still lacking the Intel X3000 GMA support. Generally GNOME 2 experience was not bad but I really missed all my custom settings, keyboard shortcuts and customized behavior. I remained in pain on the Ubuntu for two months – to the time I have finished my Masters Thesis about Operating Systems’ Virtualization which you can download and read but its in Polish so use translator if needed πŸ™‚

This is how Ubuntu looked back then.

ubuntu.jpg

I also had ‘side’ journey to the Mac wonderland as I got opportunity to use Macbook Pro with Mac OS X Leopard for a year. That allowed me to get real ‘feel’ of the Mac ecosystem and their hardware (and philosophy) so I will not repeat same stereotypes over and over again like a lot of anti-apple people. But after I switched back to FreeBSD system at work it just felt better. I used Terminal.app on Mac a lot but the xterm(1) at FreeBSD just felt more natural.

What makes me laugh now that I created Mac styled Fluxbox themes years till I got to run Mac and I still like Mac OS X look from the Leopard times.

vermaden-2007.10.14-mac.png

There was time on which I also played with Solaris (and later OpenSolaris). I must admit that there was time when Solaris so called Java Desktop based on GNOME 2 was really looking good. It was so good that only Mac OS X could only rival it for the best looking os by then.

solaris-10-GNOME-2-java-desktop.png

I really liked Solaris concepts and solutions like Zones and ZFS, also Crossbow, Comstar or IPS (FreeBSD did not had PNGng by then). But I always got problem with ‘desktop’ software. While I had everything in the FreeBSD Ports – almost the same amount of applications that is available on Linux – there was always some applications lacking in the Solaris world.

The Solaris ‘journey’ also left print on my soul so my Fluxbox themes went into Solaris style πŸ™‚

vermaden-2007.07.30-solaris-java-fluxbox-system.png

After the Ubuntu fiasco I got other motherboard as FreeBSD still did not supported Intel GMA X3000 card and settled in the FreeBSD land again. What a relief it was after this pulseaudio nonsense. In the meantime as I read a lot of good experiences about Openbox I decided to try it out instead of Fluxbox. It was strange feeling to mess with XML configuration files at the beginning but as I got used to it and ordered the rc.xml and menu.xml configuration files properly it was not a problem. Since then I used FreeBSD on different machines including physical servers, virtual machines and laptops. I learned that adequate supported hardware is the most important factor in FreeBSD ecosystem.

I still use Openbox and still use FreeBSD today and my desktop looks like that one below.

vermaden-NOW.jpg

After 15 years of using various Windows, UNIX (macOS/AIX/HP-UX/Solaris/OpenSolaris/Illumos/FreeBSD/OpenBSD/NetBSD) and UNIX-like (Linux) systems I always come to conclusion that FreeBSD is the system that sucks least. And sucks least with each release and one day I will write why FreeBSD is such great operating system … if I already haven’t πŸ™‚

UPDATE 1

As Roman Zolotarev got a moment he added my story to his Tell Your BSD Story page.

Thanks Roman!

You may check it for yourself at Slawomir Wojciech Wojtczak (vermaden) runs FreeBSD page.

EOF

Β 

FreeBSD Desktop – Part 15 – Configuration – Fonts & Frameworks

The title of this article kinda sounds for me like Fast & Furious title … In this part of FreeBSD Desktop series we will focus on the fonts settings andΒ GTK/QT frameworks configuration to make applications based on them look good … or at least better.

You may also check earlier articles of the FreeBSD Desktop series:

Fonts

Proper rendering of fonts in the system is not an easy task, even most popular desktop oriented operating systems like macOS (Mac OS X) and Windows have problems with it.

We will of course focus on FreeBSD fonts settings but most of that information will be reusable on other operating systems that use X11 Window System for the desktop.

To not duplicate the knowledge already available for this topic please read these two sources for handling fonts on the FreeBSD operating system.

System Settings

The font rendering on X11 Window System desktops is made by fontconfig package. The system wide configuration is kept under /usr/local/etc/fonts directory. You can even verify that it belongs to the fontconfig package with pkg-which(8) command.

% pkg which /usr/local/etc/fonts/fonts.conf.sample
/usr/local/etc/fonts/fonts.conf.sample was installed by package fontconfig-2.12.6,1

For the fonts settings there are two directories for that purpose.

  • /usr/local/etc/fonts/conf.avail
  • /usr/local/etc/fonts/conf.d

If you want to enable a feature then you create a symlink in the /usr/local/etc/fonts/conf.d directory that leads to a small config file in the /usr/local/etc/fonts/conf.avail directory.

Here are all available options.

% ls -1 /usr/local/etc/fonts/conf.avail
10-autohint.conf
10-hinting-full.conf
10-hinting-medium.conf
10-hinting-none.conf
10-hinting-slight.conf
10-no-sub-pixel.conf
10-scale-bitmap-fonts.conf
10-sub-pixel-bgr.conf
10-sub-pixel-rgb.conf
10-sub-pixel-vbgr.conf
10-sub-pixel-vrgb.conf
10-unhinted.conf
11-lcdfilter-default.conf
11-lcdfilter-legacy.conf
11-lcdfilter-light.conf
20-unhint-small-dejavu-sans-mono.conf
20-unhint-small-dejavu-sans.conf
20-unhint-small-dejavu-serif.conf
20-unhint-small-vera.conf
25-unhint-nonlatin.conf
30-metric-aliases.conf
31-cantarell.conf
40-nonlatin.conf
42-luxi-mono.conf
45-generic.conf
45-latin.conf
49-sansserif.conf
50-user.conf
51-local.conf
57-dejavu-sans-mono.conf
57-dejavu-sans.conf
57-dejavu-serif.conf
60-generic.conf
60-latin.conf
65-fonts-persian.conf
65-khmer.conf
65-nonlatin.conf
69-unifont.conf
70-no-bitmaps.conf
70-yes-bitmaps.conf
80-delicious.conf
90-synthetic.conf

… and here are options enabled on my system.

% ls -1 /usr/local/etc/fonts/conf.d
10-hinting-none.conf
10-hinting-slight.conf
10-scale-bitmap-fonts.conf
10-sub-pixel-rgb.conf
10-unhinted.conf
11-lcdfilter-default.conf
20-unhint-small-dejavu-sans-mono.conf
20-unhint-small-dejavu-sans.conf
20-unhint-small-dejavu-serif.conf
20-unhint-small-vera.conf
30-metric-aliases.conf
40-nonlatin.conf
42-luxi-mono.conf
45-generic.conf
45-latin.conf
49-sansserif.conf
50-user.conf
51-local.conf
57-dejavu-sans-mono.conf
57-dejavu-sans.conf
57-dejavu-serif.conf
60-generic.conf
60-latin.conf
65-fonts-persian.conf
65-nonlatin.conf
69-unifont.conf
80-delicious.conf
90-synthetic.conf
99pdftoopvp.conf
README

You may even check which of these files/features are enabled by which package.

% for FILE in /usr/local/etc/fonts/conf.d/*.conf; do pkg which ${FILE}; done
/usr/local/etc/fonts/conf.d/10-hinting-none.conf was not found in the database
/usr/local/etc/fonts/conf.d/10-hinting-slight.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/10-sub-pixel-rgb.conf was not found in the database
/usr/local/etc/fonts/conf.d/10-unhinted.conf was not found in the database
/usr/local/etc/fonts/conf.d/11-lcdfilter-default.conf was not found in the database
/usr/local/etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf was installed by package dejavu-2.37
/usr/local/etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf was installed by package dejavu-2.37
/usr/local/etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf was installed by package dejavu-2.37
/usr/local/etc/fonts/conf.d/20-unhint-small-vera.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/30-metric-aliases.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/40-nonlatin.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/42-luxi-mono.conf was installed by package font-bh-ttf-1.0.3_3
/usr/local/etc/fonts/conf.d/45-generic.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/45-latin.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/49-sansserif.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/50-user.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/51-local.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/57-dejavu-sans-mono.conf was installed by package dejavu-2.37
/usr/local/etc/fonts/conf.d/57-dejavu-sans.conf was installed by package dejavu-2.37
/usr/local/etc/fonts/conf.d/57-dejavu-serif.conf was installed by package dejavu-2.37
/usr/local/etc/fonts/conf.d/60-generic.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/60-latin.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/65-fonts-persian.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/65-nonlatin.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/69-unifont.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/80-delicious.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/90-synthetic.conf was installed by package fontconfig-2.12.6,1
/usr/local/etc/fonts/conf.d/99pdftoopvp.conf was installed by package cups-filters-1.16.0_5

Most of the settings are of course make by the fontconfig package. As you see the 4 files are not installed by any package, they were symlinked/configured by me.

These settings seems to make fonts look best, I will ‘repeat’ these settings in various other files that we will use.

/usr/local/etc/fonts/conf.d/10-hinting-none.conf was not found in the database
/usr/local/etc/fonts/conf.d/10-sub-pixel-rgb.conf was not found in the database
/usr/local/etc/fonts/conf.d/10-unhinted.conf was not found in the database
/usr/local/etc/fonts/conf.d/11-lcdfilter-default.conf was not found in the database

If you would like to make system wide settings then do not use the provided /usr/local/etc/fonts/fonts.conf file. Use the /usr/local/etc/fonts/local.conf instead because /usr/local/etc/fonts/fonts.conf file will be replaced with next fontconfig package update.

User Settings

I keep most of the settings/fonts in the user home dir like ~/.config and ~/.fonts directories. Its easier for me to move/backup/import these then to edit or merge the system files everytime.

The fonts are kept in the ~/.fonts directory. I will of course share the fonts of this directory, here is the list of the fonts that are available for download as fonts.tar.gz file.

  • Arvo
  • Calibri
  • Cambria
  • Cantarell
  • Clear Sans
  • Consolas
  • Constantia
  • Corbel
  • Cormorant
  • Cosmic Sans Neue Mono
  • Courier Prime Code
  • Courier Prime Sans
  • Fira Code
  • Fira Mono
  • Fira Sans
  • Francophil Sans
  • Garamond
  • Georgia
  • IBM Plex Mono
  • IBM Plex Sans
  • Inconsolata
  • Monofur
  • Monoid
  • Pro Font Windows
  • Proggy Tiny Zero
  • PT Sans
  • SV Basic Manual
  • Trebuchet MS
  • Ubuntu
  • Ubuntu Mono

I would say that Consolas, Ubuntu Mono and Inconsolata are one of the best monospaced fonts while Trebuchet MS is probably the best looking (and properly rendered) font for non-monospaced/sans serif font category. I also really like Fira, IBM Plex and also Ubuntu family. The new Cantarell font is also pretty nice.

Lots of these fonts can be installed using installing FreeBSD Ports under /usr/ports/x11-fonts category and by pkg(8) packages, but its simpler for me to keep (and move) them in the ~/.fonts directory then to install packages everytime I need them. I also only keep the ones that I need/use while port/package often provides while set of them. For long time the user configuration for fonts was kept under ~/.fonts.conf file but it is no more. The new place is the ~/.config/fontconfig/fonts.conf file.

Mine config is not that long but check its contents for yourself.

While WordPress is quite a nice platform it has it problems – it will not render properly content in HTML or XML. To not introduce eventual problems related to that I will post a screenshot of the config below along with link to the ~/.config/fontconfig/fonts.conf file.

fonts.conf.jpg

These settings were forged for more then 15 years of my time first using Slackware and Gentoo Linux and since about 2005 – FreeBSD. As You can see from the comments I swap several bad looking fonts for good looking ones.

For example if You do not like the Arial font you may want to swap it into the Trebuchet MS font with this snippet added to the ~/.config/fontconfig/fonts.conf file.

Similarly with another XML snippet – I will post a screenshot of the config below along with link to the example file.

fonts.conf.swap.jpg

To make the test we will use this simple fonts-swap-test.html HTML file.

Here is how it looks in Epiphany after the change in the ~/.config/fontconfig/fonts.conf file.

epiphany-swap-example

The Arial font has been swapped into Trebuchet MS one. For sure Epiphany, Firefox and Midori do respect this swap, I did not tried other browsers.

Remember to reload the fontconfig cache after changes to the ~/.config/fontconfig/fonts.conf file, you may do that using already posted fc-cache.sh script.

Frameworks

Some also call them toolkits. Things like GTK or QT are in this category.

GTK

My favorite framework and least PITA one at the same time for good looking desktop was GTK2. GTK1 was always ugly, fast and light, but ugly. I think we can agree on that. GTK2 from the times when GNOME 2 was considered ‘heavy’ desktop environment. Now GTK2 is mostly deprecated (some applications still use it and they still work good) in favor of GTK3 and GNOME 2 is dead. Fortunately it has been forked into project named MATE and MATE seems light now, what an irony. Fortunately because old GNOME 2 file manager – Nautilus – seems to be one of the best file managers for the UNIX systems, sure not the lightest/fastest one, but a one that suits lots/most of the needs. Under the MATE team the Nautilus has been rebranded into Caja. Caja accompanied by Thunar from the Xfce desktop environment with its mass rename tool seems to be the most universal solution for graphical file management on UNIX. They also look similar/coherent as they both use GTK3 toolkit now (before they both used GTK2 framework).

GNOME 3 and its apps use GTK3 exclusively. You may also check Cinnamon which is GNOME 3 fork with an idea to provide GNOME 2 classic experience based on modern tools and modern GTK3 framework. The MATE desktop also moved to the GTK3 so we now have two GNOME 2 successors based on GTK3. The GTK3 is not a problematic framework, but some of its applications are, probably most of the ones written on/for the GNOME 3 environment. They come with their own built-in window buttons/handlers overwriting/ignoring the ones provided by window managers. Not so long ago the default settings left you with additional border of 5 or so pixels for each side of the window if You do not use composition/shadows manager like compton, which wastes screen space. Below you will find example from just 2 months ago with this problem.

taskbar-full-desktop

Fortunately its gone now (the additional border) and Epiphany – as an example of such GNOME 3 app – works/displays properly and is shown below.

epiphany.png

Both GTK2 and GTK3 use/used these environment variables exported by export(1). I am not sure if they are still respected but I do not want to check all my apps to find out and keeping then in the ~/.xinitrc file does not hurt.

# GTK ANTIALIASING
  export GDK_USE_XFT=1

GTK2

The configuration for GTK2 framework is kept in the ~/.gtkrc-2.0 file.

Alternatively – when you use various graphical tools/managers for GTK2 settings like lxapperance you may want to use ~/.gtkrc-2.0.mine instead.

Here is mine ~/.gtkrc-2.0 file with its contents.

% cat ~/.gtkrc-2.0
  include "/home/vermaden/.gtkrc-2.0.mine"
  gtk-theme-name="Arc"
  gtk-icon-theme-name="faenza"
  gtk-font-name="Ubuntu 10"
  gtk-cursor-theme-size=0
  gtk-toolbar-style=GTK_TOOLBAR_ICONS
  gtk-toolbar-icon-size=GTK_ICON_SIZE_SMALL_TOOLBAR
  gtk-button-images=1
  gtk-menu-images=1
  gtk-enable-event-sounds=1
  gtk-xft-antialias=1
  gtk-xft-hinting=0
  gtk-xft-hintstyle="hintnone"
  gtk-xft-rgba="rgb"

The selected theme is Arc (use /usr/ports/x11-themes/gtk-arc-themes port/package) and the icon theme is Faenza (use /usr/ports/x11-themes/mate-icon-theme-faenza port/package). For the user the GTK themes are kept under the ~/.themes directory while icon sets are kept under the ~/.icons directory. I also set font to Ubuntu in the size of 10. Remember that it can also be set as ubuntu or UBUNTU. To check what font will be selected by what You type there use the fc-match(1) command from the fontconfig package.

% fc-match ubuntu
ubuntu.ttf: "Ubuntu" "Regular"

% fc-match UBUNTU
ubuntu.ttf: "Ubuntu" "Regular"

The last 4 settings – gtk-xft-* – are the ones related to fonts rendering, as I said earlier, these settings will be ‘repeated’ over various other files. Currently there is no single file to configure all fonts behavior unfortunately.

The GTK2 File Chooser keeps its configuration in the ~/.config/gtk-2.0/gtkfilechooser.ini file, its not needed to configure this file.

The GTK2 Bookmarks are stored in the ~/.gtk-bookmarks file.

Here are contents of mine.

% cat ~/.gtk-bookmarks
file:///home/vermaden/hydepark ~/hydepark
file:///home/vermaden/books ~/books
file:///home/vermaden/gfx ~/gfx
file:///home/vermaden/gfx/wallpapers ~/gfx/wallpapers
file:///home/vermaden/gfx/screenshots ~/gfx/screenshots
file:///home/vermaden/misc ~/misc
file:///home/vermaden/misc/aix ~/misc/aix
file:///home/vermaden/misc/bsd ~/misc/bsd
file:///home/vermaden/misc/hp-ux ~/misc/hp-ux
file:///home/vermaden/misc/linux ~/misc/linux
file:///home/vermaden/misc/solaris ~/misc/solaris
file:///home/vermaden/misc/hardware ~/misc/hardware
file:///home/vermaden/misc/emc ~/misc/emc
file:///home/vermaden/misc/tsm ~/misc/tsm
file:///home/vermaden/mp3 ~/mp3
file:///home/vermaden/photo.NEW ~/photo.NEW
file:///home/vermaden/vm ~/vm
file:///home/vermaden/vm/iso ~/vm/iso
file:///home/vermaden/vm/storage ~/vm/storage

GTK3

The GTK3 files are more ordered then GTK2 files. The main configuration is kept in the ~/.config/gtk-3.0/settings.ini file.

Here are my current GTK3 settings.

% cat ~/.config/gtk-3.0/settings.ini
[Settings]
  gtk-theme-name          = Arc
  gtk-icon-theme-name     = faenza
  gtk-font-name           = Ubuntu 10
  gtk-cursor-theme-size   = 0
  gtk-toolbar-style       = GTK_TOOLBAR_ICONS
  gtk-toolbar-icon-size   = GTK_ICON_SIZE_SMALL_TOOLBAR
  gtk-button-images       = 1
  gtk-menu-images         = 1
  gtk-enable-event-sounds = 1
  gtk-xft-antialias       = 1
  gtk-xft-hinting         = 0
  gtk-xft-hintstyle       = hintnone
  gtk-xft-rgba            = rgb

Besides little different syntax the settings are the same as in the GTK2 configuration, thus I will not comment them again to not repeat myself.

The GTK3 Bookmarks are kept in the ~/.config/gtk-3.0/bookmarks file and their syntax is the same as it were for the GTK2 toolkit.

% cat ~/.config/gtk-3.0/bookmarks
file:///home/vermaden/hydepark ~/hydepark
file:///home/vermaden/books ~/books
file:///home/vermaden/gfx ~/gfx
file:///home/vermaden/gfx/wallpapers ~/gfx/wallpapers
file:///home/vermaden/gfx/screenshots ~/gfx/screenshots
file:///home/vermaden/misc ~/misc
file:///home/vermaden/misc/aix ~/misc/aix
file:///home/vermaden/misc/bsd ~/misc/bsd
file:///home/vermaden/misc/hp-ux ~/misc/hp-ux
file:///home/vermaden/misc/linux ~/misc/linux
file:///home/vermaden/misc/solaris ~/misc/solaris
file:///home/vermaden/misc/hardware ~/misc/hardware
file:///home/vermaden/misc/emc ~/misc/emc
file:///home/vermaden/misc/tsm ~/misc/tsm
file:///home/vermaden/mp3 ~/mp3
file:///home/vermaden/photo.NEW ~/photo.NEW
file:///home/vermaden/vm ~/vm
file:///home/vermaden/vm/iso ~/vm/iso
file:///home/vermaden/vm/storage ~/vm/storage

As the GTK2 Bookmarks and GTK3 Bookmarks have the same format you may symlink one to another to not keep two lists of your favorite places.

As the GTK3 framework uses CSS you may tune the GTK3 to your needs in the ~/.config/gtk-3.0/gtk.css file according to the documentation provided by the GNOME team – GTK+ CSS Overview – available here.

I have tried various hacks in the past but after removing them my problems with GTK3 toolkit vanished. If you will find some interesting settings then let me know πŸ™‚

QT

The QT toolkit configuration was always a real PITA and this haven’t changed in the latest QT5 release. The default themes provided are ugly and the ones available to download are not that much better. The KDE Plasma 5 looks quite well but making QT4/QT5 look nice on a custom window manager environment is whole other story. With my settings I have minimized the ‘damage’ of the tragic QT look.

I also feel that GTK and its configuration is more UNIX oriented as you only need to edit the files while QT feels more Windows oriented as you often need the graphical config tool to set the options properly.

The QT3/QT4/QT5 use/used these environment variables exported by export(1). I am not sure if they are still respected but I do not want to check all my apps to find out and keeping then in the ~/.xinitrc file does not hurt.

# QT ANTIALIASING
  export QT_XFT=1

# QT MUST KNOW WHERE IS GTK2 CONFIG
  export GTK2_RC_FILES="${HOME}/.gtkrc-2.0"

# QT5 qt5ct
  export QT_QPA_PLATFORMTHEME=qt5ct

QT3

I am not sure if any ‘current’ application uses it, the legendary Opera 12.x used it for sure and configuration was made using the qtconfig graphical utility.

QT4

The QT4 configuration is kept in the ~/.config/Trolltech.conf file (very obvious indeed) and the graphical tool/editor is qt4-qtconfig installed from qt4-qtconfig port/package.

Here is how my current configuration looks like (yes its long and ugly).

% cat ~/.config/Trolltech.conf
[Qt%20Plugin%20Cache%204.8.false]
usr\local\lib\qt4\plugins\imageformats\libqgif.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-12-19T09:37:13
usr\local\lib\qt4\plugins\imageformats\libqico.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-12-19T09:37:13
usr\local\lib\qt4\plugins\imageformats\libqjpeg.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-12-19T09:37:13
usr\local\lib\qt4\plugins\imageformats\libqmng.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-12-19T09:37:13
usr\local\lib\qt4\plugins\imageformats\libqsvg.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-12-19T09:37:13
usr\local\lib\qt4\plugins\imageformats\libqtga.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-12-19T09:37:13
usr\local\lib\qt4\plugins\imageformats\libqtiff.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-12-19T09:37:13
usr\local\lib\qt4\plugins\iconengines\libqsvgicon.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2015-11-21T02:41:20
usr\local\lib\qt4\plugins\inputmethods\libqimsw-multi.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang no-pkg-config, 2015-11-21T02:41:27
usr\local\lib\kde4\plugins\imageformats\kimg_dds.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_eps.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_exr.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_jp2.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_pcx.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_pic.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_psd.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_ras.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_rgb.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_tga.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_xcf.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\plugins\imageformats\kimg_xview.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:10:23
usr\local\lib\kde4\okularpart.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:52:40
usr\local\lib\kde4\okularGenerator_epub.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:52:40
usr\local\lib\kde4\plugins\kscreen\KSC_XRandR.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:12:14
usr\local\lib\kde4\okularGenerator_mobi.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:52:40
usr\local\lib\kde4\okularGenerator_txt.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:52:40
usr\local\lib\kde4\okularGenerator_fb.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:52:40
usr\local\lib\kde4\okularGenerator_ghostview.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:52:40
usr\local\lib\kde4\okularGenerator_ooo.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:52:40
usr\local\lib\kde4\okularGenerator_poppler.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2017-11-26T09:52:40
usr\local\lib\qt4\plugins\styles\libkvantum.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2018-07-07T05:29:12
usr\local\lib\keepassx\libkeepassx-autotype-x11.so=40807, 0, x86_64 usr/local/share/qt4/mkspecs/freebsd clang full-config, 2018-08-09T05:30:15

[Qt%20Factory%20Cache%204.8]
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\qt4\plugins\imageformats\libqgif.so=2017-12-19T09:37:13, gif
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\qt4\plugins\imageformats\libqico.so=2017-12-19T09:37:13, ico
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\qt4\plugins\imageformats\libqjpeg.so=2017-12-19T09:37:13, jpeg, jpg
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\qt4\plugins\imageformats\libqmng.so=2017-12-19T09:37:13, mng
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\qt4\plugins\imageformats\libqsvg.so=2017-12-19T09:37:13, svg, svgz
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\qt4\plugins\imageformats\libqtga.so=2017-12-19T09:37:13, tga
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\qt4\plugins\imageformats\libqtiff.so=2017-12-19T09:37:13, tiff, tif
com.trolltech.Qt.QIconEngineFactoryInterfaceV2%3A\usr\local\lib\qt4\plugins\iconengines\libqsvgicon.so=2015-11-21T02:41:20, svg, svgz, svg.gz
com.trolltech.Qt.QIconEngineFactoryInterface%3A\usr\local\lib\qt4\plugins\iconengines\libqsvgicon.so=2015-11-21T02:41:20
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_dds.so=2017-11-26T09:10:23, dds
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_eps.so=2017-11-26T09:10:23, eps, EPS, epsi, EPSI, epsf, EPSF
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_exr.so=2017-11-26T09:10:23, exr, EXR
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_jp2.so=2017-11-26T09:10:23, jp2
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_pcx.so=2017-11-26T09:10:23, pcx, PCX
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_pic.so=2017-11-26T09:10:23, pic
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_psd.so=2017-11-26T09:10:23, psd, PSD
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_ras.so=2017-11-26T09:10:23, ras, RAS
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_rgb.so=2017-11-26T09:10:23, rgb, RGB, rgba, RGBA, bw, BW, sgi, SGI
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_tga.so=2017-11-26T09:10:23, tga, TGA
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_xcf.so=2017-11-26T09:10:23, xcf, XCF
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\lib\kde4\plugins\imageformats\kimg_xview.so=2017-11-26T09:10:23, xv
com.trolltech.Qt.QStyleFactoryInterface%3A\usr\local\lib\qt4\plugins\styles\libkvantum.so=2018-07-07T05:29:12, Kvantum

[Qt]
style=Cleanlooks
customColors\0=4287598479
customColors\1=4294967295
customColors\2=4278233855
customColors\3=4294967295
customColors\4=4294967295
customColors\5=4294967295
customColors\6=4294967295
customColors\7=4294967295
customColors\8=4294967295
customColors\9=4294967295
customColors\10=4294967295
customColors\11=4294967295
customColors\12=4294967295
customColors\13=4294967295
customColors\14=4294967295
customColors\15=4294967295
font="Ubuntu,10,-1,5,50,0,0,0,0,0"
Palette\active=#000000, #dedede, #ffffff, #eeeeee, #6f6f6f, #949494, #000000, #ffffff, #000000, #ffffff, #dedede, #000000, #8f8f8f, #ffffff, #8f8f8f, #c753ae, #eeeeee, #000000, #ffffdc, #000000
Palette\inactive=#000000, #dedede, #ffffff, #ffffff, #6f6f6f, #949494, #000000, #ffffff, #000000, #ffffff, #dedede, #000000, #8f8f8f, #ffffff, #8f8f8f, #c753ae, #eeeeee, #000000, #ffffdc, #000000
Palette\disabled=#808080, #dedede, #ffffff, #ffffff, #6f6f6f, #949494, #808080, #ffffff, #808080, #ffffff, #dedede, #000000, #8f8f8f, #808080, #8f8f8f, #c753ae, #eeeeee, #000000, #ffffdc, #000000
fontPath=@Invalid()
embedFonts=true
doubleClickInterval=400
cursorFlashTime=1000
wheelScrollLines=3
resolveSymlinks=false
globalStrut\width=0
globalStrut\height=0
useRtlExtensions=false
XIMInputStyle=On The Spot
DefaultInputMethod=xim
audiosink=Auto
videomode=Auto
GUIEffects=none
filedialog="@ByteArray(\0\0\0\xbe\0\0\0\x3\0\0\0\x1e\0\0\0\xff\0\0\0\0\0\0\0\x2\0\0\0K\0\0\xe\0\x1\0\0\0\x6\x1\0\0\0\x1\0\0\0\x2\0\0\0\x5\x66ile:\0\0\0\x15\x66ile:///home/vermaden\0\0\0\x5\0\0\0.\0/\0h\0o\0m\0\x65\0/\0v\0\x65\0r\0m\0\x61\0\x64\0\x65\0n\0/\0\x64\0o\0w\0n\0l\0o\0\x61\0\x64\0\0\0\x34\0/\0h\0o\0m\0\x65\0/\0v\0\x65\0r\0m\0\x61\0\x64\0\x65\0n\0/\0g\0\x61\0m\0\x65\0s\0.\0L\0O\0\x43\0\x41\0L\0\0\0*\0/\0h\0o\0m\0\x65\0/\0v\0\x65\0r\0m\0\x61\0\x64\0\x65\0n\0/\0v\0m\0/\0i\0s\0o\0\0\0\xa4\0/\0h\0o\0m\0\x65\0/\0v\0\x65\0r\0m\0\x61\0\x64\0\x65\0n\0/\0\x64\0o\0w\0n\0l\0o\0\x61\0\x64\0/\0W\0i\0n\0\x64\0o\0w\0s\0 \0\x37\0w\0s\0z\0y\0s\0t\0k\0i\0\x65\0 \0w\0\x65\0r\0s\0j\0\x65\0 \0x\0\x38\0\x36\0 \0x\0\x36\0\x34\0 \0[\0P\0L\0]\0/\0W\0i\0n\0\x64\0o\0w\0s\0 \0\x37\0 \0S\0P\0\x31\0 \0 \0[\0P\0L\0]\0\0\0\x32\0/\0h\0o\0m\0\x65\0/\0v\0\x65\0r\0m\0\x61\0\x64\0\x65\0n\0/\0v\0m\0/\0s\0t\0o\0r\0\x61\0g\0\x65\0\0\0*\0/\0h\0o\0m\0\x65\0/\0v\0\x65\0r\0m\0\x61\0\x64\0\x65\0n\0/\0v\0m\0/\0i\0s\0o\0\0\0~\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1T\0\0\0\x4\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x4\0\0\0\xb5\0\0\0\x1\0\0\0\0\0\0\0)\0\0\0\x1\0\0\0\0\0\0\0,\0\0\0\x1\0\0\0\0\0\0\0J\0\0\0\x1\0\0\0\0\0\0\0\x1)"

[Qt%20Plugin%20Cache%204.6.false]
usr\local\share\google-earth\plugins\imageformats\libqgif.so=40601, 0, generic linux lsb-g++ full-config, 2011-05-17T09:42:02
usr\local\share\google-earth\plugins\imageformats\libqjpeg.so=40601, 0, generic linux lsb-g++ full-config, 2011-05-17T09:42:02

[Qt%20Factory%20Cache%204.6]
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\share\google-earth\plugins\imageformats\libqgif.so=2011-05-17T09:42:02, gif
com.trolltech.Qt.QImageIOHandlerFactoryInterface%3A\usr\local\share\google-earth\plugins\imageformats\libqjpeg.so=2011-05-17T09:42:02, jpeg, jpg

… and how it looks when loaded in the qt4-qtconfig editor.

qt4-qtconfig.jpg

QT5

The QT5 is kinda special as it requires this export(1) in the ~/.xinitrc (or ~/.xsession) file.

# QT5 qt5ct
  export QT_QPA_PLATFORMTHEME=qt5ct

Do not ask me why and I do not even want to know πŸ™‚

The QT5 configuration is kept in the ~/.config/qt5ct/qt5ct.conf file and the graphical tool/editor is qt5ct installed from qt5ct port/package.

Here is how my current QT5 configuration looks like.

% cat ~/.config/qt5ct/qt5ct.conf
[Appearance]
color_scheme_path=/usr/local/share/qt5ct/colors/dusk.conf
custom_palette=true
icon_theme=Faenza
standard_dialogs=default
style=Fusion

[Fonts]
fixed=@Variant(\0\0\0@\0\0\0\x10\0\x43\0o\0n\0s\0o\0l\0\x61\0s@$\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
general=@Variant(\0\0\0@\0\0\0\f\0U\0\x62\0u\0n\0t\0u@$\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x19\x10)

[Interface]
activate_item_on_single_click=1
buttonbox_layout=3
cursor_flash_time=1000
dialog_buttons_have_icons=1
double_click_interval=400
gui_effects=@Invalid()
menus_have_icons=true
stylesheets=/usr/local/share/qt5ct/qss/fusion-fixes.qss
toolbutton_style=4
underline_shortcut=1
wheel_scroll_lines=3

[SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\x2\x84\0\0\0j\0\0\x5\xd5\0\0\x3w\0\0\x2\x86\0\0\0\x81\0\0\x5\xd3\0\0\x3s\0\0\0\0\0\0\0\0\x6@)

… and how it looks when loaded in the qt5ct editor.

qt5ct.jpg

Back to the Xdefaults

The ~/.Xdefaults file (some use ~/.Xresources instead) also contain fonts information and setup of the cursor theme for the X11 Window System session.

Below you will find my settings, as mentined earlier, also ‘copied’ here.

! FONTS
! -----------------------------------------------------------------------------
  Xft.antialias:  true
  Xft.hinting:    false
  Xft.hintstyle:  0
  Xft.dpi:        75
  Xft.rgba:       none

! CURSOR
! -----------------------------------------------------------------------------
  Xcursor.theme: Vanilla-DMZ
  Xcursor.size:  24

The cursor theme is from the /usr/ports/x11-themes/cursor-dmz-theme port/package.

Xinitrc and Back Again

For the record, the complete GTK/QT settings in the ~/.xinitrc file are as follows.

# QT MUST KNOW WHERE IS GTK2 CONFIG
  export GTK2_RC_FILES="${HOME}/.gtkrc-2.0"

# QT5 qt5ct
  export QT_QPA_PLATFORMTHEME=qt5ct

# GTK/QT ANTIALIASING
  export QT_XFT=1
  export GDK_USE_XFT=1

# FORCE LIBREOFFICE TO USE GTK THEME
  export OOO_FORCE_DESKTOP=gnome

Hope that information provided in this article moved you one more step closer to good looking and practical FreeBSD desktop πŸ˜‰

EOF

Wallpapers from Tech Pron

The Tech Pron at Twitter – @techno_pron – is a bot that posts aesthetic tech pics. Most of these computers pictures were made on a solid (or close to it) background color so I though it may be a cool idea to create wallpapers from them.

I have picked up 20 most interesting ones and made high resolution backgrounds of them. Here is their montage.

wallpapers-oldschool-machines.jpg

To download them all just follow this wallpapers-oldschool-machines.tar.gz file.

When needed use my random_wallpaper.sh handler from the https://github.com/vermaden/scripts repository to setup random wallpaper from directory.

EOF

FreeBSD Desktop – Part 14 – Configuration – Tint2

In today’s article in the FreeBSD Desktop series we will focus on the task bar configuration. I will describe how to setup the Tint2.

You may also check earlier articles of the FreeBSD Desktop series:

Features

The task bar role served by the Tint2 will be providing the following features.

  • Launcher for the most used applications.
  • Show opened/minimized windows on each of four virtual desktops.
  • Indicate current used virtual desktop.
  • Provide system tray area for applications that depend on it.
  • Maximize selected window with [Right Mouse Button].
  • Close selected window with [Middle Mouse Button].
  • Focus selected window along with switching to the virtual desktop with that window using [Left Mouse Button].
  • Pass [Left/Middle/Right Mouse Button] events to Openbox window manager when not clicked on objects.
  • Provide buttons – cpu_L cpu_M cpu_H – to set various CPU frequencies (from left Low/Medium/High).
  • Provide button – wallpaper – to set new random wallpaper.

Here is how such Tint2 task bar would look like in action, along with previously configured Dzen2 status bar.

vermaden-tint2.jpg

Tint

The Tint2 is very light solution, one of the lightest that I know while being very nice looking and effective. A rare fusion of features πŸ™‚

To achieve described earlier features we will use following Tint2 configuration ~/.tint2rc file.

% cat ~/.tint2rc
# GENERAL
# -------
  rounded          = 0
  border_width     = 0
  background_color = #222222 100
  border_color     = #000000 0

# AUTOHIDE
# --------
  autohide     = 0
  strut_policy = minimum

# TOOLTIP
# -------
  tooltip = 0

# MOUSE
# -----
  mouse_middle = close
  mouse_right  = maximize_restore

# PANEL
# -----
  wm_menu             = 1
  panel_items         = LTS
  panel_monitor       = 1
  panel_position      = top center
  panel_size          = 0 16
  panel_margin        = 0 12
  panel_padding       = 0 0 16
  panel_layer         = bottom
  panel_background_id = 1
  font_shadow         = 0

# LAUNCHER
# --------
  launcher_padding       = 0 0 1
  launcher_background_id = 1
  launcher_icon_size     = 14
  launcher_item_app      = /home/vermaden/.apps/caja.desktop
  launcher_item_app      = /home/vermaden/.apps/thunar.desktop
  launcher_item_app      = /home/vermaden/.apps/nfs.desktop
  launcher_item_app      = /home/vermaden/.apps/terminal.desktop
  launcher_item_app      = /home/vermaden/.apps/geany.desktop
  launcher_item_app      = /home/vermaden/.apps/leafpad.desktop
  launcher_item_app      = /home/vermaden/.apps/pidgin.desktop
  launcher_item_app      = /home/vermaden/.apps/thunderbird.desktop
  launcher_item_app      = /home/vermaden/.apps/firefox.desktop
  launcher_item_app      = /home/vermaden/.apps/chromium.desktop
  launcher_item_app      = /home/vermaden/.apps/gimp.desktop
  launcher_item_app      = /home/vermaden/.apps/galculator.desktop
  launcher_item_app      = /home/vermaden/.apps/deadbeef.desktop
  launcher_item_app      = /home/vermaden/.apps/transmission.desktop
  launcher_item_app      = /home/vermaden/.apps/cpu_L.desktop
  launcher_item_app      = /home/vermaden/.apps/cpu_M.desktop
  launcher_item_app      = /home/vermaden/.apps/cpu_H.desktop
  launcher_item_app      = /home/vermaden/.apps/wallpaper.desktop

# TASKBAR
# -------
  taskbar_mode                   = multi_desktop
  taskbar_padding                = 0 0 1
  taskbar_background_id          = 1
  taskbar_active_background_id   = 1
  taskbar_distribute_size        = 0
  taskbar_name                   = 1
  taskbar_name_font              = Ubuntu Mono 8
  taskbar_name_font_color        = #aaaaaa 100
  taskbar_name_active_font_color = #dd0000 100

# TASKS
# -----
  task_icon                 = 1
  task_text                 = 0
  task_width                = 14
  task_centered             = 1
  task_padding              = 0 0 1
  task_background_id        = 0
  task_active_background_id = 0
  task_iconified_icon_asb   = 40 0 0

# SYSTRAY
# -------
  systray           = 1
  systray_padding   = 0 0 1
  systray_icon_size = 14

Because the *.desktop files does not support relative directories for Icon parameter such as ‘~‘ so they need to be replaced before start at the ~/.xinitrc file (or ~/.xsession file), similarly like with the Openbox files.

We already had following Openbox ‘find/replace’ in the ~/.xinitrc file (or ~/.xsession file).

# ICONS WM
  sed -i '' -E "s%\/home\/[a-zA-Z0-9_-]+\/%\/home\/${USER}\/%g" ~/.config/openbox/menu.xml
  sed -i '' -E "s%\/home\/[a-zA-Z0-9_-]+\/%\/home\/${USER}\/%g" ~/.config/openbox/rc.xml

We will now add the ‘rules’ needed for Tint2 and the *.desktop files from the ~/.apps directory.

# ICONS TINT2
  sed -i '' -E "s%\/home\/[a-zA-Z0-9_-]+\/%\/home\/${USER}\/%g" ~/.tint2rc

# ICONS APPS
  for I in ~/.apps/*.desktop
  do
    sed -i '' -E "s%\/home\/[a-zA-Z0-9_-]+\/%\/home\/${USER}\/%g" "${I}"
  done

Here is how the Tint2 startup is configured in the ~/.xinitrc (or ~/.xsession file).

% grep tint ~/.xinitrc                      
  ~/scripts/__openbox_restart_tint2.sh &

Remember to put ‘&‘ at the end of the line.

Doas

To make most scripts work Your user (vuk in the series) needs to be in the wheel, operator and network groups and doas(1) (sudo(8) equivalent) needs to be installed and configured in the following way.

# pkg install doas

# pw groupmod wheel    -m vuk
# pw groupmod operator -m vuk
# pw groupmod network  -m vuk

# cat /usr/local/etc/doas.conf
permit nopass :wheel as root

permit nopass :network as root cmd ifconfig
permit nopass :network as root cmd dhclient
permit nopass :network as root cmd umount
permit nopass :network as root cmd wpa_supplicant
permit nopass :network as root cmd ppp
permit nopass :network as root cmd killall args -9 dhclient
permit nopass :network as root cmd killall args -9 wpa_supplicant
permit nopass :network as root cmd killall args -9 ppp
permit nopass :network as root cmd cat args /etc/ppp/ppp.conf
permit nopass :network as root cmd /etc/rc.d/netif args onerestart
permit nopass :network as root cmd tee args /etc/resolv.conf
permit nopass :network as root cmd tee args -a /etc/resolv.conf

Scripts

There is only one new script added – ~/scripts/nfs.sh – all others are already published in previous *.tar.gz files. Its also optional because you may not have NAS resource which you would want to mount … or maybe you prefer SSHFS or CIFS share …

I also uploaded all the scripts as individual files to the GitHub page.

Make sure they remain executable.

% chmod +x ~/scripts/*

To make them work properly add ~/scripts into the ${PATH} variable at the beginning of the ~/.xinitrc file.

# PATH TO SCRIPTS
  export PATH=${PATH}:~/scripts

All of my scripts have this ‘mysterious’ line at the end. Its for statistics to check which scripts are run when (or it at all to which ones to delete).

echo '1' >> ~/scripts/stats/$( basename ${0} )

Thus it is needed to create the ‘stats’ directory.

% mkdir -p ~/scripts/stats

I have implemented that about two months ago and here are the results.

% wc -l ~/scripts/stats/* | sort -n
       1 /home/vermaden/scripts/stats/__openbox_edit_wallpaper_gimp.sh
       1 /home/vermaden/scripts/stats/__openbox_restart_lxpanel.sh
       1 /home/vermaden/scripts/stats/__openbox_show_screenshot.sh
       1 /home/vermaden/scripts/stats/__openbox_stats_top_cpu_KILL.sh
       1 /home/vermaden/scripts/stats/__openbox_stats_top_mem_RENICE.sh
       2 /home/vermaden/scripts/stats/__openbox_fullscreen.sh
       2 /home/vermaden/scripts/stats/__openbox_stats_top_cpu_RENICE.sh
       3 /home/vermaden/scripts/stats/__openbox_current_wallpaper.sh
       5 /home/vermaden/scripts/stats/__openbox_cpufreq.sh
       5 /home/vermaden/scripts/stats/__openbox_dmenu.sh
       9 /home/vermaden/scripts/stats/__openbox_virtualbox.sh
      10 /home/vermaden/scripts/stats/__openbox_delete_wallpaper.sh
      13 /home/vermaden/scripts/stats/__openbox_restart_conky.sh
      13 /home/vermaden/scripts/stats/__openbox_restart_plank.sh
      17 /home/vermaden/scripts/stats/__openbox_lock.sh
      20 /home/vermaden/scripts/stats/nfs.sh
      21 /home/vermaden/scripts/stats/__openbox_freebsd_sound.sh
      22 /home/vermaden/scripts/stats/__openbox_lock_zzz.sh
      24 /home/vermaden/scripts/stats/__openbox_edit_screenshot.sh
      24 /home/vermaden/scripts/stats/__openbox_restart_dzen2.sh
      24 /home/vermaden/scripts/stats/dzen2-fifo.sh
      28 /home/vermaden/scripts/stats/__openbox_restart_tint2.sh
      32 /home/vermaden/scripts/stats/aero-snap.sh
      48 /home/vermaden/scripts/stats/shot.sh
      56 /home/vermaden/scripts/stats/network.sh
     447 /home/vermaden/scripts/stats/xdotool.sh
     599 /home/vermaden/scripts/stats/xterm.sh
    1862 /home/vermaden/scripts/stats/random_wallpaper.sh
    5923 /home/vermaden/scripts/stats/__conky_if_ip.sh
    5942 /home/vermaden/scripts/stats/dzen2-update.sh
    5956 /home/vermaden/scripts/stats/__conky_if_dns.sh
    5956 /home/vermaden/scripts/stats/__conky_if_gw.sh
    5959 /home/vermaden/scripts/stats/__conky_battery.sh
    5966 /home/vermaden/scripts/stats/__conky_if_ping.sh
   28359 /home/vermaden/scripts/stats/desktop-kill-shit.sh
   67352 total

Of course I limited the output only to scripts that are available in this article, but be patient, more to come later πŸ™‚

Dependencies

To make these scripts work and generally to make all this setup work we will need these dependencies.

  • tint2
  • caja
  • chromium
  • deadbeef
  • firefox
  • galculator
  • geany
  • gimp
  • leafpad
  • midori
  • pidgin
  • xterm
  • thunar
  • thunderbird
  • transmission-gtk
  • feh
  • xkill

To install them all with pkg(8) just type this line below.

# pkg install \
    tint2 caja chromium deadbeef firefox galculator midori \
    geany gimp leafpad xterm thunar xkill transmission-gtk \
    thunderbird feh pidgin
   

We have finished making the ‘top’ bars. You now have all needed information in the status bar server by Dzen2 and all applications/windows covered by the Tint2 task bar.

EOF

FreeBSD Desktop – Part 13 – Configuration – Dzen2

Time for real configuration of the status bar. In today’s article of the FreeBSD Desktop series I will describe how to configure the Dzen2.

You may also check earlier articles of the FreeBSD Desktop series:

Features

The provided status bar backed by Dzen2 will be providing the following information.

  • date: Date in ISO 8601 format along with current time.
  • sys: CPU frequency, CPU temperature, system load and free RAM.
  • ip: List of current IP addresses and its interfaces.
  • gw: System default network gateway.
  • dns: System default DNS.
  • ping: Current Internet access state.
  • vol/pcm: Volume level for vol and pcm backends.
  • fs: ZFS pools free space.
  • bat: Battery and AC status.
  • top: Top 3 processes with highest CPU usage along with their RAM usage.

Here is how such Dzen2 looks like in action.

vermaden-dzen2.jpg

Dzen2

The Dzen2 offers feature that Conky or other status bar applications does not offer. I would call it refresh on demand. If you would like to implement refresh interval of 60 seconds for example (not so often) and also refresh that information everytime you ‘click’ on the status bar (or by other action) its possible to implement in Dzen2 using mkfifo(1) command.

Why anyone would want to implement such ‘strange’ refresh policy? To get more battery life mostly as You do not need this information to be refreshed every second and if You need up to date information then you will refresh it manually with a click on the status bar and have the needed information. The other reason is ‘focus’. If this status bar refreshes every second, then it ‘caches’ your attention, this may prevent you from focusing deep enough on the task you are currently doing. If you do something important that requires focus then You do not want status bar (or anything else) to distract you with useless at the moment information.

To achieve such configuration we would need three things. The dzen2-fifo.sh script that will start initial fifo on the ~/.dzen2-fifo file. The dzen2-update.sh to update the fifo and would be run from the crontab(1) every 60 seconds. A dzen2(1) action configured with left mouse button click to invoke dzen2-update.sh to update the fifo. All these scripts and scripts used directly by Dzen2 to gather needed information are available in the scripts-status-bar.tar.gz file.

To start Dzen2 at the X11 startup we will use script from the earlier ‘bulk’ already available – __openbox_restart_dzen2.sh – which kills all instances of Dzen2 and then starts the fifo backed Dzen2 with dzen2-fifo.sh script available in the scripts.tar.gz file.

Here is how its configured in the ~/.xinitrc (or ~/.xsession) file.

% grep dzen ~/.xinitrc                      
  ~/scripts/__openbox_restart_dzen2.sh &

Remember to put ‘&‘ at the end of the line.

Lets have a look how the ‘update’ is configured in the crontab(1) as shown below.

% crontab -l
# DZEN2
  0 * * * * ~/scripts/dzen2-update.sh 1> ~/.dzen2-fifo                                        2> /dev/null

The scripts that Dzen2 uses to gather information are:

~/scripts/__conky_if_ip.sh
~/scripts/__conky_if_gw.sh
~/scripts/__conky_if_dns.sh
~/scripts/__conky_if_ping.sh
~/scripts/__conky_battery.sh

… and this one to ’emulate’ clicks to implement Openbox virtual desktops switching with [Scroll Up] and [Scroll Down] mouse events.

~/scripts/xdotool.sh

The dzen2-update.sh is kinda like Conky on terminal, it just puts all that information in text format with Dzen2 colors syntax as shown below.

% dzen2-update.sh
 ^fg(#aaaaaa)date: ^fg(#eeeeee)2018/07/05/Thu/10:11 ^fg(#dd0000)| ^fg(#aaaaaa)sys: ^fg(#eeeeee)800MHz/46.1C/0.83/4.5GB ^fg(#dd0000)| ^fg(#aaaaaa)ip: ^fg(#eeeeee)wlan0/wirelesssid/192.168.0.3 ^fg(#dd0000)| ^fg(#aaaaaa)gw: ^fg(#eeeeee)192.168.0.1 ^fg(#dd0000)| ^fg(#aaaaaa)dns: ^fg(#eeeeee)192.168.0.1 ^fg(#dd0000)| ^fg(#aaaaaa)ping: ^fg(#eeeeee)^fg(#dd2200)NOPE ^fg(#dd0000)| ^fg(#aaaaaa)vol/pcm: ^fg(#eeeeee)100/100 ^fg(#dd0000)| ^fg(#aaaaaa)fs: ^fg(#eeeeee)local/69.2G sys/3.27G ^fg(#dd0000)| ^fg(#aaaaaa)bat: ^fg(#eeeeee)AC/^fg(#ffffff)90% ^fg(#dd0000)| ^fg(#aaaaaa)top: ^fg(#eeeeee)firefox/15%/0.6GB firefox/13%/0.3GB firefox/11%/0.4GB 

Doas

To make most scripts work Your user (vuk in the series) needs to be in the wheel, operator and network groups and doas(1) (sudo(8) equivalent) needs to be installed and configured in the following way.

# pkg install doas

# pw groupmod wheel    -m vuk
# pw groupmod operator -m vuk
# pw groupmod network  -m vuk

# cat /usr/local/etc/doas.conf
permit nopass :wheel as root

permit nopass :network as root cmd ifconfig
permit nopass :network as root cmd dhclient
permit nopass :network as root cmd umount
permit nopass :network as root cmd wpa_supplicant
permit nopass :network as root cmd ppp
permit nopass :network as root cmd killall args -9 dhclient
permit nopass :network as root cmd killall args -9 wpa_supplicant
permit nopass :network as root cmd killall args -9 ppp
permit nopass :network as root cmd cat args /etc/ppp/ppp.conf
permit nopass :network as root cmd /etc/rc.d/netif args onerestart
permit nopass :network as root cmd tee args /etc/resolv.conf
permit nopass :network as root cmd tee args -a /etc/resolv.conf

Scripts

In this post I attach scripts related to Dzen2. Download them all in the scripts-status-bar.tar.gz file and unpack them into the ~/scripts directory.

Here are these scripts.

% tar -tf scripts-status-bar.tar.gz
~/scripts/dzen2-fifo.sh
~/scripts/dzen2-update.sh
~/scripts/xdotool.sh
~/scripts/__conky_if_ip.sh
~/scripts/__conky_if_gw.sh
~/scripts/__conky_if_dns.sh
~/scripts/__conky_if_ping.sh
~/scripts/__conky_battery.sh

Make sure they remain executable.

% chmod +x ~/scripts/*

To make them work properly add ~/scripts into the ${PATH} variable at the beginning of the ~/.xinitrc file.

# PATH TO SCRIPTS
  export PATH=${PATH}:~/scripts

All of my scripts have this ‘mysterious’ line at the end. Its for statistics to check which scripts are run when (or it at all to which ones to delete).

echo '1' >> ~/scripts/stats/$( basename ${0} )

Thus it is needed to create the ‘stats’ directory.

% mkdir -p ~/scripts/stats

I have implemented that about two months ago and here are the results.

% wc -l ~/scripts/stats/* | sort -n
       1 /home/vermaden/scripts/stats/__openbox_show_screenshot.sh
       2 /home/vermaden/scripts/stats/__openbox_cpufreq.sh
       2 /home/vermaden/scripts/stats/__openbox_current_wallpaper.sh
       2 /home/vermaden/scripts/stats/__openbox_fullscreen.sh
       4 /home/vermaden/scripts/stats/__openbox_restart_dzen2.sh
       4 /home/vermaden/scripts/stats/dzen2-fifo.sh
       5 /home/vermaden/scripts/stats/__openbox_dmenu.sh
       5 /home/vermaden/scripts/stats/__openbox_restart_conky.sh
       5 /home/vermaden/scripts/stats/__openbox_restart_tint2.sh
       6 /home/vermaden/scripts/stats/__openbox_delete_wallpaper.sh
       7 /home/vermaden/scripts/stats/__openbox_freebsd_sound.sh
       8 /home/vermaden/scripts/stats/aero-snap.sh
      12 /home/vermaden/scripts/stats/__openbox_edit_screenshot.sh
      16 /home/vermaden/scripts/stats/__openbox_lock_zzz.sh
      16 /home/vermaden/scripts/stats/__openbox_lock.sh
      22 /home/vermaden/scripts/stats/shot.sh
      24 /home/vermaden/scripts/stats/network.sh
     214 /home/vermaden/scripts/stats/xterm.sh
     960 /home/vermaden/scripts/stats/random_wallpaper.sh
    2767 /home/vermaden/scripts/stats/desktop-battery-warning.sh
   13834 /home/vermaden/scripts/stats/desktop-kill-shit.sh
   17916 total

Of course I limited the output only to scripts that are available in this article, but be patient, more to come later πŸ™‚

Dependencies

To make these scripts work and generally to make all this setup work we will need these dependencies.

  • dzen2
  • xdotool
  • wmctrl

To install them all with pkg(8) just type this line below.

# pkg install dzen2 xdotool wmctrl
   

Crontab

After adding Dzen2 to crontab(1) and keeping the earlier entries the complete crontab(1) would look like that.

% crontab -l
# DESKTOP
  *     *     * * * ~/scripts/desktop-kill-shit.sh                                       1> /dev/null 2> /dev/null
  */5   *     * * * ~/scripts/desktop-battery-warning.sh
  */20  *     * * * ~/scripts/random_wallpaper.sh ~/gfx/wallpapers                       1> /dev/null 2> /dev/null
  12,0  *     * * * /usr/bin/find ~/.cache -mtime +10 -delete                            1> /dev/null 2> /dev/null
  0     */3   * * * /usr/bin/find ~/.local/share/Trash/files -mtime +1 -delete           1> /dev/null 2> /dev/null

# DZEN2
  0     *     * * * ~/scripts/dzen2-update.sh 1> ~/.dzen2-fifo                                        2> /dev/null

Shortcuts

This Dzen2 configuration implements five ‘mouse actions’ or shortcuts available on the status bar.

  • [Scroll Up] – switch next virtual desktop.
  • [Scroll Down] – switch previous virtual desktop.
  • [Right Click] – show Openbox root menu.
  • [Middle Click] – show Openbox window menu.
  • [Left Click] – update Dzen2 Status Bar with dzen2-update.sh invoke.

Hope I haven’t forgot anything, feel free to ask or remind me πŸ˜‰

EOF

FreeBSD Desktop – Part 12 – Configuration – Openbox

Time to cut the bullshit and actually make some real configuration. In today’s article of the FreeBSD Desktop series I will describe how to configure the Openbox window manager.

You may also check earlier/other articles of the FreeBSD Desktop series:

Features

Comparing to earlier articles in the series it will be HUGE, sorry for that. I could cut it into smaller parts but that would require editing of the Openbox configuration, its shortcuts and menus over and over again, so for the sake of simplicity its better to put it all at once. As it is as that big there will be mistakes, but I will fix them ASAP.

Here is the list of all features that will be available in this Openbox configuration.

  • Nice looking Openbox theme.
  • Openbox Menu (static) with nice looking icons.
  • Openbox Menu for FreeBSD top(1)/ps(1) commands and config files/logs.
  • Openbox Menu for FreeBSD default sound output.
  • Openbox Menu and shortcuts for FreeBSD sound volume increase/decrease.
  • Openbox Menu for FreeBSD for CPU frequency scaling.
  • Openbox Menu for FreeBSD network management with network.sh script.
  • Openbox Menu for screenshots/wallpapers management.
  • Openbox Menu for Recent files.
  • Random wallpaper handling.
  • Random xterm(1) theme at every terminal start with lost of great themes.
  • Openbox shortcuts and script for Aero Snap like behavior.
  • Openbox Dmenu shortcuts and integration.
  • Openbox configured with nice fonts.
  • Openbox shortcuts for most important tasks.
  • Warning for low battery on laptop.
  • I probably forgot about dozen other features – let me know in comments πŸ™‚

Here is how the Openbox menus and window borders and window switching would look like.

openbox-alt-tab

openbox-menu

Here are all the files with needed configuration.

Doas

To make most scripts work Your user (vuk in the series) needs to be in the wheel, operator and network groups and doas(1) (sudo(8) equivalent) needs to be installed and configured in the following way.

# pkg install doas

# pw groupmod wheel    -m vuk
# pw groupmod operator -m vuk
# pw groupmod network  -m vuk

# cat /usr/local/etc/doas.conf
permit nopass :wheel as root

permit nopass :network as root cmd ifconfig
permit nopass :network as root cmd dhclient
permit nopass :network as root cmd umount
permit nopass :network as root cmd wpa_supplicant
permit nopass :network as root cmd ppp
permit nopass :network as root cmd killall args -9 dhclient
permit nopass :network as root cmd killall args -9 wpa_supplicant
permit nopass :network as root cmd killall args -9 ppp
permit nopass :network as root cmd cat args /etc/ppp/ppp.conf
permit nopass :network as root cmd /etc/rc.d/netif args onerestart
permit nopass :network as root cmd tee args /etc/resolv.conf
permit nopass :network as root cmd tee args -a /etc/resolv.conf

Scripts

In this post I attach scripts I have made and used for about 13 years since I started to use FreeBSD on the desktop. Download them all in the scripts.tar.gz file and unpack them into the ~/scripts to make it look like that.

% find scripts | sort
scripts/__openbox_cpufreq.sh
scripts/__openbox_current_wallpaper.sh
scripts/__openbox_delete_wallpaper.sh
scripts/__openbox_dmenu.sh
scripts/__openbox_edit_screenshot.sh
scripts/__openbox_edit_wallpaper_gimp.sh
scripts/__openbox_freebsd_sound.sh
scripts/__openbox_lock_zzz.sh
scripts/__openbox_lock.sh
scripts/__openbox_recent.sh
scripts/__openbox_reload_wallpaper.sh
scripts/__openbox_restart_conky.sh
scripts/__openbox_restart_dzen2.sh
scripts/__openbox_restart_plank.sh
scripts/__openbox_restart_tint2.sh
scripts/__openbox_show_screenshot.sh
scripts/__openbox_stats_ps_KILLALL.sh
scripts/__openbox_stats_top_cpu_KILL.sh
scripts/__openbox_stats_top_cpu_RENICE.sh
scripts/__openbox_stats_top_mem_KILL.sh
scripts/__openbox_stats_top_mem_RENICE.sh
scripts/aero-snap.sh
scripts/fc-cache.sh
scripts/firefox-clean.sh
scripts/network.sh
scripts/random_wallpaper.sh
scripts/shot.sh
scripts/xterm.sh
scripts/desktop-kill-shit.sh
scripts/desktop-battery-warning.sh

Make sure they remain executable.

% chmod +x ~/scripts/*

To make them work properly add ~/scripts into the ${PATH} variable at the beginning of the ~/.xinitrc file.

# PATH TO SCRIPTS
  export PATH=${PATH}:~/scripts


All of my scripts have this ‘mysterious’ line at the end. Its for statistics to check which scripts are run when (or it at all to which ones to delete).

echo '1' >> ~/scripts/stats/$( basename ${0} )

Thus it is needed to create the ‘stats’ directory.

% mkdir -p ~/scripts/stats

I have implemented that about two months ago and here are the results.

% wc -l ~/scripts/stats/* | sort -n
       1 /home/vermaden/scripts/stats/__openbox_show_screenshot.sh
       2 /home/vermaden/scripts/stats/__openbox_cpufreq.sh
       2 /home/vermaden/scripts/stats/__openbox_current_wallpaper.sh
       2 /home/vermaden/scripts/stats/__openbox_fullscreen.sh
       4 /home/vermaden/scripts/stats/__openbox_restart_dzen2.sh
       4 /home/vermaden/scripts/stats/dzen2-fifo.sh
       5 /home/vermaden/scripts/stats/__openbox_dmenu.sh
       5 /home/vermaden/scripts/stats/__openbox_restart_conky.sh
       5 /home/vermaden/scripts/stats/__openbox_restart_tint2.sh
       6 /home/vermaden/scripts/stats/__openbox_delete_wallpaper.sh
       7 /home/vermaden/scripts/stats/__openbox_freebsd_sound.sh
       8 /home/vermaden/scripts/stats/aero-snap.sh
      12 /home/vermaden/scripts/stats/__openbox_edit_screenshot.sh
      16 /home/vermaden/scripts/stats/__openbox_lock_zzz.sh
      16 /home/vermaden/scripts/stats/__openbox_lock.sh
      22 /home/vermaden/scripts/stats/shot.sh
      24 /home/vermaden/scripts/stats/network.sh
     214 /home/vermaden/scripts/stats/xterm.sh
     960 /home/vermaden/scripts/stats/random_wallpaper.sh
    2767 /home/vermaden/scripts/stats/desktop-battery-warning.sh
   13834 /home/vermaden/scripts/stats/desktop-kill-shit.sh
   17916 total

Of course I limited the output only to scripts that are available in this article, but be patient, more to come later πŸ™‚

Dependencies

To make these scripts work and generally to make all this setup work we will need these dependencies.

  • arandr
  • gfontview
  • qtconfig
  • qt5ct
  • qtconfig-qt4
  • sakura
  • leafpad
  • geany
  • caja
  • thunar
  • libreoffice
  • galculator
  • pidgin
  • firefox
  • chrome
  • deadbeef
  • transmission-gtk
  • gnumeric
  • abiword
  • audacity
  • filezilla
  • midori
  • gimp
  • lupe
  • recorder
  • xvidcap
  • zenity
  • xterm
  • xrdb
  • scrot
  • feh
  • wmctrl
  • xdotool
  • viewnior
  • tint2
  • plank
  • dzen2
  • conky
  • mate-screensaver
  • xlockmore
  • gimp
  • dmenu
  • powerdxx
  • htop
  • galculator

To install them all with pkg(8) just type this line below.

# pkg install \
    geany caja thunar libreoffice galculator pidgin firefox chrome midori \
    abiword deadbeef transmission-gtk gnumeric  audacity filezilla zenity \
    gimp lupe recorder xvidcap  xterm xrdb scrot feh wmctrl xdotool tint2 \
    viewnior plank dzen2 conky mate-screensaver xlockmore powerdxx arandr \
    qt5ct gfontview galculator qtconfig qtconfig-qt4 sakura leafpad dmenu \
    htop 
   

I also assume that wallpapers will be kept under ~/gfx/wallpapers dir and screenshots made under ~/gfx/screenshots directory, so lets create them now.

% mkdir -p ~/gfx/wallpapers
% mkdir -p ~/gfx/screenshots

Crontab

Some of these scripts needs to be put into crontab(1) to work, here are their entries.

% crontab -l
# DESKTOP
  *     *     * * * ~/scripts/desktop-kill-shit.sh                                       1> /dev/null 2> /dev/null
  */5   *     * * * ~/scripts/desktop-battery-warning.sh
  */20  *     * * * ~/scripts/random_wallpaper.sh ~/gfx/wallpapers                       1> /dev/null 2> /dev/null
  12,0  *     * * * /usr/bin/find ~/.cache -mtime +10 -delete                            1> /dev/null 2> /dev/null
  0     */3   * * * /usr/bin/find ~/.local/share/Trash/files -mtime +1 -delete  1> /dev/null 2> /dev/null

Fonts

I use Ubuntu Mono font for the Openbox menus and Fira Sans font for the Openbox window bar titles, thus you will download them in the fonts.tar.gz file and extract them like that into the ~/.fonts directory, if if does not exists, create it.

% find .fonts
.fonts/fira-sans-bold-italic.otf
.fonts/fira-sans-bold.otf
.fonts/fira-sans-italic.otf
.fonts/fira-sans-regular.otf
.fonts/ubuntu-mono-bold-italic.ttf
.fonts/ubuntu-mono-bold.ttf
.fonts/ubuntu-mono-italic.ttf
.fonts/ubuntu-mono-regular.ttf

To make sure that Openbox will ‘see’ them you can verify it using the fc-match(1) command like below.

% fc-match 'Fira Sans'
fira-sans-regular.otf: "Fira Sans" "Regular"

% fc-match 'Ubuntu Mono'
ubuntu-mono-regular.ttf: "Ubuntu Mono" "Regular"

Openbox

Openbox consists mostly of two files.

  • ~/.config/openbox/menu.xml
  • ~/.config/openbox/rc.xml

There are also these two, but its pointless to use them as we set our environment and start our apps/daemons in the ~/.xinitrc file (with ~/.xsession symlink to it), but anyway.

  • ~/.config/openbox/autostart
  • ~/.config/openbox/environment

The icons for the Openbox menu are kept under ~/.config/openbox/icons directory.

Download whole Openbox configuration in the openbox.tar.gz file and unpack it into the ~/.config/openbox to make it look like that.

% find .config/openbox -maxdepth 1
.config/openbox
.config/openbox/rc.xml
.config/openbox/menu.xml
.config/openbox/icons
.config/openbox/environment
.config/openbox/autostart

Openbox Theme

The theme we will use at start is the Openbox Flat made by myself, I do not remember if I put it online on the https://www.box-look.org/ site but that does not matter. Grab it in the openbox-flat-theme.tar.gz file and unpack it like that into the ~/.themes directory, create it if it does not exists.

% find .themes/openbox_flat
.themes/openbox_flat
.themes/openbox_flat/openbox-3
.themes/openbox_flat/openbox-3/iconify.xbm
.themes/openbox_flat/openbox-3/XPM
.themes/openbox_flat/openbox-3/XPM/over.xpm
.themes/openbox_flat/openbox-3/XPM/close.xpm
.themes/openbox_flat/openbox-3/XPM/max.xpm
.themes/openbox_flat/openbox-3/XPM/stick.0.xpm
.themes/openbox_flat/openbox-3/XPM/min.xpm
.themes/openbox_flat/openbox-3/XPM/shade.xpm
.themes/openbox_flat/openbox-3/XPM/stick.1.xpm
.themes/openbox_flat/openbox-3/max.xbm
.themes/openbox_flat/openbox-3/close.xbm
.themes/openbox_flat/openbox-3/bullet.xbm
.themes/openbox_flat/openbox-3/shade.xbm
.themes/openbox_flat/openbox-3/themerc
.themes/openbox_flat/openbox-3/desk.xbm
.themes/openbox_flat/openbox-3/desk_toggled.xbm

Openbox FreeBSD Submenus

The ‘systemOpenbox submenu is for FreeBSD top(1)/ps(1) commands and config files/logs.

openbox-system.jpg

The ‘soundOpenbox submenu is for FreeBSD default sound output selection.

openbox-sound.jpg

The ‘recentOpenbox submenu is for Recent files.

openbox-recent.jpg

Check ‘screenshot:‘ and ‘wallpaper:‘ in the ‘x11Openbox submenu for screenshots/wallpapers management.

Check ‘cpu:‘ in the ‘utilitiesOpenbox submenu for FreeBSD for CPU frequency scaling.

Check ‘NETWORK:‘ in the ‘daemonsOpenbox submenu for FreeBSD network management with network.sh script.

Shortcuts

Lets start with the most basic ones. [SUPER] is the so called Windows key.

Shortcuts – Virtual Desktops

  • [ALT] + [F1] – switch to 1st virtual desktop.
  • [ALT] + [F2] – switch to 2nd virtual desktop.
  • [ALT] + [F3] – switch to 3rd virtual desktop.
  • [ALT] + [F4] – switch to 4th virtual desktop.
  • [SHIFT] + [ALT] + [F1] – move current window to 1st virtual desktop.
  • [SHIFT] + [ALT] + [F2] – move current window to 2nd virtual desktop.
  • [SHIFT] + [ALT] + [F3] – move current window to 3rd virtual desktop.
  • [SHIFT] + [ALT] + [F4] – move current window to 4th virtual desktop.

Shortcuts – Menus

  • [SUPER] + [SPACE] – show Openbox root menu.
  • [SUPER] + [ALT] + [SPACE] – show Openbox window list menu.
  • [ALT] + [SPACE] – show current window options menu (client menu).

Shortcuts – Window Management

  • [ALT] + [TAB] – cycle windows focus forward.
  • [SHIFT] + [ALT] + [TAB] – cycle windows focus backward.
  • [CTRL] + [ALT] + [Q] – close current window.
  • [CTRL] + [ALT] + [F] – put current window info fullscreen.
  • [ALT] + [Up] – shade current window.
  • [ALT] + [Down] – minimize current window.
  • [ALT] + [ESC] – send current window below all other windows.

Shortcuts – Advanced Aero Snap

  • [SUPER] + [Up] – move window to half of the screen from top.
  • [SUPER] + [Down] – move window to half of the screen from bottom.
  • [SUPER] + [Left] – move window to half of the screen from left.
  • [SUPER] + [Right] – move window to half of the screen from right.
  • [SUPER] + [CTRL] + [Up] – move window to top-left part of the screen.
  • [SUPER] + [CTRL] + [Down] – move window to bottom-left part of the screen.
  • [SUPER] + [ALT] + [Up] – move window to top-right part of the screen.
  • [SUPER] + [ALT] + [Down] – move window to bottom-right part of the screen.
  • [SUPER] + [ESC] – move window to center – but without fullscreen.

Shortcuts – Mouse

  • [Scroll Up] on Desktop – previous virtual desktop.
  • [Scroll Down] on Desktop – next virtual desktop.
  • [Scroll Up] on (unshaded) Window Titlebar – shade current window.
  • [Scroll Up] on (shaded) Window Titlebar – unshade current window.
  • [Middle Click] on Window Titlebar – send window to background.
  • [Right Click] on Window Titlebar – show window options menu (client menu).
  • [Left Click] on Window Titlebar Icon – show window options menu (client menu).
  • [Middle Click] on Window Titlebar Icon – close window.

Shortcuts – Various

  • [CTRL] + [SHIFT] + [ESC] – launch xterm(1) with htop(1) started with doas(1) for root provilages.
  • [SUPER] + [E] – start Explorer Caja primary file manager.
  • [SUPER] + [E] – start Thunar secondary file manager.
  • [SUPER] + [D] – show desktop – minimize all windows.
  • [SUPER] + [R] – launch dmenu(1) starter.
  • [SUPER] + [L] – lock the screen.
  • [ALT] + [SHIFT] + [SUPER] + [L] – lock the screen and go to sleep.
  • [CTRL] + [PrintScreen] – make screenshot of the whole screen.
  • [SHIFT] + [CTRL] + [PrintScreen] – make screenshot of current window (click without moving the mouse) or selection (select part of the screen).

Shortcuts – Volume

These two work from keyboard.

  • [SUPER] + [ALT] + [PageUp] – increase volume.
  • [SUPER] + [ALT] + [PageDown] – decrease volume.

These below with mouse.

For those who do not have mouse with buttons on the wheel like the Lenovo ThinkPad Precision Wireless Mouse (0B47163) for example, use [ALT] key with mouse scroll up/scroll down on the desktop to increase/decrease volume.

If you do have such mouse, then left on the wheel to decrease and right on the wheel to increase volume.

Random Wallpaper

The random wallpaper handling is done with the ~/scripts/random_wallpaper.sh script. Be sure to put some images into the ~/gfx/wallpapers directory to make it work and to configure crontab(1) properly as shown earlier.

Random xterm(1) Theme

To have random xterm(1) theme on every startup you need three things, the ~/.Xdefaults default config file which is used by xterm(1), the ~/scripts/xterm.sh script and the ~/.config/Xdefaults directory with xterm(1) themes. I gathered all these themes all over the Internet, only the VERMADEN and VERMADEN-OLD themes are created by me.

Little preview of some of the included xterm(1) themes.

openbox-xterm.jpg

To make xterm(1) icon look better you will also need icons.tar.gz file download and extract with the end result looking as follows.

% find .icons
.icons/vermaden/xterm.xpm

Download and extract the xterm.tar.gz file to make its contents look like that.

% find .Xdefaults .config/Xdefaults 
.config/Xdefaults
.config/Xdefaults/Xdefaults.theme.3024NIGHT
.config/Xdefaults/Xdefaults.theme.ALIENBLOOD
.config/Xdefaults/Xdefaults.theme.ARTHUR
.config/Xdefaults/Xdefaults.theme.EARTHSONG
.config/Xdefaults/Xdefaults.theme.ELEMENTAL
.config/Xdefaults/Xdefaults.theme.ELEMENTARY
.config/Xdefaults/Xdefaults.theme.ELIC
.config/Xdefaults/Xdefaults.theme.FLATUI
.config/Xdefaults/Xdefaults.theme.FREYA
.config/Xdefaults/Xdefaults.theme.FRONTEND-DELIGHT
.config/Xdefaults/Xdefaults.theme.GITHUB
.config/Xdefaults/Xdefaults.theme.GREY
.config/Xdefaults/Xdefaults.theme.GRUVBOX-DARK
.config/Xdefaults/Xdefaults.theme.GRUVBOX-LIGHT
.config/Xdefaults/Xdefaults.theme.GRUVBOX-TILIX
.config/Xdefaults/Xdefaults.theme.HARPER
.config/Xdefaults/Xdefaults.theme.HEMISU-LIGHT
.config/Xdefaults/Xdefaults.theme.HIGHWAY
.config/Xdefaults/Xdefaults.theme.IC-GREEN-PPL
.config/Xdefaults/Xdefaults.theme.MOLOKAI
.config/Xdefaults/Xdefaults.theme.MONOKAI-SODA
.config/Xdefaults/Xdefaults.theme.N0TCH2K
.config/Xdefaults/Xdefaults.theme.NEOPOLITAN
.config/Xdefaults/Xdefaults.theme.PALI
.config/Xdefaults/Xdefaults.theme.PAPERCOLOUR
.config/Xdefaults/Xdefaults.theme.SOLARIZED
.config/Xdefaults/Xdefaults.theme.SOLARIZED-LIGHT
.config/Xdefaults/Xdefaults.theme.SPACEDUST
.config/Xdefaults/Xdefaults.theme.TOMORROW
.config/Xdefaults/Xdefaults.theme.TWILIGHT
.config/Xdefaults/Xdefaults.theme.VERMADEN
.config/Xdefaults/Xdefaults.theme.VERMADEN-OLD

Thats a lot of information for one article, feel free to ask me for anything related or about things that I might forgot to put here.

EOF