Hi, this is a follow-up to aussierod's great posts regarding transparency for Conky. This post shows another way I have found to deal with the transparency issue, and works well when you change the wallpaper/background a lot. Sorry in advance for the length, I have to talk it out or I doubt it would make sense, as I am not by any stretch a real programmer.
Back in the 3.x versions of puppy, I had read on this forum that the following lines in .xinitrc loaded Conky at startup and allowed transparency:
Code: Select all
qiv -z /root/Choices/ROX-background.jpg
conky -d &
It worked just fine.
When I changed to puppy 4.0, I noticed this no longer worked to achieve transparency. As WolfPup noted in an earlier post on the first page of this topic, qiv is not pre-installed on Puppy 4.x, but can be added via a .pet file.
I added qiv, but still didn't get transparency.
I then found that there was a new program in Puppy 4.x for changing the wallpaper/background under Menu>Desktop>Wallpaper setter. After some research I found that changing the wallpaper/background using this program does not affect /root/Choices/ROX-background.jpg as the previous wallpaper/background program had done. Further research found that the Wallpaper setter program writes the current wallpaper/background choice to the file /root/.config/tmp/bg_img.
Using this information, I changed the additional lines in .xinitrc to the following:
Code: Select all
qiv -z -F /root/.config/tmp/bg_img
conky -d &
After adding the two lines to .xinitrc and restarting X (Menu>Shutdown>Restart X server), I had transparency, finally.
The -z in the qiv line above stretches the image on the background. Qiv has the nice -F option that allows it to read file names from text in a file, thereby allowing it to read the current wallpaper/background image choice from the /root/.config/tmp/bg_img file. I was not able to find an equivalent for xli, which meant qiv was necessary to get this solution to work. So I kept the qiv line instead of using xli as is currently suggested towards the beginning of this topic.
If anyone knows how to have xli read text from the file /root/.config/tmp/bg_img, or if I am just totally confusing this, please let me know.
For those who don't know, to add the new lines to .xinitrc, open the program Geany (Menu>Document>Geany text editor), then use Geany to open the file /root/.xinitrc, and add the new lines above the line "#exec $CURRENTWM". Save the changed file as /root/.xinitrc, then restart X. You will have to add the qiv .pet if you have not already done so, this will need to be done before you restart X for the new lines to work properly. Keep in mind that restarting X will close any windows you may have open, so make sure you have saved anything important.
**************************
OK, so I had transparency. But I like to switch between backgrounds a lot, being a shutterbug with lots of pictures and what must be a mild form of background-viewing ADHD. I began to wonder if there was a better way to change the background and keep Conky in step than having to restart X each time. I did some more research on the Wallpaper setter program in Puppy 4.x, and came up with this solution.
The main work for the Wallpaper setter program appears to occur through the file /usr/local/apps/System/Wallpaper/AppRun. In the AppRun file I added three action lines to the "Apply" button for the Wallpaper setter program. The lines basically 1) stop any Conkys currently running, 2) start qiv with the newly chosen wallpaper/background and then 3) restart Conky. The three lines are similar to those posted earlier in this topic for another use under Puppy 3.x, as follows:
Code: Select all
<action>killall conky</action>
<action>qiv -z -F /root/.config/tmp/bg_img</action>
<action>conky</action>
The addition of these lines in the AppRun file goes under the actions for the Apply button in the Wallpaper setter program. The place is towards the bottom of the AppRun file directly after the program writes the wallpaper/background selection to /root/.config/tmp/bg_img, as follows:
Code: Select all
<button>
<label>Apply</label>
<input file stock=\"gtk-apply\"></input>
<action>$APPDIR/set_bg \"\$IMAGE\"</action>
<action>echo \"\$IMAGE\" > \$HOME/.config/tmp/bg_img</action>
<action>killall conky</action>
<action>qiv -z -F /root/.config/tmp/bg_img</action>
<action>conky</action>
<action type=\"refresh\">TEXT</action>
</button>
Before you add these lines, it would be good to backup the file /usr/local apps/System/Wallpaper/Apprun to something like ApprunOriginal just in case anything goes wrong. To add the new lines, open the program Geany (Menu>Document>Geany text editor), then use Geany to open the file /usr/local apps/System/Wallpaper/Apprun. Add the three new lines as shown above, then restart X (Menu>Shutdown>Restart X server).
Once you have restarted X, you should be able to go in to the Wallpaper setter program and change your wallpaper/background as often as desired, and Conky will re-load with the appropriate wallpaper/background in transparent mode each time. Or it should. I hope it does. Let me know if it doesn't. And remember, this should not be necessary unless you are using Puppy 4.x. Oh, and I haven't tried it on anything but 4.0, so bear that in mind. Yeah, backing up your files might not be a bad idea at all.
For all those I have confused terribly, or bored silly, my sincere apologies.