commit 4c508afeb6e6d847af6ebe5bcf43088314d09381 parent d6cd0c22335c360b1c51b9e96d8e6f741f298f71 Author: Taco-C <perian.forod@gmail.com> Date: Thu, 2 Jul 2020 00:06:14 +0200 Add wiktionaire Diffstat:
| A | wiktionaire | | | 13 | +++++++++++++ |
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/wiktionaire b/wiktionaire @@ -0,0 +1,13 @@ +#!/bin/sh + +wikt_dir="$XDG_DATA_HOME/wiktionaire" +wikt_hist="$wikt_dir/history" +[ ! -e "$wikt_dir" ] && mkdir -p $wikt_dir + +[ "$1" = "" ] && word="$(tac $wikt_hist | uniq | rofi -dmenu -theme sidebar -p "Søk på wiktionary:" | tee -a $wikt_hist)" +[ "$1" = "uib" ] && word="$(tac $wikt_hist | uniq | rofi -dmenu -theme sidebar -p "Søk i ordbøkene:" | tee -a $wikt_hist)" + +[ "$1" = "" ] && url="$(echo $word | sed 's/.*/https:\/\/en.wiktionary.org\/w\/index.php?search=\0/')" +[ "$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/')" + +[ "$word" != "" ] && surf "$url"