From 86ce72d3f48d9a6cd6c96d132b812fd9cdf6f4f9 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Fri, 28 May 2021 02:57:30 +0200 Subject: [PATCH] conky_toggle --- bin/conky_toggle | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/conky_toggle diff --git a/bin/conky_toggle b/bin/conky_toggle new file mode 100755 index 0000000..0b7417d --- /dev/null +++ b/bin/conky_toggle @@ -0,0 +1,15 @@ +#!/bin/bash + +SESSIONFILE=$HOME/.config/conky/conky-sessionfile +while read -r line; do + THIS_CONKY=$(echo $line | awk '{print $3}') + CONKYRC=${THIS_CONKY//\'/} + + if ! pgrep -f "${CONKYRC//\~/}" + then + conky -c "${CONKYRC//\~/$HOME}" & + else + pkill -f "${CONKYRC//\~/}" + fi +done < $SESSIONFILE +exit 0