It is currently March 28th, 2024, 11:12 pm

Remove update / Point to directory

Get help with creating, editing & fixing problems with skins
firewater
Posts: 10
Joined: November 25th, 2013, 2:43 am

Remove update / Point to directory

Post by firewater »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
RightMouseDownAction=!execute ["LiteStep Menu.ahk"]
LeftMouseDoubleClickAction=[!Refresh]

[MeasureWallpaper]
Measure=Plugin
Plugin=QuotePlugin
PathName=C:\Users\Cristian\Documents\Visual\Wallpaper
FileFilter=*.jpg;*.gif;*.bmp;*.png
UpdateDivider=10000

[MeterShowPicture]
Meter=Image
MeasureName=MeasureWallpaper
PreserveAspectRatio=2
X=0
Y=0
I'm new to Rainmeter. Made a skin that changes the wallpaper since right click > set as background isn't working for me. Two problems, though:

1. The wallpaper auto-aupdates, but I want it to update only when I double left click. Currently it updates after some hours, and I don't know what to put on the Update=1000/UpdateDivider=10000 variables to make it never change, unless I click. Erasing them makes the wallpaper image change every second.

2. I want that, when pressing right click, an .ahk menu is opened. That's on this line:

Code: Select all

RightMouseDownAction=!execute ["LiteStep Menu.ahk"]
. It works if I put the complete directory (C:\Users\Cristian\etc...), but for portability I would prefer not so specify a full directory, so I put the .ahk file in the same menu as the .ini skin, but I can't find a way to point to it...

One last thing, when the .ahk file is opened, the mouse puts on the loading icon for a second, is there any way to change this so it doesn't load any icon or is that just inherent to the !execute bang? All the .ahk file does is it sends the Windows hotkey, so if there was a way to call hotkeys from Rainmeter that probably would fix it...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Remove update / Point to directory

Post by jsmorley »

You might want to consider the !SetWallpaper bang to set the wallpaper.

Something like:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureWallpaper]
Measure=Plugin
Plugin=QuotePlugin
PathName=%USERPROFILE%\Documents\Visual\Wallpaper
FileFilter=*.jpg;*.gif;*.bmp;*.png
UpdateDivider=-1

[MeterChangeWallpaper]
Meter=String
FontSize=15
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Change Wallpaper
LeftMouseUpAction=[!UpdateMeasure MeasureWallpaper][!SetWallpaper "[MeasureWallpaper]" "Fill"]
As far as the AutoHotKey script (assuming you still need it), you can call it with this if it is in the same path as the skin .ini file:

Code: Select all

RightMouseDownAction=["#CURRENTPATH#LiteStep Menu.ahk"]
http://docs.rainmeter.net/manual/variables/built-in-variables

As to the "loading icon" you mention, I assume you mean that the cursor changes to the "busy" cursor for a second when AutoHotKey is executed. That you can't avoid when you are executing an external application.

P.S. Don't use !Execute at all. It isn't needed, and I will make fun of you every time you use it... ;-)

http://docs.rainmeter.net/manual/bangs#Execute
firewater
Posts: 10
Joined: November 25th, 2013, 2:43 am

Re: Remove update / Point to directory

Post by firewater »

Thank you! The .ahk part is fixed now. Oh well if you can't change the cursor that's alright, it's just a brief second.

Well, I tried !SetWallpaper and it didn't work. Not a surprise because I'm running LiteStep on Windows 8 and there is a known bug with the old xmodules not rendering the wallpaper properly, so I had to make this skin instead, and it works great for the most part. I see your example has an UpdateDivider value of -1, would that make it stay there until I click on it?

Also wanted to ask if there is any simple way to add some option to drag a file into the Rainmeter skin so it pics it up and displays it as the wallpaper? Currently it loads a random image from the folder so I gotta click many times until I get the one I want.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Remove update / Point to directory

Post by jsmorley »

firewater wrote:Thank you! The .ahk part is fixed now. Oh well if you can't change the cursor that's alright, it's just a brief second.

Well, I tried !SetWallpaper and it didn't work. Not a surprise because I'm running LiteStep on Windows 8 and there is a known bug with the old xmodules not rendering the wallpaper properly, so I had to make this skin instead, and it works great for the most part. I see your example has an UpdateDivider value of -1, would that make it stay there until I click on it?

Also wanted to ask if there is any simple way to add some option to drag a file into the Rainmeter skin so it pics it up and displays it as the wallpaper? Currently it loads a random image from the folder so I gotta click many times until I get the one I want.
Yes, UpdateDivider=-1 means "update once when the skin is loaded, and then never again". So it will patiently wait for you to manually update it with the mouse action.

As to "drag and drop", that is just not supported at all in Rainmeter.
firewater
Posts: 10
Joined: November 25th, 2013, 2:43 am

Re: Remove update / Point to directory

Post by firewater »

Alright, so is there any way I can "select" what background I'm gonna have without having to type it into the .ini? Maybe bring up some sort of box with MiddleMouseDownAction that let's me write the name of the file?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Remove update / Point to directory

Post by jsmorley »

firewater wrote:Alright, so is there any way I can "select" what background I'm gonna have without having to type it into the .ini? Maybe bring up some sort of box with MiddleMouseDownAction that let's me write the name of the file?
Sure, you could do something like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Name=""

[MeasureImage]
Measure=Plugin
Plugin=QuotePlugin
PathName=%USERPROFILE%\Documents\Visual\Wallpaper
FileFilter=*#Name#*.jpg;*#Name#*.gif;*#Name#*.bmp;*#Name#*.png
DynamicVariables=1
UpdateDivider=-1

[MeterImage]
Meter=Image
MeasureName=MeasureImage
W=400
PreserveAspectRatio=2
LeftMouseUpAction=[!UpdateMeasure MeasureImage][!UpdateMeter *][!Redraw]
MiddleMouseUpAction=[!CommandMeasure "MeasureSearchInput" "ExecuteBatch 1"]

[MeasureSearchInput]
Measure=Plugin
Plugin=InputText
X=20
Y=20
W=200
H=22
SolidColor=47,47,47,255
FontColor=200,200,200,255
FontSize=13
AntiAlias=1
FocusDismiss=1
DefaultValue=#Name#
UpdateDivider=-1
DynamicVariables=1
Command1=[!SetVariable Name "$UserInput$"][!UpdateMeasure MeasureImage][!UpdateMeter *][!Redraw]
http://docs.rainmeter.net/manual/plugins/inputtext
http://rainmeter.net/forum/viewtopic.php?f=15&t=18060

That will allow you to enter a search term, which can be a full file name (less the extension) or just a part of a file name. It will restrict the Quote plugin to files matching that term. If no match is found, the current image will be kept. Entering nothing in the search, just hitting Enter, will remove any search and reset it to "all".
1.jpg
Understand that the Quote plugin is "random", but random in the sense of a pair of dice. There is nothing that stops it from randomly picking the same thing twice in a row, any more than it is impossible to roll 7 twice in a row with a pair of dice. My point is that if your search limits the files it will choose from to 2, it won't be that it rotates between those two on each click, but will randomly choose one of the 2 each time. Obviously, if your search is exact enough, this won't matter.
You do not have the required permissions to view the files attached to this post.
firewater
Posts: 10
Joined: November 25th, 2013, 2:43 am

Re: Remove update / Point to directory

Post by firewater »

Man this is great!! I like it more than the default Windows method now! I have no more questions, thanks a ton!!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Remove update / Point to directory

Post by jsmorley »

Glad to help.
firewater
Posts: 10
Joined: November 25th, 2013, 2:43 am

Re: Remove update / Point to directory

Post by firewater »

Been using this great skin for a year now, with almost no changes nor inconveniences. However, it has occurred to me now that since I frequently test new wallpapers, and then delete them when I see I don't like them much, it would be really convenient to be able to delete the image being used directly from the skin.

That is to say, how do I make it so that by pressing "Alt+D+Left click" on the skin, it removes the file currently set as the image, and then refreshes the theme with a new image?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Remove update / Point to directory

Post by jsmorley »

firewater wrote:Been using this great skin for a year now, with almost no changes nor inconveniences. However, it has occurred to me now that since I frequently test new wallpapers, and then delete them when I see I don't like them much, it would be really convenient to be able to delete the image being used directly from the skin.

That is to say, how do I make it so that by pressing "Alt+D+Left click" on the skin, it removes the file currently set as the image, and then refreshes the theme with a new image?
You really can't. Rainmeter does not respond to keystrokes. It also has no native ability to delete files.

While there is no doubt some Rube Goldberg we could do with AutoHotKey and RunCommand, I think this is just not something I would get into. Too much of a kludge and I'm not really happy with having Rainmeter do file deleting, it's just not what it is designed for.