aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2024-05-11 19:56:21 +0100
committerJustine Smithies <justine@smithies.me.uk>2024-05-11 19:56:21 +0100
commit24edfdda009c3b004501526ed6524d5c7f3b8cce (patch)
treefcf73c66d7d9800de4ceca33ead09f9d1a110b2c /.local
parent821a58a1f1972990282fe422d2b8e09cdf6de16d (diff)
Fixed missing double quotes
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/screenshot.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/.local/bin/screenshot.sh b/.local/bin/screenshot.sh
index 6945464..cc9d3a6 100755
--- a/.local/bin/screenshot.sh
+++ b/.local/bin/screenshot.sh
@@ -3,7 +3,7 @@
case $1 in
selected-region)
# Take a screenshot of the selected region
- grim -t jpeg -g "$(slurp)" ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
+ grim -t jpeg -g "$(slurp)" ~/Pictures/Screenshots/"$(date +%Y-%m-%d_%H-%m-%s)".jpg
;;
save-to-clipboard)
# Take a screenshot and save it to the clipboard
@@ -12,20 +12,20 @@ case $1 in
focused-window)
# Take a screenshot of the focused window
pos=$(hyprctl -j activewindow | grep 'at' | tr -dc '0-9 ')
- xpos=$(echo $pos | awk '{ print $1 }')
+ xpos=$(echo "$pos" | awk '{ print $1 }')
xpos=$((xpos-2))
- ypos=$(echo $pos | awk '{ print $2 }')
+ ypos=$(echo "$pos" | awk '{ print $2 }')
ypos=$((ypos-2))
size=$(hyprctl -j activewindow | grep 'size' | tr -dc '0-9 ')
- xsize=$(echo $size | awk '{ print $1 }')
- ysize=$(echo $size | awk '{ print $2 }')
+ xsize=$(echo "$size" | awk '{ print $1 }')
+ ysize=$(echo "$size" | awk '{ print $2 }')
xsize=$((xsize+4)) # Value added is 2 times the border width
ysize=$((ysize+4)) # Value added is 2 times the border width
- grim -g "$xpos"",""$ypos $xsize""x""$ysize" -t jpeg ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
+ grim -g "$xpos"",""$ypos $xsize""x""$ysize" -t jpeg ~/Pictures/Screenshots/"$(date +%Y-%m-%d_%H-%m-%s)".jpg
;;
*)
# Take a screenshot of the currently focused output and save it into screenshots
output="$(hyprctl monitors | grep -B 12 'focused: yes' | grep 'Monitor' | awk '{ print $2 }')"
- grim -o $output -t jpeg ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
+ grim -o "$output" -t jpeg ~/Pictures/Screenshots/"$(date +%Y-%m-%d_%H-%m-%s)".jpg
;;
esac