Last active
October 19, 2021 07:11
-
-
Save brandon-lockaby/d03df1aa5f951feec9da54be9e1831d2 to your computer and use it in GitHub Desktop.
screenshot/clipboard hotkey scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
now=$(date +"%Y %m-%d %T ns%N") | |
xclip -selection clipboard -t TARGETS -o | (while IFS= read -r line; do | |
echo $line | |
if [[ $line = image/* ]] | |
then | |
notify-send "Opening ${line} with feh" -a "(•ิ_•ิ)?" -t 2000 | |
xclip -selection clipboard -t image/png -o | feh - | |
break | |
fi | |
if [[ $line = text/* ]] | |
then | |
notify-send "Opening ${line} with code" -a "(•ิ_•ิ)?" -t 2000 | |
xclip -selection clipboard -t text/plain -o | code - | |
break | |
fi | |
if [[ $line = video/* ]] | |
then | |
notify-send "Opening ${line} with vlc" -a "(•ิ_•ิ)?" -t 2000 | |
xclip -selection clipboard -t text/plain -o | vlc - | |
break | |
fi | |
done ) | |
echo "and that's all" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
maim -s | xclip -selection clipboard -t image/png | |
notify-send "Region to clipboard" -a "📋️" -t 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xclip -selection clipboard -t TARGETS -o | grep -i 'image/png' &> /dev/null | |
if [ $? == 0 ] | |
then | |
now=$(date +"%Y %m-%d %T ns%N") | |
filename="${now}.png" | |
path="/mnt/tera/pictures/${filename}" | |
echo "saving ${path}" | |
xclip -selection clipboard -t image/png -o > "$path" | |
notify-send "saved $filename" -a "◎ヽ(^・ω・^=)~" -t 5000 | |
else | |
echo "No image/png target" | |
notify-send "No image/png target" -a "(•ิ_•ิ)?" -t 2000 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
maim | xclip -selection clipboard -t image/png | |
notify-send "Screenshot to clipboard" -a "📋️" -t 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
now=$(date +"%Y %m-%d %T ns%N") | |
echo "$now" | xclip -selection c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png | |
notify-send "Window to clipboard" -a "📋️" -t 1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment