mabox-tools/bin/conky_toggle

18 lines
398 B
Plaintext
Raw Normal View History

2021-05-28 02:57:30 +02:00
#!/bin/bash
SESSIONFILE=$HOME/.config/conky/conky-sessionfile
while read -r line; do
2021-06-01 17:36:15 +02:00
if [[ $line == *conky* ]]; then
2021-06-01 16:48:57 +02:00
THIS_CONKY=$(echo "${line##+([[:space:]])}" | awk '{print $3}')
2021-05-28 02:57:30 +02:00
CONKYRC=${THIS_CONKY//\'/}
if ! pgrep -f "${CONKYRC//\~/}"
then
conky -c "${CONKYRC//\~/$HOME}" &
else
pkill -f "${CONKYRC//\~/}"
fi
2021-06-01 17:36:15 +02:00
fi
2021-05-28 02:57:30 +02:00
done < $SESSIONFILE
exit 0