wiki.allensmith.net

Personal "Rough Notes & Useful Links

User Tools

Site Tools


kb:linux:lts14p04conkystartup

Xfce 4.10 Desktop & Toooo Many Conky

Summary of What Happened

Using the Xfce 4.10 Desktop that comes with Ubuntu Studio 14.04, if the “Save session for future logins” box was checked, this would not always load Conky on startup. And once Conky did not load, it then needed to be manually restarted. (Alt-F2 then type in the command Conky)

So a startup item was created ensure that Conky always started. (An entry for Conky was added to the “Application Autostart” list in “Session and Startup”.)

The problem is, this apparently then loaded an additional copy Conky each time the system was restarted – resulting in many running copies of the same Conky causing the system to seriously slow down. (High CPU usage at idle was a noticeable symptom of this.)

Even worse, it seem this behaviour may have continued to occur even with “Save session for future logins” unchecked! (Just killing all running Conky, then unchecking that did not solve the problem.)

Restoring the Desired "Single Conky" Desktop

First, STOP all those running Conky, and shut-down any other Desktop Application in the Autostart list.
  • Alt-F2 to bring up the “Application Finder” Window
    • Into that type the command “killall conky
  • Next “Quit” or “Exit” from any other Desktop Applications that are auto started in “Sessions and Startup”
Now Restart the system, saving this state where all the Desktop Applications that “Autostart” on login had been shut down, so that everything should now be running only once.
  • From the Applications Menu select “Log Out”
    • Now ensure “Save session for future logins” is CHECKED before doing a system Restart
Note: If doing the above did stop multiple Conky from running when logging in, that should result in lower CPU usage, when there is no noticeable Hard Drive usage or Network activity.

A Startup Script to Reliably Run Conky

The following terminal commands will create a Conky startup script that makes certain only a single instance of the desired Conky is running. … Ajust the below 5 second then 10 second delays as needed for your system.
mkdir ~/.conky    # create a hidden directory for conky
nano ~/.conky/conkystart.sh    # copy/past the following text into this empty file
#!/bin/bash
# Pause to let the system start
# Then stop any old conky processes that are still running
sleep 5 && killall conky
# Pause a little longer to maker certain the desktop is fully loaded
# Then start the desired conky
sleep 10 && conky -c ~/.conky/conkyrc_sys
chmod +x ~/.conky/conkystart.sh    # needed file permission to run this script
mv ~/.conkyrc ~/.conky/conkyrc_sys    # move existing .conkyrc file into .conky directory
If the desired Conky configuration file does not exist yet, then instead of using the above move command, that configuration should be saved as conkyrc_sys in the just created .conky directory. ( ~/.conky/conkyrc_sys )

Note: A period ( . ) at the beginning of a file or directory name creates a hidden file or directory. To view those using a file manager, the “show hidden files” option must be selected.
Finally, update the Autostart list to use the above Conky startup script, to ensure that only one instance of the desired Conky will be running.
  • “Applications Menu” » “Settings Manager” » “Session and Startup” » the “Application Autostart” tab
    • If there is an existing Startup item listed for Conky, then select and Remove that.
    • Add a Startup Item for Conky using the following information:
      • Name: Conky System Monitor
      • Command: /home/[user]/.conky/conkystart.sh ← Replace “[user]” with the login user name
kb/linux/lts14p04conkystartup.txt · Last modified: 2016/01/13 20:35 (external edit)