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 @@ | |
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | 3 | kr() { | |
| 4 | - | unzip -O CP932 $1 | |
| 4 | + | fnpick=$(gum input --placeholder "file name") | |
| 5 | + | unzip -O CP932 $fnpick | |
| 5 | 6 | } | |
| 6 | 7 | ||
| 7 | 8 | jp() { | |
| 8 | - | unzip -O CP932 $1 | |
| 9 | + | fnpick=$(gum input --placeholder "file name") | |
| 10 | + | unzip -O CP932 $fnpick | |
| 9 | 11 | } | |
| 10 | 12 | ||
| 11 | 13 | choice() { | |
| 12 | 14 | choose=$(gum choose "JP" "KR") | |
| 13 | 15 | case "$choose" in | |
| 14 | - | *JP) jp ;; | |
| 15 | - | *KR) kr ;; | |
| 16 | + | *JP) jp;; | |
| 17 | + | *KR) kr;; | |
| 16 | 18 | *) exit;; | |
| 17 | 19 | esac | |
| 18 | 20 | } |