Commit e8fa3a0

chasinglightning  ·  2025-07-24 08:01:56 -0400 EDT
parent 38f4ef6
extlan update, add dmenu dict script
2 files changed,  +20, -4
+14, -0
......@@ -0,0 +1,14 @@
1+#!/bin/bash
2+#
3+# https://github.com/aryuuu/dmenu-dict/blob/main/dmenu-dict
4+#
5+# https://github.com/BreadOnPenguins/scripts/blob/master/define_word
6+
7+word=$(echo " " | dmenu -i -c -l 10)
8+
9+if [ -n "$word" ]; then
10+ response=$(curl -s --connect-timeout 5 --max-time 10 "https://api.dictionaryapi.dev/api/v2/entries/en_US/$word")
11+ notif=$(echo $response | jq '.[]? | .meanings[]? | ["("+.partOfSpeech+") ", .definitions[]?.definition] | join(", ")' | dmenu -i -c -l 10)
12+fi
13+
14+notif=$(echo $notif | sed -e $'s/\.,/\\n -/g')
+6, -4
......@@ -1,18 +1,20 @@
11 #!/bin/bash
22
33 kr() {
4- unzip -O CP932 $1
4+ fnpick=$(gum input --placeholder "file name")
5+ unzip -O CP932 $fnpick
56 }
67
78 jp() {
8- unzip -O CP932 $1
9+ fnpick=$(gum input --placeholder "file name")
10+ unzip -O CP932 $fnpick
911 }
1012
1113 choice() {
1214 choose=$(gum choose "JP" "KR")
1315 case "$choose" in
14- *JP) jp ;;
15- *KR) kr ;;
16+ *JP) jp;;
17+ *KR) kr;;
1618 *) exit;;
1719 esac
1820 }