From 3e46228da15fb992c9da4eb7be1748d254a96312 Mon Sep 17 00:00:00 2001 From: ktyl Date: Fri, 15 Apr 2022 13:34:25 +0100 Subject: [PATCH] add screenshot script --- .scripts/ss | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 .scripts/ss 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