shell-utils/app/def
2023-07-15 20:21:25 +01:00

19 lines
533 B
Bash
Executable File

#!/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