utilies

A handful of (useful) scripts for unix-like systems
Log | Files | Refs | README | LICENSE

wiktionaire (674B)


      1 #!/bin/sh
      2 
      3 wikt_dir="$XDG_DATA_HOME/wiktionaire"
      4 wikt_hist="$wikt_dir/history"
      5 [ ! -e "$wikt_dir" ] && mkdir -p $wikt_dir
      6 
      7 [ "$1" = "" ]    && word="$(tac $wikt_hist | uniq | rofi -dmenu -theme sidebar -p "Søk på wiktionary:" | tee -a $wikt_hist)"
      8 [ "$1" = "uib" ] && word="$(tac $wikt_hist | uniq | rofi -dmenu -theme sidebar -p "Søk i ordbøkene:"   | tee -a $wikt_hist)"
      9 
     10 [ "$1" = "" ]    && url="$(echo $word | sed 's/.*/https:\/\/en.wiktionary.org\/w\/index.php?search=\0/')"
     11 [ "$1" = "uib" ] && url="$(echo $word | sed 's/.*/https:\/\/ordbok.uib.no\/perl\/ordbok.cgi?OPP=\0\&ant_bokmaal=5\&ant_nynorsk=5\&begge=+\&ordbok=begge/')"
     12 
     13 [ "$word" != "" ] && surf "$url"