From e83eb6262651422052c37bb279bea246a3f2910f Mon Sep 17 00:00:00 2001 From: vorboyvo Date: Wed, 20 Mar 2024 23:55:56 -0400 Subject: [PATCH] Removed duplicate declaration of screenshot path, one in sway.nix for full screen print screen, one in dynscreenshot.sh for selected region print screen. --- programs/sway.nix | 2 +- scripts/dynscreenshot.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/sway.nix b/programs/sway.nix index cd63430..f30fdf3 100644 --- a/programs/sway.nix +++ b/programs/sway.nix @@ -36,7 +36,7 @@ in { keybindings = let screenshotPath = "Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png"; in lib.mkOptionDefault ({ # Screenshot keybinds "Print" = "exec grim - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of whole screen, save it, and copy it to clipboard "Shift+Print" = "exec swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | \"\\(.x),\\(.y) \\(.width)x\\(.height)\"' | grim -g - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of current window, save it, and copy it to clipboard - "Ctrl+Print" = "exec bash ${dynscreenshot}"; # Take screenshot of selection, save it, and copy it to clipboard + "Ctrl+Print" = "exec bash ${dynscreenshot} ${screenshotPath}"; # Take screenshot of selection, save it, and copy it to clipboard } // { # Function Media Keys XF86MonBrightnessUp = "exec bash ${changebrightness} 1"; XF86MonBrightnessDown = "exec bash ${changebrightness} -1"; diff --git a/scripts/dynscreenshot.sh b/scripts/dynscreenshot.sh index f942cb1..f17657b 100644 --- a/scripts/dynscreenshot.sh +++ b/scripts/dynscreenshot.sh @@ -1,3 +1,3 @@ -shotpath="$HOME/Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png" +shotpath=$1 # "$HOME/Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png" grim -g "$(slurp)" - | wl-copy wl-paste > $shotpath