It is currently July 10th, 2020, 1:21 pm

Send bangs to rainmeter inside a Python script

Get help with installing and using Rainmeter.
Blue Guy
Posts: 18
Joined: February 9th, 2019, 5:00 pm

Send bangs to rainmeter inside a Python script

Post by Blue Guy »

Heya.
Just wanted to know if there's a way to send bangs to rainmeter after it starts running using Python or from the command line. I know they can be used from the command line as parameters when you execute it but is there a way to interact with it while it's running? I saw a few examples here (at end of the page) that use C++ and AutoIt but I couldn't really understand it. It'd be great if someone with a bit more experience with this could help me out.

Thanks!
User avatar
jsmorley
Developer
Posts: 21010
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Send bangs to rainmeter inside a Python script

Post by jsmorley »

Blue Guy wrote:
June 26th, 2020, 8:30 pm
Heya.
Just wanted to know if there's a way to send bangs to rainmeter after it starts running using Python or from the command line. I know they can be used from the command line as parameters when you execute it but is there a way to interact with it while it's running? I saw a few examples here (at end of the page) that use C++ and AutoIt but I couldn't really understand it. It'd be great if someone with a bit more experience with this could help me out.

Thanks!
Sending command line bangs to Rainmeter.exe is how you interact with it while it is running. It's not just about when it starts up.
Blue Guy
Posts: 18
Joined: February 9th, 2019, 5:00 pm

Re: Send bangs to rainmeter inside a Python script

Post by Blue Guy »

jsmorley wrote:
June 26th, 2020, 10:01 pm
Sending command line bangs to Rainmeter.exe is how you interact with it while it is running. It's not just about when it starts up.
I'm sorry but I'm a tad bit confused right now and I couldn't really find anything on Google either. How do I go about sending bangs while it's running? A small example or something of the sort might help clear things up.
User avatar
jsmorley
Developer
Posts: 21010
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Send bangs to rainmeter inside a Python script

Post by jsmorley »

Blue Guy wrote:
June 27th, 2020, 12:59 am
I'm sorry but I'm a tad bit confused right now and I couldn't really find anything on Google either. How do I go about sending bangs while it's running? A small example or something of the sort might help clear things up.
"C:\Program Files\Rainmeter\Rainmeter.exe" [!Log "Hey there!"]



1.jpg


Pretty much any bang you can do in skin code you can also do from the command line. The only thing to be careful of, is that most bangs in a skin will operate on the skin they are run in. That isn't possible from the command line, so you pretty much always need to specify the "config name" you want to impact as a part of the command.

"C:\Program Files\Rainmeter\Rainmeter.exe" [ShowMeter "myMeter" "illustro"]
"C:\Program Files\Rainmeter\Rainmeter.exe" [!Refresh "Weather.com"]

If Rainmeter is not running, it will run it, then execute the bang(s). If Rainmeter is already running, it just passes the bang(s) to the currently running instance.
You do not have the required permissions to view the files attached to this post.
Blue Guy
Posts: 18
Joined: February 9th, 2019, 5:00 pm

Re: Send bangs to rainmeter inside a Python script

Post by Blue Guy »

jsmorley wrote:
June 27th, 2020, 1:11 am
"C:\Program Files\Rainmeter\Rainmeter.exe" [!Log "Hey there!"]




1.jpg



Pretty much any bang you can do in skin code you can also do from the command line. The only thing to be careful of, is that most bangs in a skin will operate on the skin they are run in. That isn't possible from the command line, so you pretty much always need to specify the "config name" you want to impact as a part of the command.

"C:\Program Files\Rainmeter\Rainmeter.exe" [ShowMeter "myMeter" "illustro"]
"C:\Program Files\Rainmeter\Rainmeter.exe" [!Refresh "Weather.com"]

If Rainmeter is not running, it will run it, then execute the bang(s). If Rainmeter is already running, it just passes the bang(s) to the currently running instance.
Ahh that makes sense. Thanks for your help!
User avatar
jsmorley
Developer
Posts: 21010
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Send bangs to rainmeter inside a Python script

Post by jsmorley »

Sure thing.