Updates screenshot script
This commit is contained in:
parent
72e0a76102
commit
2f30dff547
1 changed files with 11 additions and 4 deletions
|
@ -2,13 +2,17 @@
|
|||
|
||||
# A simple wrapper around maim
|
||||
#
|
||||
# When run, the screenshot will be added to she clipboard
|
||||
# When run, the screenshot will be added to the clipboard
|
||||
# The file path will be put in the primary selection
|
||||
# Will create notification containing file path
|
||||
#
|
||||
# If you have a project specified, it will put the sceenshot in that folder instead of /tmp
|
||||
|
||||
path='/tmp'
|
||||
command -v maim > /dev/null && screenshooter="maim" || screenshooter="scrot"
|
||||
command -v maim > /dev/null && screenshooter="maim" || ( echo -n "You need to install maim\nhttps://github.com/naelstrof/maim" && exit 1 )
|
||||
|
||||
#If a project is set we will put screenshots in the project's folder
|
||||
project=$(project current --path)
|
||||
command -v project > /dev/null && project=$(project current --path)
|
||||
if [ -n "$project" ]; then
|
||||
path="$project/screenshots"
|
||||
#Make the directory if it doesn't exist
|
||||
|
@ -31,6 +35,9 @@ case $1 in
|
|||
;;
|
||||
esac
|
||||
|
||||
# Copies the image to your clipboard (ctrl + v)
|
||||
xclip -selection clipboard -target image/png -i "$file"
|
||||
# Copies the filename to primary selection (shift + insert or middle mouse)
|
||||
echo -n "$file" | xclip -selection primary
|
||||
notify-send "New Screenshot" "$file"
|
||||
# Creates notification with file name
|
||||
command -v notify-send > /dev/null && notify-send "New Screenshot" "$file"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue