index — dotfiles @ cc82c0264384d44e0bb8cb97648f784b5b2d4e52

my dotfiles

bin/screenshot (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
#!/bin/sh

# 
# Takes a screenshot with grimshot, in clipboard or in given directory
#

MODE=$(printf "save\ncopy" | dmenu)

# If dmenu was cancelled, exit program
if [ $? -ne 0 ]; then
    exit 1
fi

case "$MODE" in 
  *save*)
    cd $HOME/downloads/screenshots
    timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
    /usr/share/sway-contrib/grimshot save area "$timestamp.png"
    ;;
  *copy*)
    /usr/share/sway-contrib/grimshot copy area
    ;;
esac