From 4ca87186430321f67ffd12c9ec89b5ccfbb68bfc Mon Sep 17 00:00:00 2001 From: harry123 Date: Sun, 23 Mar 2025 17:39:23 +0100 Subject: [PATCH] fixed script --- home-manager/dotfiles/sway/scripts/screen_and_copy.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home-manager/dotfiles/sway/scripts/screen_and_copy.sh b/home-manager/dotfiles/sway/scripts/screen_and_copy.sh index 95b05ec..7aecdc5 100755 --- a/home-manager/dotfiles/sway/scripts/screen_and_copy.sh +++ b/home-manager/dotfiles/sway/scripts/screen_and_copy.sh @@ -4,4 +4,10 @@ elif [ "$1" = "output" ]; then SCREENPATH=$(grimshot save output) fi -cat $SCREENPATH | wl-copy -t image/png +if [[ -f "$SCREENPATH" ]]; then + cat "$SCREENPATH" | wl-copy -t image/png + echo "Screenshot copied to clipboard :3" +else + echo "oh noes it failed... no file at $SCREENPATH" + exit 1 +fi