Polybar
polybar はステータスバーを簡単に素早く作れるツールです。多数のモジュールを利用して、ワークスペース・日付・システムボリュームの表示など様々な機能を簡単にカスタマイズできるようになっています。Polybar は awesome や i3 などステータスバーが付属していないウィンドウマネージャで特に有用です。また、Polybar は Plasma などのデスクトップ環境でも使用できます。
目次
インストール
polybar パッケージをインストールしてください。開発版は polybar-gitAUR です。
設定
デフォルトの設定例は/etc/polybar/config.iniです。Polybarは、~/.config/polybar/config.iniまたは/etc/xdg/polybar/config.ini、/etc/polybar/config.iniから最初に見つかったものに応じて設定ファイルをロードします。設定を編集したければ、/etc/polybar/config.iniから~/.config/polybar/config.iniにコピーして編集してください。
Polybarの実行
Polybarは以下のように起動できます:
Usage: polybar [OPTION]... BAR
-h, --help Display this help and exit
-v, --version Display build details and exit
-l, --log=LEVEL Set the logging verbosity (default: WARNING)
LEVEL is one of: error, warning, info, trace
-q, --quiet Be quiet (will override -l)
-c, --config=FILE Path to the configuration file
-r, --reload Reload when the configuration has been modified
-d, --dump=PARAM Print value of PARAM in bar section and exit
-m, --list-monitors Print list of available monitors and exit
-w, --print-wmname Print the generated WM_NAME and exit
-s, --stdout Output data to stdout instead of drawing it to the X window
-p, --png=FILE Save png snapshot to FILE after running for 3 seconds
ウィンドウマネージャの起動時にPolybarを実行したい場合は#ウィンドウマネージャで実行を見てください。
設定例
基本的なPolybarの設定は以下のようになります。
[bar/mybar] modules-right = date [module/date] type = internal/date date = %Y-%m-%d%
mybarという名前のバーと、dateというモジュールを定義しています。
デフォルトでは、Polybarは/etc/polybar/config.iniに多数の構成済みモジュールを含むサンプル構成もインストールします。
ウィンドウマネージャで実行
$HOME/.config/polybar/launch.shなどに実行ファイルを作成してください:
#!/bin/bash # Terminate already running bar instances killall -q polybar # Wait until the processes have been shut down while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done # Launch Polybar, using default config location ~/.config/polybar/config polybar & echo "Polybar launched..."
上記のスクリプトを使うとウィンドウマネージャを再起動したときにPolybarも再起動されます。以下のようにカスタマイズすることもできます:
MONITOR=HDMI-A-1 polybar &
上記のコマンドでは指定したモニターにPolybarが表示されます (モニターはxrandrコマンドで確認できます)。Polybarの位置を指定するには:
polybar top &
bspwm
bspwmを使用する場合、以下をbspwmrcに追加:
$HOME/.config/polybar/launch.sh
i3
i3を使用する場合、以下を設定に追加:
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
トラブルシューティング
共有オブジェクトファイル libjsoncpp.so を開けません
GitHubの issue の説明に従って再インストールを試みます。
失敗した場合は、jsoncpp パッケージを インストール してみてください。