shell-utils/app/def

19 lines
533 B
Plaintext
Raw Permalink Normal View History

2023-07-15 19:21:25 +00:00
#!/usr/bin/env bash
dict -h localhost -d gcide "$@" > /home/gmgauthier/.local/tmp/"${1}".txt 2>&1
content=$(cat /home/gmgauthier/.local/tmp/"${1}".txt);
if [[ "${content}" == *"No definitions found"* ]]; then
icon="/home/gmgauthier/.local/bin/img/caution-48.png"
else
icon="/home/gmgauthier/.local/bin/img/checkmark-32.png"
fi
zenity --text-info \
--window-icon="${icon}" \
--filename=/home/gmgauthier/.local/tmp/"${1}".txt \
--font="IBM Plex Mono Medium 11" \
--width=750 \
--height=600 2> /dev/null