-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreenshot.sh
executable file
·44 lines (35 loc) · 949 Bytes
/
screenshot.sh
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
#!/bin/bash
clear
echo "Welcome to your screenshot manager!"
sleep 1.5
# Asks file name
echo "What should the file name be?"
read fileName
clear
# Asks file type
echo "What do you want the file type to be?"
echo "Do not include the dot ex:jpg not .jpg"
read fileType
clear
# Simplifys file
file="$fileName.$fileType"
echo "taking screen shot in 3s"
sleep 3
#screen shots selected area(from slurp)
grim -g "$(slurp)" "$file"
echo "File: $file created!"
# Explains where file is
if [ "$PWD" == "$HOME/ScreenShots" ]; then
echo "File created in $PWD"
else
# Check if the current working directory is not ~/ScreenShots
if [ "$PWD" != "$HOME/ScreenShots" ]; then
mv "$file" "$HOME/ScreenShots/"
echo "File moved to $HOME/ScreenShots"
else
mkdir $HOME/ScreenShots
mv "$file" "$HOME/Screenshots/"
echo "Created ScreenShots Directory"
echo "Moved file to $HOME/ScreenShots"
fi
fi