about summary refs log tree commit diff stats
path: root/dot_local/bin/executable_s
blob: e222ea703fed4d8f871b58803fda296ea3e81941 (plain) (blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
case $1 in
	cf)
		filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
		maim -s > "$HOME/media/screenshots/$filename"
		xclip -sel clipb -t image/png "$HOME/media/screenshots/$filename"
		;;
	cl)
		filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
		maim -s > $HOME/media/screenshots/$filename
		curl -F"file=@$HOME/media/screenshots/$filename" -Fsecret= "https://0.vern.cc/" | xclip -sel clipb
		;;
	wf)
		filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
		maim -i $(xdotool getactivewindow) > "$HOME/media/screenshots/$filename"
		xclip -sel clipb -t image/png "$HOME/media/screenshots/$filename"
		;;
	wl)
		filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
		maim -i $(xdotool getactivewindow) > $HOME/media/screenshots/$filename
		curl -F"file=@$HOME/media/screenshots/$filename" -Fsecret= "https://0.vern.cc/" | xclip -sel clipb
		;;
	ff)
		filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
		maim > "$HOME/media/screenshots/$filename"
		xclip -sel clipb -t image/png "$HOME/media/screenshots/$filename" 
		;;
	fl)
		filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
		maim > $HOME/media/screenshots/$filename
		curl -F"file=@$HOME/media/screenshots/$filename" -Fsecret= "https://0.vern.cc/" | xclip -sel clipb
		;;
	*)
		echo "Usage info:"
		echo
		echo "s cf - Takes a screenshot from a region and then copies the file to the clipboard selection"
		echo "s cl - Takes a screenshot from a region and then uploads it to 0.vern.cc, and automatically copies the link"
		echo "s wf - Takes a screenshot from the active window and then copies the file to the clipboard selection"
		echo "s wl - Takes a screenshot from the active window and then uploads it to 0.vern.cc, and automatically copies the link"
		echo "s ff - Takes a screenshot of the full screen and then copies the file to the clipboard selection"
		echo "s fl - Takes a screenshot of the full screen and then uploads it to 0.vern.cc, and automatically copies the link"
		echo 
		echo "Notice: all of these commands output it's screenshots to \`~/media/screenshots/\`."
esac