[SOLVED] Question about conky photo setup

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mastery

[SOLVED] Question about conky photo setup

Post by mastery »

Having a problem getting a random photo into my Conky. I'm trying to use the random photo feature in conky-colors, but can't get anything to appear in the conky.

My conky code:

Code: Select all

${voffset 4}${font Droid Sans:style=Bold:size=8}PHOTO $stippled_hr${font}
${execi 240 ~/.conkycolors/bin/conkyPhotoRandom}${image /home/mastery/conky_photos/conkyPhoto.png -s 175x120 -p 4,10}
My conkyphotorandom code:

Code: Select all

#!/bin/bash
#
# Photo in conky
# by helmuthdu and paulvictor
source="/home/mastery/conky_photos/"
photo=/tmp/conkyPhoto.png
#choose your theme: 1,2 or 3
theme=1
I've got 4 photos to display being stored in home/mastery/conky_photos and I can't figure out what I'm doing wrong. I searched the Net, but not much info on this program. The thing that also confuses me is the "photo=/tmp/conkyPhoto.png" section above, since it's calling on a photo that I don't have any of my 4 named. I know I'm screwing something up, but my old mind can't figure out what I'm screwing up.

Anybody see something wrong with the above and can point me in the right direction? Thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mastery

Re: Question about conky photo setup

Post by mastery »

Anybody?
sgosnell

Re: Question about conky photo setup

Post by sgosnell »

Did you compile conky with imlib2 support? From what little I've read, that's required, and you need ver 1.7.1 or later. Is imlib2 installed on your system?

Running 'conky --version' on my system shows that I have 1.8 installed, and that it has imlib2 support present. I have to confess that I've never tried to use the photo features, so I'm not likely to be much help. I see more stuff in the version output that interests me, though, such as METAR weather info. I'm going to have to look into these features.
Missed
Level 2
Level 2
Posts: 74
Joined: Thu Sep 06, 2007 4:46 am
Location: New Zealand

Re: Question about conky photo setup

Post by Missed »

mastery wrote:

I've got 4 photos to display being stored in home/mastery/conky_photos and I can't figure out what I'm doing wrong. I searched the Net, but not much info on this program. The thing that also confuses me is the "photo=/tmp/conkyPhoto.png" section above, since it's calling on a photo that I don't have any of my 4 named. I know I'm screwing something up, but my old mind can't figure out what I'm screwing up.

Anybody see something wrong with the above and can point me in the right direction? Thanks!

Reading (and then re-reading!) your post, I think you have already answered your own question.

Try renaming one of your photos to conkyPhoto.png, or put the name of one of your photos in that line.
vrkalak

Re: Question about conky photo setup

Post by vrkalak »

Missed wrote:Try renaming one of your photos to conkyPhoto.png, or put the name of one of your photos in that line.
Agreed, you need to save the pic/image as a .photo.png file.

As such > ${image ~/.2164.png -p 65,270 -s 100x100}
mastery

Re: Question about conky photo setup

Post by mastery »

vrkalak wrote:
Missed wrote:Try renaming one of your photos to conkyPhoto.png, or put the name of one of your photos in that line.
Agreed, you need to save the pic/image as a .photo.png file.

As such > ${image ~/.2164.png -p 65,270 -s 100x100}
Ok, this is where I'm confused. I'm wanting to use conkyPhotoRandom, which will display random photos of pictures in a directory. I can rename one of the photos, but what do I name all the other pictures in the same folder?

sgosnell - it shows Imlib2 under the General section when I run the the version of conky.
sgosnell

Re: Question about conky photo setup

Post by sgosnell »

The photo capability should be there, then. About all I can suggest is to read the manual carefully. I've never tried to use any photo capabilities in conky.
mastery

Re: Question about conky photo setup

Post by mastery »

sgosnell wrote:The photo capability should be there, then. About all I can suggest is to read the manual carefully. I've never tried to use any photo capabilities in conky.
Just tested it, and was able to get one photo to display in conky when putting the name of the file specifically into the script. Now I just have to figure out how to get the "random" part to work.

Thanks for your help sgosnell, and you too vrkalak!
sgosnell

Re: Question about conky photo setup

Post by sgosnell »

Not much help from me, I just don't have much experience with conky. I used to play with it a little when I was running Crunchbang, but I haven't fooled with it in a long time.
Txnca

Re: Question about conky photo setup

Post by Txnca »

Not that I've used this feature in Conky either, but I'll bet almost anything that it is a wildcard that you put in there for the random file. something like *.png. That seems to be the way most of these scripts work that I've been looking at lately.
mastery

Re: Question about conky photo setup

Post by mastery »

Txnca wrote:Not that I've used this feature in Conky either, but I'll bet almost anything that it is a wildcard that you put in there for the random file. something like *.png. That seems to be the way most of these scripts work that I've been looking at lately.
I agree, it has to be some kind of wildcard to randomly go through all the PNG files in one folder. I tried *, but that didn't work. I'll take a look through the script that the .conkyrc pulls from and see if I can figure it out. Coding is my weakest computer knowledge ability, but I'll try :?

Edited to add: Looks like it's just pulling the one picture based off the IMAGE tag, and it's not running the program. Here's the code as it shows up in the conky if anybody can chime in:

Code: Select all

${execi 240 ~/.conkycolors/bin/conkyPhotoRandom}${image /home/mastery/Pictures/Conky/harley.png -s 220x150 -p 10,610}
So, apparently the program isn't configured right at all. So, back to square one. I had the image at /tmp/conkyPhoto.png as was originally listed in the code, but it didn't work at all. Guess I need a first-grade level of a walk through of getting this to work if anybody would be willing to walk me through the steps.
Txnca

Re: Question about conky photo setup

Post by Txnca »

Hey, I just found this which basically makes your picture truly random. I believe that is what the problem is. To make it truly random you have to call an outside script which this is. Here is what this person did to make it work. Here is link to this post on that other forum.

Code: Select all

i use a script to generate a random slideshow in my conky:

#! /bin/bash

line=$(($RANDOM%`ls /home/arp/images/conkypics | wc -l`))
line=$((line + 1)) 

ls /home/arp/conkypics | nl | while read a b
do
  [ "$a" = "$line" ] && { cp /home/arp/conkypics/"$b" /home/arp/.ckpict; }
done

exit 0

that i call in conky with

${execi 10 ~/scripts/conky-slideshow.sh}${image /home/arp/.ckpict -p 30,240}

You can change it to work with your directories and the way you want it to look, but this seems to be what you are looking for.
mastery

Re: Question about conky photo setup

Post by mastery »

Txnca wrote:
You can change it to work with your directories and the way you want it to look, but this seems to be what you are looking for.
I used the simple script you linked me to, and as usual, I can't get it to work after spending a couple of hours trying things this morning. Any chance you can tell me what I'm doing wrong? Here's all the pertinent information on what I'm working with:

I have 3 png pictures located here to display: /home/mastery/Pictures/Conky

Script is located here: /home/mastery/scripts/conky_slideshow.sh

.conkyrc code line:

Code: Select all

${execi 10 ~/scripts/conky_slideshow.sh}${image /home/mastery/.ckpict -s 180x120 -p 0,0}
script code:

Code: Select all

#! /bin/bash

line=$(($RANDOM%`ls /home/mastery/Pictures/Conky | wc -l`))
line=$((line + 1)) 

ls /home/mastery/Pictures/Conky | nl | while read a b
do
  [ "$a" = "$line" ] && { cp /home/mastery/Pictures/Conky/"$b" /home/mastery/.ckpict; }
done

exit 0
Txnca

Re: Question about conky photo setup

Post by Txnca »

mastery wrote:I have 3 png pictures located here to display: /home/mastery/Pictures/Conky

Script is located here: /home/mastery/scripts/conky_slideshow.sh

.conkyrc code line:

Code: Select all

${execi 10 ~/scripts/conky_slideshow.sh}${image /home/mastery/.ckpict -s 180x120 -p 0,0}
script code:

Code: Select all

#! /bin/bash

line=$(($RANDOM%`ls /home/mastery/Pictures/Conky | wc -l`))
line=$((line + 1)) 

ls /home/mastery/Pictures/Conky | nl | while read a b
do
  [ "$a" = "$line" ] && { cp /home/mastery/Pictures/Conky/"$b" /home/mastery/.ckpict; }
done

exit 0
The first thing I see that should be different is the very start of the script. From what I have read and done myself, the first part of the script should look like this.

Code: Select all

#!/bin/bash
No space after the "sha-bang"(#!).

Also, did you make your script executable? If not open a terminal and type this; (Make sure you are in the directory where the script file is.)

Code: Select all

chmod +x conky_slideshow.sh
Otherwise everything looks good from here. It is a very elegant script. Wish I had thought of it myself!

Anyway, do those things, then run it again. Hopefully it will work then!

OH! One more thing. You have your execi running at a very fast pace at 10, you might want to change that back to the 240 you had it at before. Of course it may work just fine at that pace. You just have to test it and see how fast you want it to change for you. 10 might be perfect or somewhere between 10 and 240 will be.
mastery

Re: Question about conky photo setup

Post by mastery »

Txnca wrote:
Anyway, do those things, then run it again. Hopefully it will work then!
Txnca....IT WORKS! Good catch on the typo at the beginning of the script, I completely missed it. Made the change, and it works like a dream now. I messed with this script and the last one I tried for hours trying to get something to work. Now that it works, I'm going to see what I can do to customize it a little bit more :lol:

Anyways, THANK YOU FOR YOUR HELP WITH THIS. MUCH APPRECIATED!
Txnca

Re: Question about conky photo setup

Post by Txnca »

mastery wrote:
Txnca wrote:THANK YOU FOR YOUR HELP WITH THIS. MUCH APPRECIATED!
You are very welcome! And I am glad I could help!
Locked

Return to “Compiz, Conky, Docks & Widgets”