aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-04-20 15:27:06 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2019-04-20 15:27:29 +0200
commitb2bdbb94e5171133853e80de6af5b6605477ce4c (patch)
treed282a214e3b9248c3a38f4a8ad7d9abf43f23bf8
parent6844394d4e77bf13b7662c8129cb6b37fbbdd56f (diff)
downloadscripts-b2bdbb94e5171133853e80de6af5b6605477ce4c.tar.gz
scripts-b2bdbb94e5171133853e80de6af5b6605477ce4c.zip
Added Spanish dictionary.
-rwxr-xr-xdmenuDic.sh9
-rwxr-xr-xfzfdic.sh7
2 files changed, 13 insertions, 3 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."
diff --git a/fzfdic.sh b/fzfdic.sh
index 5b46efb..0cd457d 100755
--- a/fzfdic.sh
+++ b/fzfdic.sh
@@ -1,3 +1,8 @@
#!/bin/sh
-cat /usr/share/dict/cracklib-small | fzf -e
+dict="$(printf "EN\nES" | fzf -e --prompt="Choose a dictionary>")"
+if [ "$dict" = "EN" ]; then
+ fzf -e --prompt="EN" < /usr/share/dict/words.txt
+elif [ "$dict" = "ES" ]; then
+ fzf -e --prompt="ES" < /usr/share/dict/palabras.txt
+fi