Start/Stop Conky (en)

From Conky PitStop

Jump to: navigation, search

Start/Stop Conky

 Language   English   Français   


Please Note: I did NOT write this script as many people seem to think. I picked it up from the Ubuntu Forums somewhere and started calling my version ssc.sh, that’s all folks. So if you are referring to this scripts or sending someone here to get it, please don’t tell them I wrote it. I only “wish” I had! I just made the name “ssc.sh” popular. :D - Bruce

The ssc.sh ( Start Stop Conky ) script can be used for two functions:

  1. you can create a Desktop or Panel Launcher for it and/or;
  2. add it to your “AutoStart”

It is very handy on the Panel when you are editing conky, one click and conky is gone, wait a second and click again to see the changes you have made. I use the and part, I have a Panel Launcher (I use my avatar for it) and I’ve added it to my “AutoStart”.

Now most of you will not have one like mine, I’m running 4 conkys and have a test area, as I test things, and if you’ve see my Things: Edit Multiple Conkys you’ll see it’s the first thing opened in gedit when I’m editing/creating a conky file.

This is my ssc.sh

   #!/bin/sh
   # click to start, click to stop
    
   if pidof conky | grep [0-9] > /dev/null
   then
   exec killall conky
   else
   #sleep 3  # sleep not required for xfce on startup - 30 or more for others
   conky -c ~/Conky/conkymain &
   #sleep 3
   conky -c ~/Conky/conkytext &
   #sleep 3
   conky -c ~/Conky/conkyemail &
   #sleep 3
   conky -c ~/Conky/conkyforecast &
    
   # test conkys
   #sleep 3
   #conky -c ~/Conky/Test/bottom &
   #sleep 3
   #conky -c ~/Conky/Test/colours &
   #sleep 3
   #conky -c ~/Conky/Test/test &
   #sleep 3
   #conky -c ~/Conky/Test/test-2 &
   #sleep 3
   #conky -c ~/Conky/Test/test-3 &
   #sleep 3
   #conky -c ~/Conky/Test/basic_conky &
   #sleep 3
   #conky -c ~/Conky/Test/bruce &
   #sleep 3
   #conky -c ~/Conky/Test/text_bar &
   exit
   fi

Now there are some things you need to know:

  1. make it executable
  2. if using Xfce, or something lighter, I’d imagine, you do NOT need a sleep time
  3. if using Gnome or something that takes longer to load, you will need from 20 to 30 second sleep time to allow the desktop to get up and running before conky runs. Otherwise the desktop will hide conky.

To test conkys just comment out (#) the working conkys and uncomment the test conky you are working with, save it, and:

  1. Click – your conkys are off
  2. wait a second,
  3. Click – the test conky is on.

Now that is some smooth!

Happy conkying
Bruce

UPDATE!

Well, I just did a test and have to share the results

I just ran a test with my “ssc.sh” script using only the actual working part and not my test area as seen above

Notice that xfce doesn’t need a sleep time but I changed it to:

   #!/bin/sh
   # click to start, click to stop
    
   if pidof conky | grep [0-9] > /dev/null
   then
   exec killall conky
   else
    
   sleep 30  # sleep not required for xfce on startup - 30 or more for others
   conky -c ~/Conky/conkymain &
   sleep 30
   conky -c ~/Conky/conkytext &
   sleep 30
   conky -c ~/Conky/conkyemail &
   sleep 30
   conky -c ~/Conky/conkyforecast &
    
   exit
   fi

and the results were that it took 2 minutes for “conkyforecast” to show up on my screen. With the others showing up after 30 seconds, 1 minute and 1 minute and 30 seconds.

GREAT! It can be shortened to:

   #!/bin/sh
   # click to start, click to stop
    
   if pidof conky | grep [0-9] > /dev/null
   then
   exec killall conky
   else
    
   sleep 30  # sleep not required for xfce on startup - 30 or more for others
   conky -c ~/Conky/conkymain &
   conky -c ~/Conky/conkytext &
   conky -c ~/Conky/conkyemail &
   conky -c ~/Conky/conkyforecast &
    
   exit
   fi

I’ll leave that #sleep 30 line in there as I show this as an example every now and then. :)

So a shorter ssc.ch file. I like that!

Personal tools
Namespaces
Variants
Actions
Navigation
English
Français
Toolbox