Commit 122cc8d
chasinglightning
·
2025-07-24 14:29:08 -0400 EDT
parent 426393c
update dict again
1 files changed,
+3,
-1
+3,
-1
| ... | ... | @@ -8,5 +8,7 @@ word=$(echo " " | dmenu -i -c -l 10) | |
| 8 | 8 | ||
| 9 | 9 | if [ -n "$word" ]; then | |
| 10 | 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 | xclip -selection clipboard) | |
| 11 | + | notif=$(echo $response | jq -r '[.[].meanings[] | {pos: .partOfSpeech, def: .definitions[].definition}] | .[:3].[] | "\n\(.pos). \(.def)"') | |
| 12 | + | ||
| 13 | + | notify-send -t 40000 "$word" "$notif" | |
| 12 | 14 | fi |