From 0cb56c9a46dc7e1a0d91bf53608e628edfcfc036 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 1 May 2022 18:37:27 +0200 Subject: [PATCH] [dwm] feat: add screenshot script + keymap --- .config/sxhkd/sxhkdrc | 3 +++ .local/bin/screenshot | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100755 .local/bin/screenshot diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 687ef73..0538d1f 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -50,6 +50,9 @@ super + shift + Return super + d dmenu_run -p "run:" +super + p + screenshot + super + shift + {w,z} $BROWSER diff --git a/.local/bin/screenshot b/.local/bin/screenshot new file mode 100755 index 0000000..8c4c684 --- /dev/null +++ b/.local/bin/screenshot @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +if [ "-w" = "$1" ]; then + scrot -e 'xclip -selection clipboard -t image/png -i $f && rm $f' +else + if [ ! "" = "$1" ]; then + dunstify -u "normal" " Wrong parameter. No screenshot taken" && exit 1 + else + scrot -s -e 'xclip -selection clipboard -t image/png -i $f && rm $f' + fi +fi