summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/i3/config4
-rwxr-xr-x.local/bin/printscreen3
-rwxr-xr-x.local/bin/screenshot17
3 files changed, 17 insertions, 7 deletions
diff --git a/.config/i3/config b/.config/i3/config
index bb024d4..467691a 100644
--- a/.config/i3/config
+++ b/.config/i3/config
@@ -14,8 +14,8 @@ bindsym $mod+b exec firefox
bindsym $mod+e exec pcmanfm
bindsym $mod+f fullscreen toggle
bindsym $mod+i exec --no-startup-id polybar-msg cmd toggle
-bindsym $mod+Shift+s exec --no-startup-id ~/.local/bin/screenshot
-bindsym Print exec --no-startup-id ~/.local/bin/printscreen
+bindsym $mod+Shift+s exec --no-startup-id ~/.local/bin/screenshot -s
+bindsym Print exec --no-startup-id ~/.local/bin/screenshot
bindsym $mod+Shift+c exec --no-startup-id ~/.local/bin/picom-toggle
bindsym $mod+d exec --no-startup-id rofi -show drun -show-icons -drun-display-format {name}
diff --git a/.local/bin/printscreen b/.local/bin/printscreen
deleted file mode 100755
index 588b15b..0000000
--- a/.local/bin/printscreen
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-scrot -q 100 -e 'xclip -selection c -t image/png < $f; mv $f ~/Pictures/screenshots/'
diff --git a/.local/bin/screenshot b/.local/bin/screenshot
index 3eb9ec1..502888f 100755
--- a/.local/bin/screenshot
+++ b/.local/bin/screenshot
@@ -1,4 +1,17 @@
#!/bin/sh
-sleep 0.2
-scrot --line mode=edge -s -e 'xclip -selection c -t image/png < $f; mv $f ~/Pictures/screenshots/'
+if [ ! -n "$1" ]; then
+ scrot -q 100 -e 'xclip -selection c -t image/png < $f; mv $f ~/Pictures/screenshots/'
+fi
+
+while [ -n "$1" ]; do # while loop starts
+ case "$1" in
+ -s)
+ sleep 0.2
+ scrot --line mode=edge -i -s -e 'xclip -selection c -t image/png < $f; mv $f ~/Pictures/screenshots/'
+ ;;
+ *) echo "Option $1 not recognized" ;;
+ esac
+ shift
+done
+