summaryrefslogtreecommitdiffstats
path: root/bin/screenshot
diff options
context:
space:
mode:
authorChristian Krinitsin <code@krinitsin.xyz>2024-12-27 17:35:18 +0100
committerChristian Krinitsin <code@krinitsin.xyz>2024-12-27 17:35:40 +0100
commit4d201b6329b334092d9939372118761188883bcd (patch)
treef7553c4993d685e1461096a98f2d4cdba994dd21 /bin/screenshot
parent6891c0b3055fd0cfbc7f99d47b6d74172ab27994 (diff)
downloaddotfiles-4d201b6329b334092d9939372118761188883bcd.tar.gz
dotfiles-4d201b6329b334092d9939372118761188883bcd.zip
update dotfiles
Diffstat (limited to 'bin/screenshot')
-rwxr-xr-xbin/screenshot46
1 files changed, 24 insertions, 22 deletions
diff --git a/bin/screenshot b/bin/screenshot
index e6956cb..9704a2c 100755
--- a/bin/screenshot
+++ b/bin/screenshot
@@ -4,7 +4,7 @@
# Takes a screenshot with grimshot, in clipboard or in given directory
#
-MODE=$(printf "copy\nsave" | dmenu)
+MODE=$(printf "save\ncopy" | dmenu)
# If dmenu was cancelled, exit program
if [ $? -ne 0 ]; then
@@ -13,27 +13,29 @@ fi
case "$MODE" in
*save*)
- cd $HOME
- while true; do
- selected_dir=$(ls | dmenu -i)
- if [ -z "$selected_dir" ]; then
- exit 0
- fi
-
- if [ -d "$selected_dir" ]; then
- cd "$selected_dir"
- continue
- fi
-
- if [ -e "$selected_dir" ]; then
- notify-send "Error: File exists!"
- exit 0
- fi
-
- break
- done
-
- grimshot save area "$PWD/$selected_dir.png" && notify-send "$PWD/$selected_dir.png" "saved"
+ cd $HOME/downloads/screenshots
+ # while true; do
+ # selected_dir=$(ls | dmenu -i)
+ # if [ -z "$selected_dir" ]; then
+ # exit 0
+ # fi
+ #
+ # if [ -d "$selected_dir" ]; then
+ # cd "$selected_dir"
+ # continue
+ # fi
+ #
+ # if [ -e "$selected_dir" ]; then
+ # notify-send "Error: File exists!"
+ # exit 0
+ # fi
+ #
+ # break
+ # done
+
+ # grimshot save area "$PWD/$selected_dir.png" && notify-send "$PWD/$selected_dir.png" "saved"
+ timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
+ grimshot save area "$timestamp.png" && notify-send "$timestamp.png" "saved"
;;
*copy*)
grimshot copy area && notify-send "Screenshot copied"