It is currently February 22nd, 2020, 7:21 am

Lano Visualizer - computer can't auto-sleep

Help with creating, editing & fixing problems with skins
valentine1
Posts: 11
Joined: May 29th, 2012, 10:54 pm

Re: Lano Visualizer - computer can't auto-sleep

Post by valentine1 »

balala wrote:This command will sleep the computer only if you've disabled the hibernation. Otherwise it will hibernate it.
An alternative way, which is always working, would be to use the NirCmd little app, available here. If you want to try it, download it and use a this kind of command: IfAboveAction=["#@#nircmd.exe" "standby"] (obviously you have to copy the downloaded nircmd.exe into the @Resources folder).
fonpaolo wrote:I can suggest you to use NirCmd, then you don't have to worry if hibernation is enabled or not, choose to enable NirCmd to put your computer to sleep and also use hibernate when you need it.

As a side note, there is a version for 32 and a 64 bit of this program.
Brilliant. Well then I'd say that my request for help has resulted in a resounding success!

Thank you all for your help, what a fantastic community :)
User avatar
balala
Rainmeter Sage
Posts: 9741
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Lano Visualizer - computer can't auto-sleep

Post by balala »

valentine1 wrote:Brilliant. Well then I'd say that my request for help has resulted in a resounding success!
I'm glad.
valentine1 wrote:Thank you all for your help, what a fantastic community :)
You're right, it's indeed a fantastic community!
rainnoob
Posts: 7
Joined: January 3rd, 2020, 7:11 pm

Re: Lano Visualizer - computer can't auto-sleep

Post by rainnoob »

this code doesn't work for me. I'm new to the whole rainmeter community, so i dont know how to implement it. Would you mind pointing me in the right direction on what to do? What do I need to use for the plugin, because the NowPlaying is outdated.
User avatar
balala
Rainmeter Sage
Posts: 9741
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Lano Visualizer - computer can't auto-sleep

Post by balala »

rainnoob wrote:
January 3rd, 2020, 7:33 pm
this code doesn't work for me. I'm new to the whole rainmeter community, so i dont know how to implement it. Would you mind pointing me in the right direction on what to do?
Which code doesn't work for you anymore? This topic is more than four years old, so it's extremely old, I definitely don't have the code which doesn't work for you, so you should post it please.
rainnoob wrote:
January 3rd, 2020, 7:33 pm
What do I need to use for the plugin, because the NowPlaying is outdated.
NowPlaying is definitely NOT outdated, just it's not anymore a plugin, but an internal measure.
rainnoob
Posts: 7
Joined: January 3rd, 2020, 7:11 pm

Re: Lano Visualizer - computer can't auto-sleep

Post by rainnoob »

ok. thanks for letting me know about the internal measure. I will need to research it more to understand it.
rainnoob
Posts: 7
Joined: January 3rd, 2020, 7:11 pm

Re: Lano Visualizer - computer can't auto-sleep

Post by rainnoob »

i changed the playername to windows media player and the config to the monstercat-visualizer\Song Information.
What I did is made a new skin and put this code in there and then loaded it.
User avatar
balala
Rainmeter Sage
Posts: 9741
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Lano Visualizer - computer can't auto-sleep

Post by balala »

rainnoob wrote:
January 3rd, 2020, 8:59 pm
i changed the playername to windows media player and the config to the monstercat-visualizer\Song Information.
To use Windows Media Player with NowPlaying measures you have to use the PlayerName=WMP option into the parent NowPlaying measure. Set it this way to get the measure working.
Does it work now?
rainnoob
Posts: 7
Joined: January 3rd, 2020, 7:11 pm

Re: Lano Visualizer - computer can't auto-sleep

Post by rainnoob »

balala wrote:
January 3rd, 2020, 9:04 pm
To use Windows Media Player with NowPlaying measures you have to use the PlayerName=WMP option into the parent NowPlaying measure. Set it this way to get the measure working.
Does it work now?

Code: Select all

[Rainmeter]
Update=1000

[UnloadIfNotPlaying]
Measure=NowPlaying.dll
PlayerName=WMP
PlayerType=STATUS
IfMatch=0
IfMatchAction=[!DeactivateConfig "monstercat-visualizer\Song Information"]
IfNotMatchAction=[!ActivateConfig "monstercat-visualizer\Song Information"]

[RequiredMeter]
Meter=String
Disabled=1
Text=""
This is correct, right?
I set my sleep to 1 minute for testing and nothing happened.
Last edited by balala on January 3rd, 2020, 9:18 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting code snippets, not <Snippet>. It's the </> button.
rainnoob
Posts: 7
Joined: January 3rd, 2020, 7:11 pm

Re: Lano Visualizer - computer can't auto-sleep

Post by rainnoob »

ok, my bad. I will use the code from now on. It didn't work for me. Do you have any suggestions for me?
User avatar
balala
Rainmeter Sage
Posts: 9741
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Lano Visualizer - computer can't auto-sleep

Post by balala »

rainnoob wrote:
January 3rd, 2020, 9:14 pm
This is correct, right?
No, it's not. There are a few problems:
  • As said, since NowPlaying isn't anymore a plugin, but a measure and as such, you don't have to add the .dll extension into the Measure option (use Measure=NowPlaying instead of Measure=NowPlaying.dll).
  • The [UnloadIfNotPlaying] measure returns a numeric value, 0 if the player is closed and 1 if it is open. In such cases it is much better to use not IfMatch condition checking, but IfCondition (see below).
  • Finally, there are two more issues, which don't prevent the code to properly work (as previous two issues), but have to be said:
    • You can't disable a meter, just a measure. That's why the Disabled=1 option added to the [RequiredMeter] meter is completely useless. Remove it. Measures can be disabled or enabled, while meters can be shown or hidden.
    • In fact in most cases, the !ActivateConfig bang requires two parameters: the name of the config AND the name of the file of skin you'd like to activate. For !DeactivateConfig the name of the config is completely enough, but for !ActivateConfig is better to specify the name of the file too. It does work even if you don't specify it, loading the first file, if in the specified config are more skin files, but it definitely is better to give a filename as well. I added Left.ini as filename, you have to decide which one would you like to load, Left.ini, or Right.ini.
With all this, here is the fixed code:

Code: Select all

[Rainmeter]
Update=1000

[UnloadIfNotPlaying]
Measure=NowPlaying
PlayerName=WMP
PlayerType=STATUS
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!DeactivateConfig "monstercat-visualizer\Song Information"]
IfFalseAction=[!ActivateConfig "monstercat-visualizer\Song Information" "Left.ini"]

[RequiredMeter]
Meter=String
Text=""