summaryrefslogtreecommitdiff
path: root/.local/bin/screenshot
blob: eca47ea6a52440f8588f7119ca7000f6b2dd69bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

main () {
    if [ ! -n "$1" ]; then
        print_screen ; exit 0
    fi

    case "$1" in
        -s) 
            selection ;;
        *) 
            echo "usage: screenshot [-s]" ;;
    esac
}

print_screen () {
    scrot -q 100 -e 'xclip -selection c -t image/png < $f; mv $f ~/Pictures/screenshots/'
}

selection () {
    sleep 0.2
    scrot -l mode=edge -i -s -e 'xclip -sel clip -t image/png $f; mv $f ~/Pictures/screenshots/' 
}

main "$@"