Monthly Archives: June 2018

Valuable News – 2018/06/30

Docker Considered Harmful.
http://catern.com/posts/docker.html

OpenBSD chief Theo de Raadt says no easy fix for new Intel CPU bug.
https://www.itwire.com/security/83347-openbsd-chief-de-raadt-says-no-easy-fix-for-new-intel-cpu-bug.html

New NAS4Free Release 11.1.0.4.5673 Available.
http://sourceforge.net/projects/nas4free/files/NAS4Free-11.1.0.4/11.1.0.4.5673/

10 Years of Atari/Atari Games emails.
http://www.textfiles.com/games/ATARIMAIL/

In Other BSDs for 2018/06/23.
https://www.dragonflydigest.com/2018/06/23/21432.html

In Other BSDs for 2018/06/30.
https://www.dragonflydigest.com/2018/06/30/21441.html

As OpenBSD disabled Intel Hyper Threading you may want to disable it on FreeBSD with machdep.hyperthreading_allowed=0 in /boot/loader.conf file if its not possible in BIOS.
https://twitter.com/raichoo/status/1010589070676910080

Setup Samba on FreeBSD as Active Directory Domain Member.
https://blog.iandreev.com/?p=2676

FreeBSD 12-CURRENT on Pine A64-LTS with power consumption 2W under load.
https://twitter.com/mzar_y/status/1011356936778997762

Dealing with Hard Problems.
https://artofproblemsolving.com/articles/hard-problems

AMD Ryzen/EPYC problems on FreeBSD seems to be solved.
https://lists.freebsd.org/pipermail/freebsd-current/2018-June/069799.html
https://lists.freebsd.org/pipermail/freebsd-current/2018-June/069802.html
https://lists.freebsd.org/pipermail/freebsd-current/2018-June/069809.html

Unleashed is operating system fork of Illumos created for developers by developers.
http://unleashed-os.org/

Wi-Fi Alliance Introduced WPA3 Security.
https://www.wi-fi.org/news-events/newsroom/wi-fi-alliance-introduces-wi-fi-certified-wpa3-security

FreeBSD 11.2-RELEASE Released.
https://www.freebsd.org/releases/11.2R/relnotes.html

The CopperheadOS project will be continuing with a new name and external funding to run it as a non-profit project.
https://www.reddit.com/r/CopperheadOS/comments/8u8co8/the_project_will_be_continuing_with_a_new_name/

EOF

.
.
.
.
.

FreeBSD Desktop – Part 11 – Key Components – Blue Light Spectrum Suppress

In the Part 11 of the FreeBSD Desktop series I would like to describe key components of self made custom desktop environment such as:

  • Window Manager
  • Status Bar
  • Task Bar
  • Wallpaper Handling
  • Application Launcher
  • Keyboard/Mouse Shortcuts
  • Locking Solution
  • Blue Light Spectrum Suppress

Today we will focus on the Blue Light Spectrum Suppress component. In the next series each of these components configuration would also be described along with eventual needed scripts.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

Latest versions of popular operating systems like Mac OS X (macOS) and Windows (or up-to-date Android based devices) already provide a feature to automatically adjusts color temperature of the screen according to your current time in your location. In short when then Sun is up the color temperature should be closer to about 5500K and when the Sun is down (evening/night) it should be around 3700K.

If You have never heard about Circadian Rhythm then check Wikipedia page for details. Basically its kind of 24 hour internal clock that is runs in the background of your brain and switches between sleepiness and alertness at regular intervals, also known as sleep/awake cycle.

Light, and especially temperature of this light, directly affects this cycle, if You use blue spectrum light when the Sun is down, then You are disrupting the Circadian Rhythm, to cite Wikipedia“Studies have also shown that light has a direct effect on human health because of the way it influences the circadian rhythms.” and also – “Blue LED lighting suppresses melatonin production five times more than the orange-yellow high-pressure sodium (HPS) light.” If your body produces melatonin, then you become more sleepy, if something it preventing that production – like blue light spectrum – then you are not getting sleepy and Circadian Rhythm gets broken.

When You put two images side by side, one with about 3700K color temperature and one with about 5500K color temperature you will be able to spot the difference between them, but the tools that manage these temperatures make transition smooth and unwatchable, only if you kill the application in the night/evening you will be able to spot the difference.

Daily temperature.

temp-cold.jpg

Nightly temperature.

temp-warm.jpg

I know two tools that resolve that problem on X11 environment:

F.lux

Why would you want to run closed source software while You can use open source and it does the same thing? Personally I use Redshift but I want to mention F.lux here as Redshift project itself admits that their program is inspired by F.lux.

To cite the F.lux page it “makes the color of your computer’s display adapt to the time of day, warm at night and like sunlight during the day.”

While F.lux does not provide a native binary for FreeBSD it does offer such binary for Linux and as FreeBSD provides Linux Binary Compatibility its possible to use it on FreeBSD. That Linux binary of F.lux is available to download as tar archive xflux.tgz from the https://justgetflux.com/linux.html page.

Here is how it looks under FreeBSD.

% uname -mro
FreeBSD 11.2-RELEASE amd64

% file ~/scripts/bin/xflux
/home/vermaden/xflux: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.15, BuildID[sha1]=0b2094d4f1fd64100ceba2f61a7ff606f6f1cc8c, not stripped

To use F.lux just start it in the ~/.xinitrc or ~/.xsession file like that.

~/path/to/bin/xflux -l 33.54321 -g 11.12345 &

Of course 33.54321 is latitude and 11.12345 is longitude of your localization.

Redshift

This is the solution that I propose to use as open source blue light spectrum suppressor. To cite the project site “Redshift adjusts the color temperature of your screen according to your surroundings.”

Similarly like with the F.lux to start Redshift just put it in the ~/.xinitrc or ~/.xsession file like that.

redshift -l 33.54321:11.12345 -g 0.9 &

Like earlier 33.54321 is latitude and 11.12345 is longitude of your localization.

Difference

How one can tell the difference with or without using application that suppress blue light spectrum when the Sun is down? You will not be able to tell the difference instantly, but leave it enabled and think about that a month later.

When I did not used such app I was able to choose to stay up and do something till very late, like go to sleep at 3:00 AM for example or I could choose to ‘make good sleep’ and go to bed at about 0:00. After I started to use such application (first F.lux and lately Redshift) I become sleepy/tired at about 23:30 and its harder to stay up late. I think that my sleep become better and overall ‘attitude/awareness/energy/…’ are better now, but your millage may vary, check it for yourself.

EOF

Valuable News – 2018/06/23

Why Intel Skylake CPUs Are Sometimes 50% Slower – How Intel Has Broken Existing Code.
https://aloiskraus.wordpress.com/2018/06/16/why-skylakex-cpus-are-sometimes-50-slower-how-intel-has-broken-existing-code/

FreeBSD overall packet throughput rate increase sponsored by Limelight Networks.
https://svnweb.freebsd.org/base?view=revision&revision=335356

OpenBSD Disables Intel HT/SMT (Hyper-Threading) to Prevent Spectre Class Attacks.
https://thehackernews.com/2018/06/openbsd-hyper-threading.html

TLBleed – When Protecting Your CPU Caches is Not Enough.
https://www.blackhat.com/us-18/briefings/schedule/#tlbleed-when-protecting-your-cpu-caches-is-not-enough-10149

Meet TLBleed – crypto-key-leaking CPU attack on Intel Hyper Threading.
https://www.theregister.co.uk/2018/06/22/intel_tlbleed_key_data_leak/

Beginner’s Guide To Firewalling with PF firewall.
http://srobb.net/pf.html

Firewalling with OpenBSD’s PF packet filter on FreeBSD.
https://home.nuug.no/~peter/pf/en/

How to Customize x11/sterm on FreeBSD.
https://rightmindedtech.blogspot.com/2015/10/how-to-customize-x11sterm-on-freebsd.html

Old Gaming Systems.

DuckDuckGo has served 20 Billion private searches in 10 years.
https://duckduckgo.com/traffic
https://twitter.com/DuckDuckGo/status/1010157220120719361

KDE on FreeBSD – June 2018.
https://euroquis.nl/bobulate/?p=1915

Minio S3 object store deployed as set of VMs.
https://cormachogan.com/2018/06/22/minio-s3-object-store-deployed-as-a-set-of-vms-on-vsan/

The Power Of CTRL+T on FreeBSD and Mac OS X (macOS).
https://blog.danielisz.org/2018/06/21/the-power-of-ctrlt/

MATE 1.20.1 Running on Tribblix m20.1 (Illumos).
https://twitter.com/jperkin/status/1010120031248769024

Effective Shell Part 1 – Navigating the Command Line.
https://www.dwmkerr.com/effective-shell-part-1-navigating-the-command-line/

Effective Shell Part 2 – Become a Clipboard Gymnast.
https://www.dwmkerr.com/effective-shell-part-2-become-a-clipboard-gymnast/

Effective Shell Part 3 – Getting Help.
https://www.dwmkerr.com/effective-shell-part-3-getting-hepl/

WinUAE AMIGA Emulator 4.0.0 Released.
http://www.winuae.net/2018/06/20/winuae-4-0-0/
http://www.osnews.com/story/30509/WinUAE_Version_4_0_0_Released

EOF.

.
.
.
.
.

FreeBSD Desktop – Part 10 – Key Components – Locking Solution

In the Part 10 of the FreeBSD Desktop series I would like to describe key components of self made custom desktop environment such as:

  • Window Manager
  • Status Bar
  • Task Bar
  • Wallpaper Handling
  • Application Launcher
  • Keyboard/Mouse Shortcuts
  • Locking Solution
  • Blue Light Spectrum Suppress

Today we will focus on the sixth part – the Locking Solution. In the next series each of these components configuration would also be described along with eventual needed scripts.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

While screen locking feature is obvious for popular operating systems like Mac OS X (macOS) and Windows (or complete desktop environments such as KDE Plasma) its not when you build your desktop environment from the ground up. Similarly like in Part 9 about Keyboard/Mouse Shortcuts I will describe what light solutions will work here instead of focusing on all available solutions and choosing the best ones from them.

The tools we will embrace in this process are:

  • mate-screensaver
  • xlock
  • xautolock

The roles of mate-screensaver and xlock are redundant but we will keep xlock as fallback when mate-screensaver will fail for some reason. For example after upgrade some library may not be available (or will be present but in different version or filename) so mate-screensaver will fail and then xlock will take the role to securely lock the screen.

The xautolock will be used to automatically lock the screen (invoke mate-screensaver or xlock command) after defined period of inactivity time, for example when You would forgot to lock the screen and left the laptop ‘open’ to the World. πŸ™‚

mate-screensaver

From all the nice looking solutions providing screen lock on the X11 I found mate-screensaver the best choice for this task. By default it does not display any fancy screensaver, just plain old blank screen, which is good for laptops, saves battery time.

locker-mate-screensaver.png

The mate-screensaver has to be started and run in the background with, well mate-screensaver command – placed somewhere in the ~/.xinitrc or ~/.xsession file. Then we would be able to invoke mate-screensaver-command --lock command to make the actual screen lock.

xlock

When mate-screensaver will not be available or functional we will use xlock as failover solution.

Its not very pretty and does not support FreeType fonts, but with clean or fixed font face its not that bad either, as they are quite nice and usable bitmap fonts.

The xlock tool appearance can be configured by specifying arguments. Below you will find example configuration with gray background and clean bitmap font.

% xlock \
    -mode blank \
    -planfont '-*-clean-*-*-*-*-*-*-*-*-*-*-iso8859-2' \
    -font     '-*-clean-*-*-*-*-*-*-*-*-*-*-iso8859-2' \
    -username 'USERNAME: ' \
    -password 'PASSWORD: ' \
    -background gray30 \
    -dpmsoff 1 \
    -message ' ' \
    -info ' '

Here is how it looks after configuration.

locker-xlock

xautolock

We have addressed the on demand screen locking case but now we also need to make sure, that our screen will automatically lock after some period of time while we are away from the computer. Small utility called xautolock does exactly that and does it very efficiently.

Example invocation is presented below.

% xautolock \
    -time 1 \
    -locker \
    ~/bin/example-lock-handler.sh \
    -resetsaver

The xautolock also has to be started and run in the background using the ~/.xinitrc or ~/.xsession file.

UPDATE 1 – Nice Looking xlock Configuration

After messing with xlock(1) little more I found a way to make it look a lot better. One of the reasons to use xlock(1) may be the mate-screensaver(1) memory footprint. While xlock(1) uses about 8 MB RAM the mate-screensaver(1) uses more them 5 times more which can be seen in the FreeBSD’s top(1) command output below.

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
55861 vermaden      4  33    0    65M    48M select   0   0:01   0.00% mate-screensaver
33761 vermaden      1  32   10    18M  8256K select   1   0:00   0.00% xlock

This 48 MB of RAM is more then entire openbox(1) and tint2(1) desktop ‘stack’.

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
42629 root          3  21    0    88M    56M select   0   1:34   0.00% Xorg
55861 vermaden      4  33    0    65M    48M select   0   0:01   0.00% mate-screensaver
70890 vermaden      1  20    0    53M    26M select   0   0:03   0.00% openbox
82040 vermaden      1  20    0    37M    21M select   1   0:01   0.00% tint2
89833 vermaden      1  20    0    18M  8908K select   0   0:00   0.00% dzen2
33761 vermaden      1  32   10    18M  8256K select   1   0:00   0.00% xlock
43585 root          1  28    0    17M  7700K wait     0   0:00   0.00% xdm
24399 vermaden      1  20    0    17M  6900K nanslp   1   0:03   0.00% redshift
42014 root          1  35    0    14M  4560K pause    0   0:00   0.00% xdm
74897 vermaden      1  20    0    13M  3720K select   1   0:01   0.00% xbindkeys

The new locking script is available on GitHub page – __openbox_lock.sh – here.

Here is the new xlock(1) config along with new more readable fixed font.

  FONT='-*-fixed-*-*-*-*-10-*-*-*-*-*-iso8859-2'
  xlock \
    -mode image \
    -planfont "${FONT}" \
    -font     "${FONT}" \
    -username 'user: ' \
    -password 'pass:' \
    -info ' ' \
    -validate 'Checking.' \
    -invalid 'Nope. ' \
    -background gray20 \
    -foreground gray60 \
    -dpmsoff 1 \
    -icongeometry 64x64 \
    -echokeys \
    -echokey '*' \
    -bitmap /home/vermaden/.icons/vermaden/xlock.xpm \
    -count 1 \
    -delay 10000000 \
    -erasemode no_fade \
    +showdate \
    +description

The used above bitmap is also available on GitHub page – xlock.xpm – here.

Its just my logo on the black background, but You may of course use your own image/logo on black (#000000) background.

xlock

Now when screen is locked with xlock(1) it looks like that image below. It also quite fast does into DPMS off mode which means turned off screen for more battery life.

xlock-image.png

When you will want to enter the password to unlock the screen it will look like that.

xlock-user-pass

I liked it so much that I have disabled mate-screensaver(1) entirely πŸ™‚

EOF

FreeBSD Desktop – Part 9 – Key Components – Keyboard/Mouse Shortcuts

In the Part 9 of the FreeBSD Desktop series I would like to describe key components of self made custom desktop environment such as:

  • Window Manager
  • Status Bar
  • Task Bar
  • Wallpaper Handling
  • Application Launcher
  • Keyboard/Mouse Shortcuts
  • Locking Solution
  • Blue Light Spectrum Suppress

Today we will focus on the sixth part – the Keyboard/Mouse Shortcuts. In the next series each of these components configuration would also be described along with eventual needed scripts.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

Keyboard/Mouse Shortcuts

While most window managers and desktop environments offer some kind of shortcuts or tools to define your own ones its often quite complicated to force them to do exactly what you want. For example – while Openbox supports creating keyboard and mouse shortcuts it always require modifier key like [ALT], [CTRL] or [SUPER] for example. It will also not allow you to create mouse shortcuts like using only the left button of the mouse wheel (not to confuse with regular left mouse button). Or to add some function or script to keys like [Scroll Lock] or [Pause Break] without any other modifiers.

Fortunately there are tools that can and work well together to achieve almost anything you can imagine. While earlier in the series I made knockouts of solutions – or choosing the best one from several potential candidates in this part its different. I use ALL of these tools and there will be no knockout, they all provide some ‘missing bits’ to the Openbox or probably most of other window managers.

These tools are:

  • xev
  • xmodmap
  • xbindkeys
  • xdotool

Xev

The xev is used to ‘read’ what has keyboard key has been pressed or which mouse button was used. While it may sound stupid for most of the keys it does not for ‘special’ ones like Volume Up and Volume Down ‘dedicated’ buttons on many laptops or [Page Up] and [Page Down] keys which are named Prior and Next respectively.

keyboard-xev.jpg

Xmodmap

This tool is used to assign or rename keys to make something different, for example Lenovo ThinkPad laptops have two special keys – lets call them Forward and Backward – near the Arrows keys. They work a lot better as [Page Up] and [Page Down] keys so with xmodmap its possible to map them that way.

Other popular use case are laptop Volume Up and Volume Down buttons, or Volume Mute button. While checked with xev they often has only some keycode attached while you may map them into XF86AudioLowerVolume, XF86AudioRaiseVolume and XF86AudioMute respectively so that X11 will take care of the rest, they will ‘start work’ in most applications thanks to that mapping. Additional scripting is not needed here.

Example modifier map shown by xmodmap tool.

% xmodmap -pm  
xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x6d)
mod1        Alt_L (0x40),  Meta_L (0x9c)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x73),  Super_R (0x74),  Super_L (0x7f),  Hyper_L (0x80)
mod5        Mode_switch (0x8),  ISO_Level3_Shift (0x7c)

The xmodmap will load and map our keys and then will exit, files like ~/.xinitrc or ~/.xsession are good places for such startup keyboard setup.

Xbindkeys

While most window managers – including Openbox – support configuring keyboard shortcuts it is not perfect and has some limitations, like requiring modifier key like [ALT], [CTRL] or [SUPER] to be used in every shortcut for example.

This is where xbindkeys steps in. While xev will do for most cases it will fail you in more advanced scenarios. For example when You would like to attach Volume Up and Volume Down actions to your mouse Left Wheel Button and Right Wheel Button keys. I will probably not be able to express how useful mapping it is. Even when you laptop screen is locked you will be able to turn the volume down or up.

Similarly like xev the xbindkeys comes with its own window to catch events.

keyboard-xbindkeys.jpg

Here are these bindings.

% xbindkeys -s 
"mixer pcm 100; mixer vol +5"
    m:0x0 + b:9   (mouse)
"mixer pcm 100; mixer vol -5"
    m:0x0 + b:8   (mouse)
(...)

The xbindkeys will run as a daemon in the background, files like ~/.xinitrc or ~/.xsession are usual places to start it when our X11 environment starts.

The xbindkeys tool also comes with its own ‘key identifier’ as xev does. Use it with -k/--key argument to identify one key pressed or -mk/--multikey argument to identify multi key pressed respectively.

% xbindkeys -k
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:99
    Prior
% 

Xdotool

Sometimes you want to ‘fake’ that some keys were pressed – but without pressing them – without touching the keyboard. While some applications offer some settings to be changed by an argument to their main binary name – like for example DeaDBeeF media player allows you to type deadbeef --next to skip to next song – many applications don’t provide such ‘API’. This is where xdotool comes handy – it can generate any keyboard shortcut and send it to and application in X11 environment. Great tool for scripting and automating ‘work’ on the desktop and also for situations where nothing else works.

An example of such ‘useful’ shortcut may be emulating of [Z] (the [Shift]+[z] combination) key press on mupdf PDF viewer to “Zoom page to fit either to width or height of window.” after opening new PDF document.

Summary

Each of these tools plays some role in keyboard and mouse shortcuts on the X11 desktop. Together they are able to execute any solution you can imagine.

EOF

FreeBSD Desktop – Part 8 – Key Components – Application Launcher

In the Part 8 of the FreeBSD Desktop series I would like to describe key components of self made custom desktop environment such as:

  • Window Manager
  • Status Bar
  • Task Bar
  • Wallpaper Handling
  • Application Launcher
  • Keyboard/Mouse Shortcuts
  • Locking Solution
  • Blue Light Spectrum Suppress

Today we will focus on the fifth part – the Application Launcher. In the next series each of these components configuration would also be described along with eventual needed scripts.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

Application Launcher

While not being any crucial role of the desktop environment it have its uses and sometimes save time. As its not hard to add this ‘feature’ to our setup I will evaluate two light and fast solutions that fulfill that role:

  • Dmenu
  • Rofi

Resources

Lets start with resources, the Rofi implementation of application launcher uses almost 3 times more RAM – 21 MB – then Dmenu solution – 8 MB.

  PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
16952 vermaden        1  24    0 13860K  8968K select  0   0:00   1.76% dmenu
86078 vermaden        3  24    0 32980K 21712K select  0   0:00   2.54% rofi

The Dmenu is also faster while Rofi have more eye candy and colors.

Dmenu

As Dmenu suits better to this ‘minimalist’ yet functional desktop I will use it instead of Rofi, but feel free to experiment between them and choose best option for You.

This Dmenu setup – after being run – will cover the Dzen2 status bar with filtered commands fitting nicely into the setup, here is how it looks in action.

Desktop without Dmenu launched.

launcher-dmenu.jpg

Desktop with Dmenu launched and with alc characters inserted to ‘filter’ commands in the search of a calculator application.

launcher-dmenu-run.jpg

Rofi

While Dmenu is doing a good job here lets have a look how Rofi behaves in that role.

While I use a custom script for Dmenu – which I will present later in the series – the Rofi requires more simple command.

% rofi -show run -theme solarized_alternate -font "Monaco 8"

Here is how Rofi looks in action.
launcher-rofi.jpg

For the record, I also entered same alc characters into Rofi to ‘filter’ commands in the search of a calculator application.

While Dmenu has very narrow ‘specialization’ the Rofi can also be used in other scenarios which are described on the project site.

EOF

FreeBSD Desktop – Part 7 – Key Components – Wallpaper Handling

In the Part 7 of the FreeBSD Desktop series I would like to describe key components of self made custom desktop environment such as:

  • Window Manager
  • Status Bar
  • Task Bar
  • Wallpaper Handling
  • Application Launcher
  • Keyboard/Mouse Shortcuts
  • Locking Solution
  • Blue Light Spectrum Suppress

Today we will focus on the fourth part – the Wallpaper Handling. In the next series each of these components configuration would also be described along with eventual needed scripts.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

Wallpaper

Some people do not use wallpapers at all, just a black or grey background, some set family photos, some have a set of favorite wallpapers and setup random wallpaper from this set of favorites to show up every once in a while. We will talk about the last type of setup in this article.

I have tried various applications to provide this simple feature and always came back to Feh, thus I will not compare various other solutions available and will focus on the Feh exclusively.

While Feh main/original function is to be ultra fast image viewer it also has an option to properly setup a wallpaper on a X11 desktop.

% feh --bg-[TAB]
--bg-center    -- set centered desktop background
--bg-fill      -- set scaled desktop background, preserving aspect ratio
--bg-scale     -- set scaled desktop background
--bg-seamless  -- set desktop background with seamless borders
--bg-tile      -- set tiled desktop background

The ZSH shell made this upper output so much easier then browsing thru man feh page or checking its documentation πŸ˜‰

The Feh is also very low on resources, if of course depends on the image size You will use, but the Feh ‘interface’ will use about 10 MB of RAM to browse an image.

But Feh as fast and powerful as it is will not ‘select’ wallpaper for us, we will have to implement little helper script to select which wallpaper we would like to use, and then we would use Feh as a backed to set this wallpaper. We will also have to implement a way to set tiled wallpapers in tiled way – not to stretch them to entire desktop.

There is not much more to add here, as we will progress to posting ‘real’ configuration we will get back to this topic with the working script.

EOF

FreeBSD Desktop – Part 6 – Key Components – Task Bar

In the Part 6 of the FreeBSD Desktop series I would like to describe key components of self made custom desktop environment such as:

  • Window Manager
  • Status Bar
  • Task Bar
  • Wallpaper Handling
  • Application Launcher
  • Keyboard/Mouse Shortcuts
  • Locking Solution
  • Blue Light Spectrum Suppress

Today we will focus on the third part – the Task Bar. In the next series each of these components configuration would also be described along with eventual needed scripts.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

Task Bar

To quote Wikipedia“A taskbar is an element of a graphical user interface which has various purposes. It typically shows which programs are currently running.”

While there are dozens of options here after using many them I have narrowed the choice to lighter solutions such as:

  • XFCE Panel
  • Tint2
  • Fbpanel
  • Lxpanel
  • Plank

Classic

You can use classic taskbar likeΒ XFCE Panel used in the XFCE desktop environment.

taskbar-xfce.png

You can also configure Tint2 that way.

taskbar-tint-classic.jpg

But this solution has its drawbacks, it only shows applications that are active on the current desktop, using 4 or more virtual desktop is a ‘standard’ for most power users so not knowing what is happening on the other desktops is not acceptable.

Docks

One of the greatest taskbars of all time was/is the Mac OS X Dock (now macOS Dock).

taskbar-macosx.png

It also does not cover virtual desktops but it has a feature that it shows applications from all desktops and if you click that application icon, then it will switch you to that application on that desktop. It also has an indicator showing if application is launched or not which also helps.

There was time, when You could use Fbpanel to create pixel-perfect clone of Mac OS X Dock, without all features of course, but still.

taskbar-fbpanel-macosx.png

Unfortunately it worked only till 4.3 version of the Fbpanel, with later releases this pixel-perfect custom themes was not possible because of forced spacing between elements and it looks like the Fbpanel development stopped somewhere in 2010.

Currently the best and lightest solution for providing the dock-like functionality on open desktops seems to be Plank – the dock that originally was written for the Elementary OS Linux distribution. Besides being light and having nice look it also offers most important features of the original Mac OS X Dock like switching to the application and showing an indicator for already running applications.

The ‘original’ Plank theme used in Elementary OS looks like that.

taskbar-plank-eos.png

While its quite nice it takes definitely too much desktop space, thus I prefer to configure it little more lean way. Also styled along with Dzen2 and Tint2 colors/style.

taskbar-plank-vermaden.png

Virtual Desktops

While its one of the best solutions out there lets not forget Tint2. One of the nicest features of this small beauty is that you can configure it to show all applications from all virtual desktops … and even provide separate launcher … and system tray … and many other useful things which we will not use, such as clock that we already have on the Dzen2 status bar.

Here is an example of Tint2 configured in such way.

taskbar-tint-vermaden.jpg

I do not find it usable nor efficient either that way, but habits of Windows like desktop systems die hard for some πŸ˜‰

The Lxpanel can also be a launcher but does not have all needed functionality and flexibility that Tint2 offers.

taskbar-lxpanel.png

While Lxpanel is low on resources the Tint2 taskbar uses even less of them while doing more, so I mention Lxpanel here just for historical reasons as I used it in the past.

Resources

Lets compare how are these solutions on the system resources. I have omitted Fbpanel in here because its no longer usable as a taskbar solution.

  PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
53862 vermaden        5  20    0 51284K 36376K select  1   0:03   1.07% plank
83288 vermaden        1  20    0 33608K 28480K select  1   0:00   0.00% xfce4-panel
43380 vermaden        1  20    0 32484K 26332K select  0   0:21   0.00% tint2
94650 vermaden        2  20    0 50752K 27652K select  1   0:00   0.00% lxpanel

The Tint2 takes about 25 MB of RAM. While Plank taking a little more – 35 MB of RAM – its usability and nice look can be justified to take little more.

Result

The final result along with Dzen2 status bar on the top along with Tint2 for virtual desktop overview and Plank running on the bottom will look like that.

taskbar-full-desktop.jpg

The Plank taskbar on the bottom is optional. Once I got used to Tint2 and Dzen2 setup on the top the Plank became optional/redundant, but some people prefer it for their desktop usage patterns.

EOF

Valuable News – 2018/06/17

Intel 28-core Bullshit vs. AMD 32-core Reality.
https://www.techspot.com/news/75009-intel-28-core-fantasy-vs-amd-32-core.html

The pNFS server just got merged into FreeBSD.
https://svnweb.freebsd.org/base?view=revision&revision=335012
https://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt

KDE Plasma 5.13 Released.
https://www.kde.org/announcements/plasma-5.13.0.php

The BEADM got update to 1.2.8.
https://twitter.com/vermaden/status/1006747842470404096

The AUTOMOUNT got update to 1.5.8.
https://twitter.com/vermaden/status/1006757085890203648

OpenBSD Journal – Intel FPU Speculation Vulnerability Confirmed.
https://undeadly.org/cgi?action=article;sid=20180614064341
https://twitter.com/cperciva/status/1007010583244230656

National FreeBSD Day – 19 July Since 1993.
https://www.freebsdfoundation.org/national-freebsd-day/
https://docs.freebsd.org/doc/2.2.6-RELEASE/usr/share/doc/handbook/history.html
https://www.freebsd.org/news/1993/freebsd-coined.html

HardenedBSD 11-STABLE v1100055.4 Released.
https://hardenedbsd.org/article/op/2018-06-14/stable-release-hardenedbsd-stable-11-stable-v11000554
https://github.com/HardenedBSD/hardenedBSD-stable/releases/tag/HardenedBSD-11-STABLE-v1100055.4

NomadBSD 1.1-RC1 Released.
http://nomadbsd.org/index.html#rel1.1-rc1

Ben Widawsky will focus its Intel driver development on FreeBSD.
https://bwidawsk.net/blog/index.php/2018/06/freebsd-work-week-2/
https://www.phoronix.com/scan.php?page=news_item&px=Intel-FreeBSD-Improvement-Ideas
https://www.phoronix.com/scan.php?page=news_item&px=Intel-Graphics-To-FreeBSD

Simple POSIX /bin/sh script may be more simple solution then 15000 bytes Python script to generate HOSTS file.
https://github.com/StevenBlack/hosts/issues/90

In Other BSDs for 2018/06/16.
https://www.dragonflydigest.com/2018/06/16/21371.html

EOF.

.
.
.
.
.

FreeBSD Desktop – Part 5 – Key Components – Status Bar

In the Part 5 of the FreeBSD Desktop series I would like to describe key components of self made custom desktop environment such as:

  • Window Manager
  • Status Bar
  • Task Bar
  • Wallpaper Handling
  • Application Launcher
  • Keyboard/Mouse Shortcuts
  • Locking Solution
  • Blue Light Spectrum Suppress

Today we will focus on the second part – the Status Bar. In the next series each of these components configuration would also be described along with eventual needed scripts.

You may want to check other articles in the FreeBSD Desktop series on the FreeBSD Desktop – Global Page where you will find links to all episodes of the series along with table of contents for each episode’s contents.

Status Bar

Also known as information bar, the place on the screen that would provide You needed information such as current date and time, CPU, RAM and storage usage, current network information or battery status. Such function can be done by dozens of open source solutions, but we will limit ourselves only to fast and low on resources ones. The list of potential solutions contains:

  • Conky
  • Dzen2
  • Xmobar
  • Polybar

Having tested all of them the Dzen2 and Conky seems to be the best solutions but I finally settled with Dzen2 for a various reasons that I will describe in a moment. While Xmobar is nice solution it comes with about 2 GB of dependencies of Haskell and Haskell libraries, keeping those on disk just to run ‘tiny’ status bar does not seem sensible not ‘light’.

Here is example of Xmobar in action.

openbox-xmobar-small.jpg

While Polybar can look very nice on screenshots it is a lot more heavy on resources and is limited only to modules/features that were implemented in it.

Here is some more advanced Polybar setup.

openbox-polybar.png

Also the Polybar uses almost three times more RAM then Dzen2 and will use similarly more CPU time.

USER       PID  %CPU %MEM     VSZ    RSS TT  STAT STARTED       TIME COMMAND
vermaden 27560   0.0  0.2   41056  20544  8  S+   11:17      0:00.21 polybar
vermaden 10522   2.4  0.1   12876   8192  -  S    11:21      0:00.07 dzen2

This left us with Conky and Dzen2. I have used Conky for quite long time but after recent tests I made Dzen2 is a lot less on resources then Conky while doing the same thing. The other even more important measure is battery time on a laptop. With same interval, exactly same look output and using same external scripts the laptop would run 5:19 using Conky but it will run 5:43 when running Dzen2. Almost 25 minutes more of battery time with same features is enough for me to switch to Dzen2.

  PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
85291 vermaden        3  52    0 53484K  7500K select  2   2:52   0.29% conky
85289 vermaden        1  20    0 47452K  7524K select  3   0:41   0.00% dzen2

Of course if You want to plot gauges for CPU or RAM or possibly bars for filesystems usage then only Conky provides such features, but if You use text to present information, then Dzen2 provides similar features with lower footprint.

Example Conky setup.

openbox-conky-small.png

The Dzen2 also offers feature that Conky does not offer. If you would like to implement refresh interval of 30 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. Its not possible to achieve with Conky. Why anyone would want to implement such ‘strange’ refresh policy? To get more battery life as often You do not need this information to be one only at most one second behind reality (refresh every second) and if You need it you refresh it manually 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.

Now Dzen2 configured similarly to Conky and Xmobar.

openbox-dzen2-small.png

EOF