From 468c353640a3003571af1fd3dfd3b0041f399b9e Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Mon, 6 Nov 2023 10:48:11 +0000 Subject: [PATCH] Add function to scrot --- states/zsh/files/zshrc | 6 ++++++ 1 file changed, 6 insertions(+) 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" +} -- 2.46.2