From d6f713d11731dcea558915f9cef91e74e95c8022 Mon Sep 17 00:00:00 2001 From: ktyl Date: Fri, 15 Apr 2022 13:34:25 +0100 Subject: [PATCH 1/2] add screenshot script --- .config/sxhkd/sxhkdrc | 4 ++-- .scripts/ss | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 .scripts/ss diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 39545b9..4073e80 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -29,9 +29,9 @@ super + Escape $HOME/.config/bspwm/bspwmrc reload Print - $SCRIPTS/screenshot/ssall + $SCRIPTS/screenshot/ss super + shift + s - $SCRIPTS/screenshot/ssregion + $SCRIPTS/screenshot/ss -Dosu # # bspwm hotkeys diff --git a/.scripts/ss b/.scripts/ss new file mode 100755 index 0000000..316de92 --- /dev/null +++ b/.scripts/ss @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# take a screenshot of a region selected by the cursor and copy it to the clipboard +# using maim and xclip + +# accept all passed arguments and pass them to maim +maimflags="$@" + +dir="$(xdg-user-dir PICTURES)/ss" +file="$dir/$(date +%s).png" + +# create screenshot dir if it doesn't exist +[ -d $dir ] || mkdir -p $dir + +# save screenshot to a file with a unique ordered timestamp +maim $maimflags $file + +# copy the file to the clipboard +xclip -selection clipboard -target image/png $file From 77531584d3d6863d3c1a0398d5afd813f49309b4 Mon Sep 17 00:00:00 2001 From: ktyl Date: Fri, 15 Apr 2022 13:41:20 +0100 Subject: [PATCH 2/2] change back to mod+d for dmenu lol --- .config/sxhkd/sxhkdrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 4073e80..52d2c2a 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -11,7 +11,7 @@ super + b $SCRIPTS/bar/toggle # program launcher -super + space +super + d dmenu_run -b # gapples