herbstluftwm - 共通事項 - 画面キャプチャ - 概要

 クラウディア
1. 概要
2. インストール
3. 設定
4. キー定義

1. 概要

 画面キャプチャ用のプログラムとして、「scrot」あたりがインストールされていますが、わたしには、ちょっと使えないので、「xfce4-screenshooter」をインストールして使用します。  「xfce4-screenshooter」は、「xfce4-clipman」と併用すれば、クリップボードへのコピーもできます。

2. インストール

 「root」ユーザ権限で。  「FreeBSD」

pkg install -y xfce4-screenshooter-plugin xfce4-clipman-plugin

3. 設定

 「xfce4-clipman」の起動と「xfce4-screenshooter」のキーボードショートカット
 キー    定義      意味   
Print xfce4-screenshooter -c -f 全画面をキャプチャしてクリップボードへコピー
Ctrl+Print xfce4-screenshooter -c -w アクティブウィンドウをキャプチャしてクリップボードへコピー

 「herbstluftwm」起動時に「xfce4-clipman」を起動します。
 「herbstluftwm」を「reload」するときに、二重起動しないように、少しだけ工夫しておきます。


sh
cat << 'EOF' >> ~/.config/herbstluftwm/autostart

if [ -z `pgrep -f xfce4-clipman` ]; then
    xfce4-clipman &
fi

sxhkd &
EOF
exit
 「FreeBSD」では、「sxhkd」の起動が不要なので

sh
cat << 'EOF' >> ~/.config/herbstluftwm/autostart

if [ -z `pgrep -f xfce4-clipman` ]; then
    xfce4-clipman &
fi

EOF
exit

4. キー定義

 ログインユーザで。  「FreeBSD」

vi ~/.config/herbstluftwm/autostart
 キー定義の個所に以下を記述します。

hc keybind Print         spawn xfce4-screenshooter -c -f
hc keybind Control-Print spawn xfce4-screenshooter -c -w
 これで、ログインしなおせば、思い通りの動きになります。
earthcar(アースカー)