I found very good Pinterest pictures which I want to randomly show on my desktop. I already have a script(s) that randomly call conky configs from a directory. (Then I manually make bash scripts that call from 1 to 3+ conkies at a time)
Tried to do some python scripting but it didn't... I over complicated it. Here's the GIT FILES:
I was planning to show my code but it's too big and messy.
Originally I just read all the images and their Width, Height, Path and File name to separate txt files. Like width.txt, path.txt,etc. Looked like these (These is the Path.txt):
/home/omarali/scripts/conky/conky-sets/images/record.jpg
/home/omarali/scripts/conky/conky-sets/images/subtle.jpg
/home/omarali/scripts/conky/conky-sets/images/trust.jpg
Then I had a python script to convert the data to arrays and then build files one by one. Somehow I got syntax errors and etc. I didn't include the code here since it's too long and I'm considering to start from scratch.
Essentially I would make a new file that has the same name as the image then replace below config variables (WIDTH,HEIGHT,etc) with the images size and path.
The template Conky config:
conky.config = {
--Various settings
double_buffer = true, -- eliminates flicker
--Windows
own_window = true, -- create your own window to draw
own_window_argb_visual = true, -- use ARGB
own_window_type = 'override', -- keeps the image in the back
--Placement
alignment = 'middle_middle', -- position of the conky
--#########################################################################################
--######################## THE IMPORTANT CHANGABLE STUFF #######################
--#########################################################################################
minimum_width = WIDTH, -- minimum height of window
minimum_height = HEIGHT, -- minimum height of window
};
conky.text = [[
${image PATH -s SIZE}
]];
- WIDTH: width of the image
- HEIGHT: height of the image
- PATH: path to the image
- SIZE: width + "x" + height of the image
This is the final result of the conky config.
conky.config = {
minimum_width = 800, -- minimum height of window
minimum_height = 1300, -- minimum height of window
};
conky.text = [[
${image /home/omarali/scripts/conky/conky-sets/images/record.jpg -s 800x1300}
]];
So, Just need a simple way to put the images into a conkies that I can later call from a bash script. Python or Bash script will do.
Here what I'm looking for:
- Build a conky config from each image in a directory. let's say dir_pins
- Each conky should have the same name as the image. (this was my issue)
- Can be python or bash script, open to ideas but prefer these 2.
That's it, as mentioned before I already have a script to auto run my configs. Really appreciate your help. And open to new ideas.