Commit e28b3a1
xxwhirlpool
·
2026-05-21 16:35:22 -0400 EDT
parent 9fab2bb
dmenu scripts
2 files changed,
+34,
-7
+32,
-6
1@@ -4,11 +4,37 @@
2 #
3 # https://github.com/BreadOnPenguins/scripts/blob/master/define_word
4
5-word=$(echo " " | dmenu -i -c -l 10 -p "dictionary!")
6+dict() {
7+ word=$(echo " " | dmenu -i -c -l 10 -p "dictionary!")
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 -r '[.[].meanings[] | {pos: .partOfSpeech, def: .definitions[].definition}] | .[:3].[] | "\n\(.pos). \(.def)"')
12+ if [[ -n "$word" ]]; then
13+ response=$(curl -s --connect-timeout 5 --max-time 10 "https://api.dictionaryapi.dev/api/v2/entries/en_US/$word")
14+ notif=$(echo "$response" | jq -r '[.[].meanings[] | {pos: .partOfSpeech, def: .definitions[].definition}] | .[:3].[] | "\n\(.pos). \(.def)"')
15+ notify-send -t 30000 "$word" "$notif"
16+ fi
17+}
18
19- notify-send -t 40000 "$word" "$notif"
20-fi
21+synonyms() {
22+ word=$(echo " " | dmenu -i -c -l 10 -p "get synonyms")
23+
24+ if [[ -n "$word" ]]; then
25+ response=$(curl -s --connect-timeout 5 --max-time 10 "https://api.dictionaryapi.dev/api/v2/entries/en_US/$word")
26+ notif=$(echo "$response" | jq -r '.[].meanings[].synonyms.[]')
27+
28+ if [[ "$notif" -eq 0 ]]; then
29+ notify-send -t 30000 "$word" "no synonyms found"
30+ else
31+ notify-send -t 30000 "$word" "$notif"
32+ fi
33+ fi
34+}
35+
36+menu() {
37+ cmd=$(printf "dictionary\\nsynonyms" | dmenu -i -c -l 10 -p "words!")
38+ case "$cmd" in
39+ dictionary) dict;;
40+ synonyms) synonyms;;
41+ esac
42+}
43+
44+menu
1@@ -1,10 +1,11 @@
2 #!/usr/bin/env bash
3
4 menu() {
5- cmd=$(printf "ftp\\nterminal" | dmenu -i -c -l 10 -p "split tunnel windows")
6+ cmd=$(printf "ftp\\nterminal\\nslsk" | dmenu -i -c -l 10 -p "split tunnel windows")
7 case "$cmd" in
8 ftp) mvpn filezilla;;
9 terminal) mvpn kitty;;
10+ slsk) mvpn "/home/kat/Downloads/Programs/slsk.sh";;
11 esac
12 }
13