Skip to content

Instantly share code, notes, and snippets.

@lonsagisawa
Last active June 30, 2018 05:25
Show Gist options
  • Save lonsagisawa/9116223 to your computer and use it in GitHub Desktop.
Save lonsagisawa/9116223 to your computer and use it in GitHub Desktop.
ImageMagickでスクリーンショットを撮り、libnofityで通知させる
#!/bin/sh
# アクティブなウィンドウのスクリーンショットを撮り、通知する
# 12 Mar 2014: dateコマンドの辺りで間抜けな間違いをしていたので修正
activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
activeWinId=${activeWinLine:40}
exec import -window "$activeWinId" -frame $HOME/Pictures/screenshot/$(date +%y%m%d_%H%M%S).png &
exec notify-send 'Screenshot Taken' $HOME/Pictures/screenshot/$(date +%y%m%d_%H%M%S).png &
#!/bin/sh
# 画面全体のスクリーンショットを撮り、通知する
# 12 Mar 2014: dateコマンドの辺りで間抜けな間違いをしていたので修正
exec import -window root $HOME/Pictures/screenshot/$(date +%y%m%d_%H%M%S).png &
exec notify-send 'Screenshot Taken' $HOME/Pictures/screenshot/$(date +%y%m%d_%H%M%S).png &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment