From: Maximilian Friedersdorff Date: Mon, 6 Nov 2023 10:48:11 +0000 (+0000) Subject: Add function to scrot X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=468c353640a3003571af1fd3dfd3b0041f399b9e;p=max%2Fsaltfiles.git Add function to scrot --- diff --git a/states/zsh/files/zshrc b/states/zsh/files/zshrc index ff5eccf..aeed741 100644 --- a/states/zsh/files/zshrc +++ b/states/zsh/files/zshrc @@ -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" +}