AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wallpaper Randomizer

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Sun Jul 05, 2009 10:55 pm    Post subject: Wallpaper Randomizer Reply with quote

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 Sun Mar 27, 2011 11:28 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Grateful user
Guest





PostPosted: Fri Aug 21, 2009 6:36 am    Post subject: a new option Reply with quote

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!
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Fri Aug 21, 2009 6:53 am    Post subject: Reply with quote

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.
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Fri Aug 21, 2009 7:19 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Fri Aug 21, 2009 7:31 am    Post subject: Reply with quote

Might not so easy, see http://www.maximumpc.com/article/how_to_make_a_multi_monitor_compatible_wallpaper (via lifehacker)
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Fri Aug 21, 2009 7:50 am    Post subject: Reply with quote

@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)
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Fri Aug 21, 2009 7:55 am    Post subject: Reply with quote

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... Smile
_________________
Sector-Seven - Freeware tools built with AutoHotkey
Back to top
View user's profile Send private message Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Fri Aug 21, 2009 8:18 am    Post subject: Reply with quote

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.
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
rempallaan
Guest





PostPosted: Thu Sep 10, 2009 12:27 am    Post subject: aspect ratio Reply with quote

Wallpaper should preserve photo aspect ratio.
Is it possible somehow? Or should I crop all the pictures before use.
Back to top
wrecklass



Joined: 19 Mar 2007
Posts: 29

PostPosted: Fri Sep 25, 2009 8:15 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
TT1
Guest





PostPosted: Wed Jun 09, 2010 8:07 pm    Post subject: Wallpaper won't change Reply with quote

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?
Back to top
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Wed Jun 09, 2010 8:50 pm    Post subject: Reply with quote

@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
Back to top
View user's profile Send private message Visit poster's website
Azygos
Guest





PostPosted: Sun Mar 27, 2011 10:06 am    Post subject: Lower Time interval Reply with quote

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?
Back to top
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Sun Mar 27, 2011 10:15 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group