AutoHotkey Community

It is currently May 27th, 2012, 6:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Wallpaper Randomizer
PostPosted: July 5th, 2009, 11:55 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
Wallpaper Randomizer

Not sure if I ever posted the source for this script of mine.
In any case, a simple system tray Wallpaper Randomizer / Changer.

Source code and compiled executable are available here

First version of this script was created a while ago, and I am almost certain I posted it here some time ago, but I was unable to find it searching the forum.

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Last edited by Icarus on March 27th, 2011, 12:28 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: a new option
PostPosted: August 21st, 2009, 7:36 am 
Hi! I'd like to suggest the addition of a shortcut key that would delete the current wallpaper. This way one could easily get rid of a picture that is no more wanted.

Congratulations on the script!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 7:53 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
Any chance you can generate a multi-monitor image? I use (and pay for) DisplayFusion Pro to get both multi-moniter autoswitching with a different background on each screen.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 8:19 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
You mean, you point it to a folder of single monitor images and it stitches together several copies to make it a multi monitor wallpaper?

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 8:31 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Might not so easy, see http://www.maximumpc.com/article/how_to ... _wallpaper (via lifehacker)

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 8:50 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
@Icarus, exactly.

@HugoV. I've looked at teh format for bmp files, and it's relatively straightforward. Just need SKAN'S binary code and the ability to wrap your head around it (The hard part).

I was also thinking that my two screens don't have the same dpi, and it would be nice to correct for that as well (I have a lot of panos, that I want to also use)

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 8:55 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
Well,

In fact the AHK script is only handling the hotkey assignment and randomization.
Everything else I took out to a command line converter.

So, if there is any ready made AHK library or external command line that does that, please let me know - I will merge it in.

Personally, when I used dual or triple monitors, I downloaded dual/triple monitor wallpapers and used them... :)

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2009, 9:18 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
Those rarely fit my particular screen arrangement. They are nice if you have 2+ of the same screens.

I'm also a photographer, so I use my own pictures as the source images.

Maybe I'll tinker with this this weekend.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject: aspect ratio
PostPosted: September 10th, 2009, 1:27 am 
Wallpaper should preserve photo aspect ratio.
Is it possible somehow? Or should I crop all the pictures before use.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2009, 9:15 am 
Offline

Joined: March 19th, 2007, 5:12 pm
Posts: 29
I came here to find some suggestions on how to change my wallpaper with AHK, and find this wonderful script already written. Thanks!

I made one tweak to the script to make it slightly faster. Especially for people with a very large number of wallpaper images on their system. The randomizer you used depended on two arrays, a temporary array for the file names, and a final array that you moved the names into for randomizing. Every time you took a name from the temporary array, you had to reset a portion of the file names. In the worst case this ends up taking N-squared/2 moves. Meaning with a thousand images you could make millions of swaps.

With my code we use a single array and randomize it in place, swapping names as we go through the list once. The final result should be just as random, but take much less time.

Code:
ScanFiles:
  Loop %ImageDir%\*.*,0,1
  {
    SplitPath A_LoopFileLongPath,,, OutExtension
    If( OutExtension <> "bmp" and OutExtension <> "png" and OutExtension <> "jpg" and OutExtension <> "gif" )
      continue
    Counter++
    Image%Counter% := A_LoopFileLongPath
  }

  Random Seed, 0, 10000000
  Random ,,%Seed%

  Loop %Counter% {
    i := A_Index
    Random SelectedImageIndex , 1, %Counter%
    if ( i <> SelectedImageIndex )
    {
      TmpImage := Image%i%
      Image%i% := Image%SelectedImageIndex%
      Image%SelectedImageIndex% := TmpImage
    }
  }
 
  Menu, Tray, Tip, %NameString% %VersionString% - %Counter% Wallpapers Loaded
  FirstRun := false
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Wallpaper won't change
PostPosted: June 9th, 2010, 9:07 pm 
WR changes Wallpaper.bmp in the WR folder every n-minutes as expected, but doesn't display the new image on the desktop. Usually I'm just stuck with whatever image is chosen by WR at startup.

I'm using WinXP-SP1, WR folder is in Program Files, the wallpaper folder is set as \windows\web\wallpaper\rotate, and WR is set to run at startup.

What's keeping the new image from displaying? Shouldn't the desktop image change as soon as Wallpaper.bmp changes?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2010, 9:50 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
@TT1 - The line that changes the wallpaper is
Code:
DllCall( "SystemParametersInfo", UInt, 0x14, UInt, 0, Str, FinalPaper, UInt, 1 )

I do not know why it doesnt work for you

@wrecklass - is your solution still maintaining a fixed order, that can be navigated back and forth?

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Lower Time interval
PostPosted: March 27th, 2011, 11:06 am 
Minimum time interval to change image is 2 minutes which is too long. I would like to change wallpapers at custom intervals of say 25 seconds. Is it possible?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2011, 11:15 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
Open the INI file and add "0.4," at the beginning of the Intervals line.
Restart Wallpaper Randomizer.

There is a small bug in the menu with fractions, but it works.
I will fix the bug and release a new version.

[EDIT] Fixed and available for download on the site. Now comes with 0.5 minutes refresh interval by default, and you can change to any fraction in the INI file.

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group