dots


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