-
-
Save sbucek/780486a080ebad2d9c9ea4117138656e to your computer and use it in GitHub Desktop.
Clipboard magic is a script which run bunch of clipboard related operation
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/sh | |
menu(){ | |
printf "1. [URL] Expecto Shorten πͺ: Get a shorten url\n" | |
printf "2. [URL] Lumbos dl πͺ: Download file in ~/dl\n" | |
printf "3. [URL] Avada Playdavra πͺ: Play videos in mpv\n" | |
printf "4. [URL] Listenmora πͺ: Play audio in mpv\n" | |
printf "5. [Image] Imagum Savum πͺ: Save clipbaord image in ~/pix/save\n" | |
printf "6. [Text] Sendkulus πͺ: Send clipboard text with tgsend script\n" | |
printf "7. [Shell] Executa πͺ: This will run any shell command\n" | |
printf "8. [Text] Sayee it πͺ: Clipboard text to speech with espeak\n" | |
printf "9. [Magnet] Torriento πͺ: Start downloading torrent from magnet\n" | |
} | |
spell_failed(){ | |
notify-send "Failed to cast spell" | |
} | |
choice=$(menu | dmenu -p "Clipboard spells πͺπ:" -i -l 20 | cut -d. -f1) | |
cbtext=$(xclip -o -selection clipboard) | |
paplay $HOME/.local/share/sounds/magic.ogg & | |
case $choice in | |
1) | |
output=$(curl -s -F"shorten=$cbtext" 0x0.st) | |
if [ "$output" = "Segmentation Fault" ]; then | |
spell_failed | |
else | |
echo "$output" | xclip -selection c | |
notify-send "Shorten Link is in Clipboard" | |
fi | |
break | |
;; | |
2) | |
wget -P ~/dl $cbtext && | |
notify-send "Downloading File" || | |
spell_failed | |
break | |
;; | |
3) | |
mpv "$cbtext" || spell_failed | |
break | |
;; | |
4) | |
mpv "$cbtext" || spell_failed | |
break | |
;; | |
5) | |
file=$(date +"%Y_%m_%d_%I_%M_%p") | |
xclip -selection clipboard -t image/png -o > $HOME/pix/save/$file.png || | |
spell_failed | |
break | |
;; | |
6) | |
user=$(echo "" | dmenu -p "Enter Username: ") | |
tgsend $user "$cbtext" | |
break | |
;; | |
7) | |
$cbtext || spell_failed | |
break | |
;; | |
8) | |
echo "$cbtext" | espeak -p 120 | |
break | |
;; | |
9) | |
notify-send "Haven't implemented this feature yet" | |
break | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment