aboutsummaryrefslogtreecommitdiff
path: root/dmenuDic.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dmenuDic.sh')
-rwxr-xr-xdmenuDic.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/dmenuDic.sh b/dmenuDic.sh
index 586d0c5..0f25a80 100755
--- a/dmenuDic.sh
+++ b/dmenuDic.sh
@@ -1,8 +1,13 @@
#!/bin/sh
-# Selects a word from the system's dictionary with the help of dmenu and copies it to clipboard.
+# Selects a word from a dictionary with the help of dmenu and copies it to clipboard.
-word="$(dmenu -i -l 10 -p "Choose a word:" < /usr/share/dict/cracklib-small)"
+dict="$(printf "EN\nES" | dmenu -i -p "Choose a dictionary:")"
+if [ "$dict" = "EN" ]; then
+ word="$(dmenu -i -l 10 -p "Choose a word:" < /usr/share/dict/words.txt)"
+elif [ "$dict" = "ES" ]; then
+ word="$(dmenu -i -l 10 -p "Elige una palabra:" < /usr/share/dict/palabras.txt)"
+fi
[ "$word" ] || exit 0
echo "$word" | xsel -bi
dunstify -t 2000 "Written [$word] into clipboard."