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

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

1. 概要

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

2. インストール

 「antiX」

apt install -y xfce4-screenshooter xfce4-clipman
 「ArcoLinux」

yes | pacman -S xfce4-screenshooter xfce4-clipman-plugin
 「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
 「antiX」「FreeBSD」では、「sxhkd」の起動が不要なので

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

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

EOF
exit
 「ArcoLinux 22.03.07」

sh
cat << 'EOF' >> ~/.config/herbstluftwm/autostart
run xfce4-clipman &
EOF
exit

4. キー定義

 「ArcoLinux」

vi ~/.config/herbstluftwm/sxhkd/sxhkdrc

#################################################################
#     SCREENSHOTS
#################################################################

#Scrot
Print
    scrot 'ArcoLinux-%Y-%m-%d-%s_screenshot_$wx$h.jpg' -e 'mv $f $$(xdg-user-dir PICTURES)'

#screeenshooter
ctrl + Print
     xfce4-screenshooter
 を下記へ変更します。

#################################################################
#     SCREENSHOTS
#################################################################

#
Print
     xfce4-screenshooter -c -f

#
ctrl + Print
     xfce4-screenshooter -c -w
 「antiX」「FreeBSD」

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

hc keybind Print         spawn xfce4-screenshooter -c -f
hc keybind Control-Print spawn xfce4-screenshooter -c -w
 これで、ログインしなおせば、思い通りの動きになります。  実は、「antiX」では、「xfce4-clipman」が、ようこけるのですが、mod+Shift+r ですぐに起動しなおせるので、我慢できなくなるまでは使えそうです。  我慢できなくなったら、「mate-screenshot」に置き換えます。
earthcar(アースカー)