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 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.
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 –
– to set various CPU frequencies (from left Low/Medium/High).
- Provide button –
– to set new random wallpaper.
Here is how such Tint2 task bar would look like in action, along with previously configured Dzen2 status bar.
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 π
Here is the apps.tar.gz tarball with ~/.apps
directory and files.
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.
Β
Pingback: FreeBSD desktop (14) | 0ddn1x: tricks with *nix
Pingback: FreeBSD Desktop – Part 13 – Configuration – Dzen2 | vermaden
Pingback: FreeBSD Desktop – Part 12 – Configuration – Openbox | vermaden
Pingback: FreeBSD Desktop – Part 11 – Key Components – Blue Light Spectrum Suppress | vermaden
Pingback: FreeBSD Desktop – Part 10 – Key Components – Locking Solution | vermaden
Pingback: FreeBSD Desktop – Part 9 – Key Components – Keyboard/Mouse Shortcuts | vermaden
Pingback: FreeBSD Desktop – Part 7 – Key Components – Wallpaper Handling | vermaden
Pingback: FreeBSD Desktop – Part 8 – Key Components – Application Launcher | vermaden
Pingback: FreeBSD Desktop – Part 5 – Key Components – Status Bar | vermaden
Pingback: FreeBSD Desktop – Part 15 – Configuration – Fonts & Frameworks | vermaden
Pingback: FreeBSD Desktop – Part 1 – Simplified Boot | vermaden
Pingback: FreeBSD Desktop – Part 2 – Install | vermaden
Pingback: FreeBSD Desktop – Part 3 – X11 Window System | vermaden
Pingback: FreeBSD Desktop – Part 6 – Key Components – Task Bar | vermaden
Pingback: FreeBSD Desktop – Part 4 – Key Components – Window Manager | vermaden
Pingback: FreeBSD Desktop – Part 16 – Configuration – Pause Any Application | vermaden
How the files *.desktop are copy from dir ~/.apps ?
LikeLike
Hi,
I do not understand the question, could You try to ask again in different words?
Thanks,
vermaden
LikeLike
Here is the tarball with ~/.apps directory and files:
https://github.com/vermaden/scripts/raw/master/distfiles/apps.tar.gz
LikeLike
Okay thnx will try that
LikeLike
Pingback: FreeBSD Desktop – Part 17 – Automount Removable Media | π π ΄ππΌπ°π³π π
Pingback: FreeBSD Desktop – Part 2.1 – Install FreeBSD 12 | ππππππππ
Ive got it working is far only tint2 isnt starting once i login… did the things like the post says.
But no succes can you help me out??
Also what is thuis in the tint2rc file
launcher_item_app = /home/vermaden/.apps/caja.desktop Ive got like /home/βusernameβ/.apps/caja.desktop but in my home folder i dont have a folder .apps.. did make 1 but got no *.desktop files there.
LikeLike
Here is the tarball with ~/.apps directory and files:
https://github.com/vermaden/scripts/raw/master/distfiles/apps.tar.gz
LikeLike
Nice no help…
LikeLike
Sorry I missed your earlier comment.
LikeLike
he still can get it to work..tint2 isnt starting.
if i do it manualy by the cli it starting tint2 but not with script its using the .config/openbox.
Also were do i put the line
# 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
LikeLike
To have tint2 autostart put it into ~/.xinitrc or ~/.xsession file.
LikeLike
or is it a command sorry im really a noob
also i do have it in my home folder
sed: /root/.config/openbox/menu.xml: No such file or directory
sed: /root/.config/openbox/rc.xml: No such file or directory
LikeLike
Yes they are commands to run ONCE.
Do not use X11 as root.
LikeLike
i got this error
No matching processes belonging to you were found
tint2: xRandr: Found crtc’s: 3
^[[1;34mtint2: xRandr: Linking output eDP1 with crtc 0, resolution 1600×900, DPI
131^[[0m
tint2: xRandr: crtc 1 seems disabled
tint2: xRandr: crtc 2 seems disabled
Killed
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
JavaScript error: resource://activity-stream/lib/ASRouterTargeting.jsm, line 66:
TypeError: Cc[‘@mozilla.org/updates/update-checker;1’] is undefined
(sakura:68473): Vte-WARNING **: 09:02:02.652: (vtegtk.cc:1916):int vte_terminal_
match_add_regex(VteTerminal *, VteRegex *, guint32): runtime check failed: (_vte
_regex_get_compile_flags(regex) & PCRE2_MULTILINE)
(sakura:68473): Vte-WARNING **: 09:02:02.655: (vtegtk.cc:1916):int vte_terminal_
match_add_regex(VteTerminal *, VteRegex *, guint32): runtime check failed: (_vte
_regex_get_compile_flags(regex) & PCRE2_MULTILINE)
in xsessiosn-errors
LikeLike
Tint2 isnt starting and got thuis error in my xsession-erros file any idea whats wrong?
LikeLike
I never got such error …
LikeLike
any tips still can get it to work…
PATH TO SCRIPTS
export PATH=${PATH}:~/scripts
# SET PROPER locale(1) with LC_ALL VARIABLE.
export LC_ALL=en_US.UTF-8
# PRESTARTED APPS
~/scripts/__openbox_restart_tint2.sh &
~/scripts/__openbox_restart_dzen2.sh &
xsetroot -solid black &
xterm &
tint2 &
dzen2 &
# WINDOW MANAGER
openbox
# GTK ANTIALIASING
export GDK_USE_XFT=1
# QT MUST KNOW WHERE IS GTK2 CONFIG
export GTK2_RC_FILES=”${HOME}/.gtkrc-2.0″
LikeLike
Pingback: In Other BSDs for 2019/03/09 – DragonFly BSD Digest
Pingback: FreeBSD Desktop – Part 18 – Global Dashboard | ππππππππ
Hi Vermaden,
i follow your guide but i have a small problem.
tint2 is stop working whenever i restarted it.
i need to log out then re-login to be able tint2 to run again.
fyi i put tint2 -c ~/.tint2rc on ~/.config/openbox/autostart
LikeLike
The ~/.config/openbox/autostart location also works π
LikeLike