]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Add function to scrot
authorMaximilian Friedersdorff <maximilian.friedersdorff@envsys.co.uk>
Mon, 6 Nov 2023 10:48:11 +0000 (10:48 +0000)
committerMaximilian Friedersdorff <maximilian.friedersdorff@envsys.co.uk>
Mon, 6 Nov 2023 10:48:11 +0000 (10:48 +0000)
states/zsh/files/zshrc

index ff5eccf65f25228ecb5742be6f388d999e395583..aeed74141217c9de959c79ca4c15f906ba4cffa0 100644 (file)
@@ -100,3 +100,9 @@ sri() {
     base64_hash=$(curl "$1" | shasum -b -a "$2" - | awk '{print $1}' | xxd -r -p | base64)
     echo "sha${2}-${base64_hash}"
 }
+
+scrot() {
+    tmp_file=$(mktemp --tmpdir XXXXXX_scrot.png)
+    grim -g "$(slurp)" "$tmp_file"
+    echo "$tmp_file"
+}