Valuable News – 2018/07/15

Xen Project Hypervisor 4.11 released with PVH Dom0 feature for both FreeBSD and Linux.
https://blog.xenproject.org/2018/07/10/whats-new-in-the-xen-project-hypervisor-4-11/

Benchmark MySQL versus MariaDB – [SAS/SSD/NVMe] – in Polish but charts are ‘uni-language’. πŸ™‚
https://www.linkedin.com/pulse/mysql-vs-mariadb-sas-ssd-nvme

Recently released CDE 2.3.0 running on Tribblix (Illumos).
https://twitter.com/ptribble/status/1015984790363832320

What is FreeBSD? Why Should You Choose It Over Linux?
https://www.fossmint.com/what-is-freebsd-why-should-you-choose-it-over-linux/

FreeBSD Jails the hard way.
https://clinta.github.io/freebsd-jails-the-hard-way/

FreeBSD Jails with single public IP address.
https://www.davd.eu/posts-freebsd-jails-with-a-single-public-ip-address/

Another GitHub/GitLab alternative – sr.ht – open source software suite for managing software development projects.
https://meta.sr.ht/
https://lobste.rs/s/z0sqez/sr_ht_sircmpwn_s_github_alternative

China Finds Zen: Begins Production Of x86 Processors Based On AMD’s IP.
https://www.tomshardware.com/news/china-zen-x86-processor-dryhana,37417.html

Hygon Dhyana: Chinese x86 Server CPUs Based On AMD Zen.
https://www.phoronix.com/scan.php?page=news_item&px=Hygon-Dhyana-AMD-China-CPUs

The pkgsrc 2018Q2 for Illumos is available with 18500+ binary packages.
https://twitter.com/jperkin/status/1016268684371865600

VUSec TLBleed Overview.
https://www.vusec.net/projects/tlbleed/
https://www.vusec.net/wp-content/uploads/2018/07/tlbleed-author-preprint.pdf

The pkgsrc 2018Q2 has been released.
https://mail-index.netbsd.org/pkgsrc-users/2018/07/09/msg027134.html

NetBSD ARM64 Images Available with SMP for RPi3 / NanoPi / Pine64 Boards.
https://www.cnx-software.com/2018/07/11/netbsd-arm64-raspberry-pi-3-nanopi-pine64-boards/
http://www.invisible.ca/arm/

OpenBSD-current gains Wi-Fi auto-join feature.
https://undeadly.org/cgi?action=article;sid=20180712084645

Battle of the Schedulers: FreeBSD ULE vs. Linux CFS.
https://www.usenix.org/system/files/conference/atc18/atc18-bouron.pdf

OpenBSD 6.3 on Tuxedo InfinityBook Pro 14.
https://hazardous.org/archive/blog/2018/07/11/OpenBSD-6-3-on-tuxedo-infitiybook

In Other BSDs for 2018/07/14.
https://www.dragonflydigest.com/2018/07/14/21482.html

ARM started FUD campaign against RISC-V ISA which is free and BSD licensed with 5 ‘facts’ about designing System-on-Chip.
The https://riscv-basics.com/ site is down so here is its snapshot.
ARM RISC-V Architecture Understanding the Facts.png

EOF.

.
.
.
.
.

Advertisements

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.

.
.
.
.
.

Ghost in the Shell – Part 2

The article in the Ghost in the Shell series was the first post on my blog, so while I was busy by writing various server related articles and recently the FreeBSD Desktop series its about time for the Part 2 of the Ghost in the Shell series.

You may want to check earlier articles in the series.

Lets start with something simple – yet powerful and time saving.

Alias with Arguments

One may of course write any function to do similar job, but keeping track and ‘maintaining’ all those functions becomes complicated and one has to organize itself. This partially applies to aliases, but they are smaller and easier to maintain then whole functions. In any modern shell an alias(1) can also have arguments, while You will not be able to parse them as appropriate as with functions, they do the job for their basic use.

Here is an example of such alias(1) with arguments.

% ls
gfx/ info/ misc/ scripts/ tmp/

% alias lsg='ls | grep'

% lsg gfx
gfx/

Color grep(1) Patterns

As we already ‘touched’ the grep(1) command topic, lets make it more usable by highlighting the found results in color. The ${GREP_COLOR} variable is used for that purpose and it expects a number for a color, here is the table with number-color format.

Color    Number
Black    30
Red      31
Green    32
Yellow   33
Blue     34
Magenta  35
Cyan     36
White    37

You may as well use ‘bold’ output by adding ‘1;‘ before the number, for example.

% echo ${GREP_COLOR}
1;31

You will also have to make an alias(1) to grep(1) with --color argument, like that:

% alias grep='grep --color'

Here is how it looks in practice.

% export GREP_COLOR=31
% alias grep='grep --color'
% dmesg | grep SMP
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s)
SMP: AP CPU #1 Launched!

Here is how it looks on the xterm(1) terminal.

ghost-terminal

Process Management

This one is very useful on any UNIX system, does not matter if its server or desktop.

These are commands and operands that will help us manage processes started by hand:

  • &
  • fg
  • bg
  • jobs
  • kill
  • disown
  • nohup
  • [CTRL]+[Z]
  • [CTRL]+[C]

As you probably already know to start command ‘in the background’ – which means do what I tell you but do not block the terminal – you have to add ‘&‘ (ampersand) at the end of such command. That command does not magically go away and as long as its running its visible by the jobs(1) command. You may use ‘-l‘ switch to also show the PID of background processes.

% galculator &
[1] 8449

% jobs
[1]  + running    galculator

% jobs -l
[1]  + 8449 running    galculator

Now, what of you forget to add ‘&‘ (ampersand) at the end of command but you wanted to put it into the background? Hit [CTRL]+[Z] shortcut (Control key with ‘small’ Z letter) and the process will be put into the suspended state. Now you have several options, you can out that process into the background with bg(1) command – by default it uses last suspended job – %1, you can also bring it back into the foreground blocking the terminal with fg(1) command. You can also list its state with jobs(1) and of course kill(1) it either with PID showed by jobs -l command or by specifying the process number – %1 in that case.

Here is an example.

% galculator
^Z
zsh: suspended  galculator

% jobs
[1]  + suspended  galculator

% bg
[1]  + continued  galculator

% jobs -l
[1]  + 72892 running    galculator

% kill %1
[1]  + terminated  galculator

%

While fg(1) and bg(1) allow you to put command in the background or foreground respectively when the process is in suspended state, one may ask how to ‘switch’ a process to suspended state while its already running in the background. Its done with kill -17 signal called SIGSTOP. You can also bring back such suspended process to running state with kill -19 signal called SIGCONT … or just again use fg(1) or bg(1) command. Other difference between fg(1)/bg(1) commands and more ‘direct’ kill -17/kill -19 commands are that kill(1) does not inform the user what has changed to the process. You may as well use kill -SIGCONT syntax or kill -s SIGCONT if that is more readable for you.

% galculator
^Z
zsh: suspended  galculator

% bg
[1]  + continued  galculator

% xcalc
^Z
zsh: suspended  xcalc

% jobs -l
[1]  - 19537 running    galculator
[2]  + 20563 suspended  xcalc

% kill -17 %1
[1]  + suspended (signal)  galculator

% jobs -l
[1]  + 19537 suspended (signal)  galculator
[2]  - 20563 suspended  xcalc

% kill -SIGCONT %1
% bg %2
[2]  - continued  xcalc

% jobs -l
[1]  + 19537 running    galculator
[2]  - 20563 running    xcalc

Also check man kill and man signal for more information.

What about disown(1) then? Its a ‘magic’ helper when you start some long running jobs directly at the terminal without Screen or Tmux and you need to disconnect that terminal, for example because you are taking your laptop with you. When you do this – depending on the settings of the current shell – the processes in the background may be killed or ‘moved’ to PID 1 (the init(1) of course) as the PPID (Parent PID). To achieve that we will used that disown(1) command. Once you ‘disown’ a process it will no longer be show by the jobs(1) command, but it will run ‘pinned’ to the init(1) process after you disconnect the terminal session.

% galculator
^Z
zsh: suspended  galculator

% bg
[1]  + continued  galculator

% jobs -l
[1]  + 98556 running    galculator

% disown %1

% jobs -l

% pgrep galculator
98556

% pstree -p 98556
─┬◆ 00001 root /sbin/init --
 └─┬─ 48708 vermaden xterm
   └─┬◆ 52463 vermaden -zsh (zsh)
     └──◆ 98556 vermaden galculator

Now its still pinned to the shell in the xterm(1) terminal. After we close the xterm(1) window (or kill that zsh(1) shell) it will switch to init(1) as PPID (Parent PID).

% pstree -p 98556
─┬◆ 00001 root /sbin/init --
 └──◆ 98556 vermaden galculator

% pgrep -P 1 galculator
98556

We are left with nohup(1) then, when and why to use it as we already has great disown(1) magic? Well, disown(1) is not always available, so when You need to put some command into the long background run and disconnect after it its the best possible option. By default the nohup(1) command will log the output of started command into the nohup.out file. Remember that nohup(1) will still run the process in the foreground, to put it into the background use ‘&‘ (ampersand) or [CTRL]+[Z] with bg(1) combo.

% nohup galculator
appending output to nohup.out
^Z
zsh: suspended  nohup galculator

% bg
[1]  + continued  nohup galculator

% jobs -l
[1]  + 22322 running    nohup galculator

% pstree -p 22322
─┬◆ 00001 root /sbin/init --
 └─┬─ 89568 vermaden xterm
   └─┬◆ 91486 vermaden -zsh (zsh)
     └──◆ 22322 vermaden galculator

… and after disconnect out process switched to init(1) as PPID.

% pstree -p 22322
─┬◆ 00001 root /sbin/init --
 └──◆ 22322 vermaden galculator

You may of course end a running process in the foreground with [CTRL]+[C] shortcut, but that is probably already known to you. I just mention it for the ‘completeness’ of the guide.

% galculator
^C

%

Which Which

While the which(1) command shows the full path of the executable found in the first directory of the ${PATH} variable, it also shows what alias is used for that command it there is one. One may ask how then to find information about absolute executable path if it shows and alias(1) instead. Well, you have to use unalias(1) on that command, so which(1) would be showing full path again.

% which caja
caja: aliased to caja --browser --no-desktop

% unalias caja

% which caja
/usr/local/bin/caja

Record Session

If you have used PuTTY or MobaXterm in your work, then you appreciate the possibility of saving the terminal output to a file, foe example for the documentation purposes. This is also available ‘natively’ in the shell by using the script(1) command. Remember that script(1) will record also ‘special’ characters like colors, so to properly ‘replay’ the session you may want to either use script(1) or cat(1) commands for that or use less with -R argument.

Here is example recorded script(1) session.

% script script.out
Script started, output file is script.out

% ls
gfx info misc scripts tmp unix.png

% uname -spr
FreeBSD 11.2-RELEASE amd64

% exit
Script done, output file is script.out

% cat script.out
Script started on Sun Jul  8 08:24:06 2018
You have mail.
% ls | grep gfx
gfx
% uname -spr
FreeBSD 11.2-RELEASE amd64
% exit
exit

Script done on Sun Jul  8 08:24:20 2018

% less -R script.out
Script started on Sun Jul  8 08:24:06 2018
You have mail.
% ls | grep gfx
gfx
% uname -spr
FreeBSD 11.2-RELEASE amd64
% exit
exit

Script done on Sun Jul  8 08:24:20 2018

% less script.out
Script started on Sun Jul  8 08:24:06 2018
You have mail.
% ls | grep gfx
ESC[1;31mgfxESC[00mESC[K
% uname -spr
FreeBSD 11.2-RELEASE amd64
% exit
exit

Script done on Sun Jul  8 08:24:20 2018


Edit Command Before Executing

Sometimes you have long multi-line command to execute, so often it is crafted in you favorite ${EDITOR} and then pasted into the terminal. To omit copying and pasting yo may want to check fc(1) command which serves similar purpose. After you type a command, for example simple ls(1) command, and then you type fc(1) command, then fc(1) will take that ls(1) command into your favorite text editor from ${EDITOR} variable, will allow you to edit it and if you save and exit the that editor, it will execute it.

Lets see how it behave by example.

% ls
gfx   books   download   scripts

% fc

Now you are taken into the ${EDITOR} which is vi(1) in my case.

      1 ls
~
~
~
/tmp/zsh999EQ6: unmodified: line 1

Lets made some changes.

      1 ls -l \
      2    -h
~
~
~
~

:wq

After you hit [ENTER] it will exit from ${EDITOR} and execute that command.

total 6181
drwxr-xr-x    87 vermaden  vermaden    87B 2017.12.18 15:30 books/
drwxr-xr-x    12 vermaden  vermaden    12B 2018.06.19 16:02 download/
drwxr-xr-x    19 vermaden  vermaden    20B 2018.05.24 11:52 gfx/
drwx------    12 vermaden  vermaden   310B 2018.07.07 03:23 scripts/

You may show that command by pressing [Up] key to check what has been executed.

% ls -l -h

Edit or Just View

When working in multi-admin environment – especially while debugging – one admin may block other admin’s work by using vi(1) – or just their favorite editor to ‘browse’ the file contents. Good practice in that case is using more(1) or less(1) instead of vi(1), but that frustrates some admins to type vi(1) again if they need to change something.

… and by the way, on FreeBSD more(1) is less(1) πŸ™‚

% uname -spr
FreeBSD 11.2-RELEASE amd64

% ls -i `which less` `which more`
492318 /usr/bin/less  492318 /usr/bin/more

A blocked ‘example’ is shown below when the second admin wanted to browse the /etc/rc.conf file while the first one already did that.

# vim /etc/rc.conf

E325: ATTENTION
Found a swap file by the name "/etc/.rc.conf.swp"
          owned by: root   dated: Sun Jul  8 08:38:35 2018
         file name: /etc/rc.conf
          modified: no
         user name: root   host name: t420s.local
        process ID: 54219 (still running)
While opening file "/etc/rc.conf"
             dated: Fri Jul  6 00:51:11 2018

(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r /etc/rc.conf"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/etc/.rc.conf.swp"
    to avoid this message.

Swap file "/etc/.rc.conf.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

This is where less(1) comes handy because of you open a file in it, you do not ‘block’ access to it and if you need to edit something just hi [V] key (small ‘v’ letter). It will open that file in your ${EDITOR} editor and you can make any changes now.

Reset

Last but not least, often when you paste ‘too much’ into the terminal it becomes ‘fragile’ or ‘broken’. To reset it into the ‘stable’ and ‘proper’ state just use the reset(1) command.

% reset

Hope You find it useful, see you at the Part 3 sometime πŸ˜‰

EOF

.
.
.
.
.

Valuable News – 2018/07/08

LibreOffice has been ported to Haiku OS.
https://haiku-os.tumblr.com/post/174629492437/libreoffice-620-was-ported-to-haiku-its
https://twitter.com/JasonPester/status/1013712819731288065

The GKSU/GKSUDO has been finally fixed on FreeBSD.
https://twitter.com/woodsb02/status/1013554427922300928
https://svnweb.freebsd.org/ports?view=revision&revision=473672

If Microsoft scared you out of GitHub and GitLab is hosted on Microsoft Azure you may want to check Asymptote Club alternative.
https://asymptote.club/
https://lobste.rs/s/nuavkg/asymptote_club

Why I use the IBM Model M keyboard that is older than me?
http://yeokhengmeng.com/2018/07/why-i-use-the-ibm-model-m-keyboard-that-is-older-than-me/

Atari ST font in FreeBSD 11.2 console.
https://twitter.com/vmisev/status/1014578693707100166
https://twitter.com/vmisev/status/1014584783098302465
https://twitter.com/vmisev/status/1014628259315830786

Red Hat recommends disabling Intel Hyper-Threading over TLBleed same as OpenBSD.
https://access.redhat.com/solutions/3508581

Waterfox 56.2.0 Release.
https://blog.waterfoxproject.org/waterfox-56.2.0-release-download

OpenBSD 6.3 on Raspberry Pi 3 Version 1.2.
https://www.tumfatig.net/20180706/running-openbsd-on-raspberry-pi-3/

FreeBSD adds fast syscall-less setproctitle_fast(3) for frequent PostgreSQL calls.
https://svnweb.freebsd.org/base?view=revision&revision=335939

Sysadmin cracked military PC security by reading the manual.
https://www.theregister.co.uk/AMP/2018/07/06/on_call/

NomadBSD 1.1 Released!
http://nomadbsd.org/index.html#rel1.1

NVMe device emulation has been added to Bhyve on FreeBSD.
https://svnweb.freebsd.org/base?view=revision&revision=335974

In Other BSDs for 2018/07/07.
https://www.dragonflydigest.com/2018/07/07/21471.html

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 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.

.
.
.
.
.

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

.
.
.
.
.