scripts

Scripts for general automations
git clone git://git.laack.co/scripts.git
Log | Files | Refs

add-bookmark.sh (386B)


      1 #!/bin/bash
      2 
      3 out=$(xclip -o -sel clip)
      4 
      5 selection=$(echo -e "Yes\nNo" | dmenu -l 15 -i -p "save $out:")
      6 
      7 if [ $selection != "Yes" ]; then
      8 	exit 0
      9 fi
     10 
     11 if [ -z $selection ]; then
     12 	exit 0
     13 fi
     14 
     15 file=$HOME/bookmarks/marks.txt
     16 
     17 
     18 if [ -n "$out" ]; then
     19 	echo $out >> $file
     20 	notify-send -t 3000 "Bookmark $out saved $selection"
     21 else
     22 	notify-send -u critical -t 3000 "ERROR - Clipboard Empty"
     23 fi