wWebsites (458B)
1 #!/bin/bash 2 3 awk -F, '{ 4 if ($2 != "") { 5 print $2 6 } else { 7 print $1 8 } 9 }' $HOME/scripts/websites.csv | dmenu-mac -i -l 10 | while read selection; do 10 if [ -z "$selection" ]; then 11 exit 0 12 fi 13 awk -F, -v sel="$selection" ' 14 $2 == sel { print $1; found=1 } 15 $2 == "" && $1 == sel { print $1; found=1 } 16 END { if (!found) exit 1 } 17 ' $HOME/scripts/websites.csv | while read url; do 18 xdg-open "$url" >/dev/null 2>&1 & 19 done 20 done 21