Can .lua be scripted to randomly select 1 image from a dir of several images? [SOLVED]

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.
User avatar
Koentje
Level 7
Level 7
Posts: 1581
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Can .lua be scripted to randomly select 1 image from a dir of several images?

Post by Koentje »

Can't help you with that.. it's a lua thing!

Code: Select all

if update_num>4 then
   fDrawImage(cr,'./image-out/image.png',150,132,300,263)
end
Go into pic.lua and find this part and change update_num to 1 and see if it works...
It waits 4 updates before it shows the picture. Changing it to 1 will show the picture faster, but can also endup in errors..
Image
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Can .lua be scripted to randomly select 1 image from a dir of several images?

Post by Logansfury »

Koentje wrote: Thu Feb 15, 2024 2:00 pm Can't help you with that.. it's a lua thing!

Code: Select all

if update_num>4 then
   fDrawImage(cr,'./image-out/image.png',150,132,300,263)
end
Go into pic.lua and find this part and change update_num to 1 and see if it works...
It waits 4 updates before it shows the picture. Changing it to 1 will show the picture faster, but can also endup in errors..
Edit done, the image clearly appears faster after the mp3 plays now, and no errors shown when launched in terminal. Hopefully Bleys takes an interest if this requires a massage of the .lua :)
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
Post Reply

Return to “Compiz, Conky, Docks & Widgets”