Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
536 B

4 years ago
4 years ago
4 years ago
  1. #!/bin/sh
  2. # requires xclip youtube-dl dunstify
  3. msgId="9910048"
  4. linkk="$(xclip -o -selection primary)"
  5. download(){
  6. dunstify "Started downloading $linkk" -a "Youtube Downloader" -u low -r "$msgId"
  7. youtube-dl --extract-audio --audio-format vorbis -o '$HOME/Music/nixos/\%(title)s.%(ext)s' $linkk
  8. dunstify "FINISHED downloading $linkk" -a "Youtube Downloader" -u low -r "$msgId"
  9. }
  10. echo "$linkk"
  11. case "$linkk" in
  12. *youtube.com*) download;;
  13. *) dunstify "ERROR!!! ${linkk} is not a valid youtube url" -u critical;;
  14. esac