Conky toggle script

I like to keep my desktop uncluttered and I really like the way gkrellm docks to the side. I also use several conky instances and they take a considerable amount of desktop real estate so I wrote this little script to toggle them on and off.

#!/usr/bin/env bash

SESSIONFILE=$HOME/.config/conky/conky-sessionfile
while read -r line; do
    THIS_CONKY=$(echo $line | awk -F"'" '{print $2}')
    if ! pgrep -f $THIS_CONKY
    then
        conky -c $THIS_CONKY &
    else
        pkill -f "$THIS_CONKY"
    fi
done < $SESSIONFILE   

The conkys are those added using the Mabox control centre and are saved in the file referenced in the script.

2 Likes

Hi @piquet ,
Thanks for sharing :slight_smile:
This script is a little gem.
It’s a very nice addition to Mabox, and I think it should be there by default.
I would love to add it with your permission.
I just need to tweak jgconky-pipemenu a bit, and think about the keyboard shortcut.
How do you use this script?

Please use it if you think it is useful.
I use this in ~/.config/openbox/rx.xml:

    <keybind key="W-A-c">
      <action name="Execute">
        <command>bin/conky_toggle.sh</command>
      </action>
    </keybind>

The keybinding is arbitrary but it suits me. :+1:

Thanks for all that you are doing, please keep it up.

1 Like

Included in latest update. Binded to W-A-c.
I modified it a little bit.
Thanks :slight_smile:
See: 28.05.2021 - mb-reset compare-mode, mbhelper and conky_toggle