dmenu_bookmarks.sh 840 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. dmenu_font="monospace:size=10"
  3. col_black="#000000"
  4. col_pink="#ff00f0"
  5. col_violet="#8f00ff"
  6. col_gray4="#eeeeee"
  7. #in=$(cat $HOME/Documentos/data/bookmarks | cut -d ',' -f 2 | dmenu -m 0 -fn ${dmenu_font} -nb ${col_black} -nf ${col_pink} -sb ${col_violet} -sf ${col_gray4} -l 5 -p bookmarks:) # dmenu input
  8. if [ "$1" = "work" ]; then
  9. file=$HOME/Sync/bookmarks_teco
  10. else
  11. file=$HOME/Sync/bookmarks
  12. fi
  13. in=$(cat $file | dmenu -m 0 -fn ${dmenu_font} -nb ${col_black} -nf ${col_pink} -sb ${col_violet} -sf ${col_gray4} -l 10 -p bookmarks:) # dmenu input
  14. match=$(cat $file | grep $in | cut -d ',' -f 2) # check match with ~/.bookmarks file
  15. if [ "$match" != "" ]; then
  16. echo "$match" | xclip -selection clipboard
  17. elif [ -n "$in" ]; then
  18. echo -n "https://search.disroot.org/search?q=$in" | xclip -selection clipboard
  19. fi