- 1. 概要
- 2. dzen2
- 3. 試行錯誤
- 4. 設定
1. 概要
以下、デフォルトで用意されている「dzen2」の話です。
今んとこ(2021年6月29日)、一応インストールして起動するとこまではできるので、以下に記述していますが。
「dzen2」のカスタマイズに関しては、まだまだですかな。
どうも「Dzen - ArchWiki」を読めば、一応あれこれできるようですが。
まだ、いささか難解なきらいがあります。
面倒なので、当分(2021年6月29日)、「tint2」を使っちゃおうかなと思っています。
「tint2」と「jgmenu」を合わせて使う方法に関しては、「メニュー」の項でどうそ。
2. dzen2
「antiX」では
~/.config/herbstluftwm/autostart
の
# find the panel
panel=~/.config/herbstluftwm/panel.sh
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
# start it on each monitor
$panel $monitor &
done
で、パネルを表示しておるようです。
「ArcoLinux」では、他のデスクトップで表示しているのと同様、「polybar」なるバーを表示しておって、なにやら表示しております。
まぁ、良しとします。
「FreeBSD」では
~/.config/herbstluftwm/autostart
に
# find the panel
panel=~/.config/herbstluftwm/panel.sh
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
for monitor in $(hc list_monitors | cut -d: -f1) ; do
# start it on each monitor
"$panel" "$monitor" &
done
てなことを書いてありますが、起動しません。
こういうのを掲載するのもどうかとは、思いますが、きれいな背景色ではありますが、のっぺらぼうで何もなしだ。

3. 試行錯誤
グラフィックログインした状態で、端末から起動してみようとしますと
$ ~/.config/herbstluftwm/panel.sh
This script requires the textwidth tool of the dzen2 project.
と言われます。
探してみると「dzen2」というパッケージが存在するのでインストールしてみます。
pkg install -y dzen2
再度、起動してみます。
すると今度は、
$ ~/.config/herbstluftwm/panel.sh
This script requires the textwidth tool of the dzen2 project.
てなことになる。
スクリプトを調べてみると
####
# Try to find textwidth binary.
# In e.g. Ubuntu, this is named dzen2-textwidth.
if which textwidth &> /dev/null ; then
textwidth="textwidth";
elif which dzen2-textwidth &> /dev/null ; then
textwidth="dzen2-textwidth";
elif which xftwidth &> /dev/null ; then # For guix
textwidth="xtfwidth";
else
echo "This script requires the textwidth tool of the dzen2 project."
exit 1
fi
のところでエラーになっておるわけです。
調べてみると、「dzen2」には、「textwidth」もしくは「dzen2-textwidth」というプログラムが同梱されているはずなのにそれが内容です。
もしくは「xftwidth」というプログラムでも代用できるようですが、それもない・・・。
要は、「textwidth」に、フォントの幅を与えてやればいいのだな・・・と。
4. 設定
結構大胆なことをします。
vi ~/.config/herbstluftwm/panel.sh
font="-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*"
フォントを「MigMix 1M」へ変更します。
font="MigMix 1M"
下記の部分は、どうせないものなので、全部コメントアウトします。
if which textwidth &> /dev/null ; then
textwidth="textwidth";
elif which dzen2-textwidth &> /dev/null ; then
textwidth="dzen2-textwidth";
elif which xftwidth &> /dev/null ; then # For guix
textwidth="xtfwidth";
else
echo "This script requires the textwidth tool of the dzen2 project."
exit 1
fi
width=$($textwidth "$font" "$right_text_only ")
の部分。
大胆に、「12」で決め打ち。
width=12
ログインしなおすと、一応パネルが表示されるのです。

|