It is currently October 27th, 2021, 10:36 pm

How to create a workspace switcher in Rainmeter?

Get help with installing and using Rainmeter.
User avatar
BlueJive
Posts: 27
Joined: February 25th, 2021, 6:45 am
Location: Norway, Tromoy

Re: How to create a workspace switcher in Rainmeter?

Post by BlueJive »

Ah, good shout. This happened:

Image

No idea why, but at least we know your code is probably working fine!
User avatar
deflore08
Posts: 189
Joined: July 12th, 2020, 7:47 am
Location: Ada, Garden City

Re: How to create a workspace switcher in Rainmeter?

Post by deflore08 »

We know why.. :) Looks you did not intall VirtualDesktops cmdlets. You must open shell from administrator name. Then try to type:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted, should help. After this you should be able to install the module.

If it won't help, try to read this and this.
Image * Image * Image
User avatar
BlueJive
Posts: 27
Joined: February 25th, 2021, 6:45 am
Location: Norway, Tromoy

Re: How to create a workspace switcher in Rainmeter?

Post by BlueJive »

Yay! It's working now! Thanks so much, really helpful.
User avatar
deflore08
Posts: 189
Joined: July 12th, 2020, 7:47 am
Location: Ada, Garden City

Re: How to create a workspace switcher in Rainmeter?

Post by deflore08 »

You're welcome. :) Please, mark the thread as solved. Thank you. :)
Image * Image * Image
User avatar
BlueJive
Posts: 27
Joined: February 25th, 2021, 6:45 am
Location: Norway, Tromoy

Re: How to create a workspace switcher in Rainmeter?

Post by BlueJive »

How to resolve sorry?
User avatar
deflore08
Posts: 189
Joined: July 12th, 2020, 7:47 am
Location: Ada, Garden City

Re: How to create a workspace switcher in Rainmeter?

Post by deflore08 »

BlueJive wrote: February 25th, 2021, 9:11 am How to resolve sorry?
Edit the post and set the green check mark as topic icon. :)
Image * Image * Image
User avatar
Jeff
Posts: 232
Joined: September 3rd, 2018, 11:18 am

Re: How to create a workspace switcher in Rainmeter?

Post by Jeff »

Kinda late but khanhas also made a workspace switcher in their Polybar skin, it uses AHK instead
User avatar
BlueJive
Posts: 27
Joined: February 25th, 2021, 6:45 am
Location: Norway, Tromoy

Re: How to create a workspace switcher in Rainmeter?

Post by BlueJive »

For future viewers, there is a quicker way to switch workspaces. Get nircmd:

https://www.nirsoft.net/utils/nircmd.html

And place it in a "nircmd" folder in resources. Then rewrite the left workspace swithcer code to look like this:

Code: Select all

[Rainmeter]
Update=1

[ghost1]
Meter=Image
ImageName=#@#Icons\ghost-red.png
H=13
LeftMouseUpAction=["#@#nircmd\nircmd.exe" SendKeyPress lwin+ctrl+left]["#@#nircmd\nircmd.exe" SendKeyPress lwin+ctrl+left]
Thiis obviously goes two workspaces to the left, allowing it to always fall upon the first workspace (presuming you are using three, as I am). This seems to be quicker than executing code in powershell for some reason

Obviously for the far right you would switch "left" to "right". However, the middle one needs to stay the same, I don't know how to code "if" statements in Rainmeter