It is currently March 28th, 2024, 3:47 pm

Refresh Rainmeter for resolution change

Share and get help with Plugins and Addons
Post Reply
enneract
Posts: 2
Joined: February 24th, 2010, 2:18 am

Refresh Rainmeter for resolution change

Post by enneract »

I use a tablet, and was constantly frustrated by the lack of the ability for rainmeter to detect when resolution was changed (in my case, going to portrait mode). This often resulted in the malformation of my desktop config.

Anyway, I solved this issue today, by rewriting my config settings using dynamic locations (relative to desktop edges), and writing a small autoit script to detect when the desktop resolution changes and passing a refresh bang to rainmeter.

Below is the source, attached is the compiled version (scan with whatever you want. I think autoit sometimes comes up with false positives, *shrug*, that is while I supply the source). I found a 1s sleep period to be optimal for responsiveness while not destroying cpu cycles, but YMMV.

Hope someone else finds this useful.

Code: Select all

#NoTrayIcon
$state = @DesktopHeight
$cmd   = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Rainmeter", "") & "\Rainmeter.exe !RainmeterRefresh"

Do
	If @DesktopHeight  < $state OR @DesktopHeight > $state Then
		$state = @DesktopHeight
		RunWait ($cmd)
	EndIf
	Sleep(1000)
Until $state > 9000
Attachments
RainmeterRefresh.7z
compiled exe
(277.45 KiB) Downloaded 273 times
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Refresh Rainmeter for resolution change

Post by jsmorley »

Thanks. A bit like this: http://rainmeter.net/forum/viewtopic.php?f=18&t=809&hilit=rainrez

In mine I just use:

$OldWidth = @DesktopWidth
$OldHeight = @DesktopHeight

Sleep(2000)

$CurrentWidth = @DesktopWidth
$CurrentHeight = @DesktopHeight

If $CurrentWidth <> $OldWidth or $CurrentHeight <> $OldHeight Then

Then just carry on with the appropriate actions. Seems to always work for me.
enneract
Posts: 2
Joined: February 24th, 2010, 2:18 am

Re: Refresh Rainmeter for resolution change

Post by enneract »

I saw that. However, ID10T error got me and I read it as only passing the right theme to rainmeter at startup.

Yours looks to be better, lol :D
Post Reply