From ad87763a8af149a8dd9431a40574ccb95713de6e Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 29 Jul 2021 05:02:32 +0200 Subject: [PATCH] Move from scrot to flameshot (screenshtos) --- home/.config/xmonad/xmonad.hs | 9 +++-- home/.local/bin/scripts/screenshot | 63 ------------------------------ 2 files changed, 5 insertions(+), 67 deletions(-) delete mode 100755 home/.local/bin/scripts/screenshot diff --git a/home/.config/xmonad/xmonad.hs b/home/.config/xmonad/xmonad.hs index ae706b2..f887ae4 100644 --- a/home/.config/xmonad/xmonad.hs +++ b/home/.config/xmonad/xmonad.hs @@ -115,10 +115,11 @@ myKeys = , ("M-S-", spawn "dmenu_run -i -p \"Run: \"") -- Screenshots - , ("", spawn "screenshot --xmonad") -- Full screenshot, file - , ("M-", spawn "screenshot --xmonad -c") -- Full screenshot, clipboard - , ("S-", spawn "screenshot --xmonad -s") -- Selection screenshot, file - , ("M-S-", spawn "screenshot --xmonad -s -c") -- Selection screenshot, clipboard + , ("", spawn "flameshot gui") + , ("M-", spawn "flameshot screen -p ~/Pictures/Screenshots") + , ("M-S-", spawn "flameshot screen -c") + , ("C-", spawn "flameshot full -p ~/Pictures/Screenshots") + , ("C-S-", spawn "flameshot full -c") -- Script shortcuts , ("M-S-p", spawn "setbg ~/Pictures/Wallpapers/Active") -- Set random background diff --git a/home/.local/bin/scripts/screenshot b/home/.local/bin/scripts/screenshot deleted file mode 100755 index 870aa37..0000000 --- a/home/.local/bin/scripts/screenshot +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -format="Screenshot_%Y%m%d_%H%M%S.png" -destination="~/Pictures/Screenshots/" -clipboard=0 -xmonad=0 - -POSITIONAL=() -while [[ $# -gt 0 ]] ;do - key=$1 - - case $key in - -c|--clipboard) - clipboard=1 - shift - ;; - --xmonad) - xmonad=1 - shift - ;; - -f|--format) - format=$2 - shift - shift - ;; - -d|--destination) - destination=$2 - shift - shift - ;; - -e|--exec) - echo "Can't use exec, already used by script" - exit 1 - ;; - *) - POSITIONAL+=("$1") - shift - ;; - esac -done - -set -- "${POSITIONAL[@]}" # restore positional parameters - -# Define the base command -cmd="scrot '$format'" - -# Handle exec arg for img destination (clipboard/folder) -if [ $clipboard -eq 1 ]; then - cmd+=" -e 'xclip -selection clipboard -t image/png -i \$f && rm \$f'" -else - cmd+=" -e 'mv \$f $destination'" -fi - -# For some reason, xmonad can't run this without first sleeping -if [ $xmonad -eq 1 ]; then - cmd="sleep 0.2; $cmd" -fi - -# Add user-defined arguments -cmd+=" $@" - -# Execute the string command -eval $cmd