summaryrefslogtreecommitdiff
path: root/dot-config/rofi/scripts/screenshot.sh
blob: 0b26829559292af0a80493e52b8cc1d18a4d3524 (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
26
27
28
29
30
31
#!/usr/bin/env bash

## Author  : Aditya Shakya
## Mail    : adi1090x@gmail.com
## Github  : @adi1090x
## Twitter : @adi1090x

dir="$HOME/.config/rofi/styles"
rofi_command="rofi -theme $dir/three.rasi"

# Options
screen=""
area=""
window=""

# Variable passed to rofi
options="$screen\n$area\n$window"

chosen="$(echo -e "$options" | $rofi_command -p '' -dmenu -selected-row 1)"
case $chosen in
    $screen)
		scrot -e 'xclip -selection clipboard -target image/png -i $f && rm $f'
        ;;
    $area)
		scrot -s --line mode=edge -e 'xclip -selection clipboard -target image/png -i $f && rm $f'
        ;;
    $window)
		scrot -u -e 'xclip -selection clipboard -target image/png -i $f && rm $f'
        ;;
esac