Hi all,
I'm currently trying to code a theme based on a Unix creation, through Rainmeter. All going well! But I'd like to know how to set up a simple workspace switcher in Rainmeter. The code I'm going for is not to slide backwards and forwards between desktops but instead to switch to either 1,2,3 or 4. It's not necessary to create the virtual desktops, only to switch to them (however on a side note, that could be a nice feature).
See below for a pic of what I'm getting at:
Each pacman ghost icon would preferably take me to a set virtual desktop in ascending order.
Whether this is possible through the autohotkey plugin, or an .ahk/.exe file I don't know. What I'm requesting is some help with the code, and how to code it. I appreciate that there have been other forums dedicated to thsi subject, but none of them describe how to do something like this. And with two of them, their code didn't work for some reason...
Thanks, and stay safe
It is currently March 29th, 2024, 8:11 am
How to create a workspace switcher in Rainmeter?
-
- Posts: 27
- Joined: February 25th, 2021, 6:45 am
How to create a workspace switcher in Rainmeter?
Last edited by BlueJive on February 25th, 2021, 9:27 am, edited 1 time in total.
-
- Posts: 209
- Joined: July 12th, 2020, 7:47 am
- Location: Ada, Garden City
Re: How to create a workspace switcher in Rainmeter?
I never though about this feature, but i guess it could be reached with RunCommand plugin and PowerShell virtual desktop commandlets combo.
-
- Posts: 27
- Joined: February 25th, 2021, 6:45 am
Re: How to create a workspace switcher in Rainmeter?
Right... Sorry. How do I use PowerShell virtual desktop commandlets tool? The page was rather unclear. Thanks
Edit: Sorry to be pedantic but wouldn't an autohotkeys plugin be better? Or even something like https://github.com/pmb6tz/windows-desktop-switcher? Only because they seem to be more widely used.
Edit: Sorry to be pedantic but wouldn't an autohotkeys plugin be better? Or even something like https://github.com/pmb6tz/windows-desktop-switcher? Only because they seem to be more widely used.
-
- Posts: 209
- Joined: July 12th, 2020, 7:47 am
- Location: Ada, Garden City
Re: How to create a workspace switcher in Rainmeter?
))
This thing looks like a solution.
Open PowerSHell with admin previlegies (Win+X combo) then type:
After that you able to use VD cmdlets. Example of using could be.. something like..
In my case i have 2 VD - 0 and 1. So i can switch between them by Switch-Desktop 0 and Switch-Desktop 1. Hope it will help. ))
Good idea, by the way.. Thank you.
This thing looks like a solution.
Open PowerSHell with admin previlegies (Win+X combo) then type:
Code: Select all
Install-Module VirtualDesktop
Code: Select all
[switcher]
Measure = PLUGIN
Plugin = RunCommand
Program = PowerShell
Parameter = Switch-Desktop #NUMBER#
State = Hide
Good idea, by the way.. Thank you.
-
- Posts: 27
- Joined: February 25th, 2021, 6:45 am
Re: How to create a workspace switcher in Rainmeter?
So here's what I got, obviously this won't work, I just wanted to figure it out
What do I need to add/change? And what's the hide state for?
(Oh, and thanks for being so helpful btw. I appreciate it)
Code: Select all
[ghost1]
MeasureName=switcher
Meter=Image
ImageName=#@#Icons\ghost.png
H=13
LeftMouseUpAction=["something something"]
[switcher]
Measure=PLUGIN
Plugin=RunCommand
Program=PowerShell
Parameter=Switch-Desktop 2
State=Hide
[Rainmeter]
Update=1000
Group=Widgets
(Oh, and thanks for being so helpful btw. I appreciate it)
-
- Posts: 209
- Joined: July 12th, 2020, 7:47 am
- Location: Ada, Garden City
Re: How to create a workspace switcher in Rainmeter?
You must send command to the measure.
LeftMouseUpAction=[!CommandMeasure switcher "Run"]
Hide state needed to run shell in background, it hiding annoying shell window.
Correct code under spoiler:
LeftMouseUpAction=[!CommandMeasure switcher "Run"]
Hide state needed to run shell in background, it hiding annoying shell window.
Correct code under spoiler:
Last edited by deflore08 on February 25th, 2021, 8:23 am, edited 2 times in total.
-
- Posts: 27
- Joined: February 25th, 2021, 6:45 am
Re: How to create a workspace switcher in Rainmeter?
Okay, so when I launched the skin, it hides. I also disabled the hide state just to test it, but even just having the plugin enabled hides it. Is this right? But how do I click it if it's hidden.
-
- Posts: 209
- Joined: July 12th, 2020, 7:47 am
- Location: Ada, Garden City
Re: How to create a workspace switcher in Rainmeter?
It hides, because you used "switcher" as MeasureName in your ghost1 meter. My opinion, you'll see an error in Raimeter's log. Try the code above, should work correctly.
-
- Posts: 27
- Joined: February 25th, 2021, 6:45 am
Re: How to create a workspace switcher in Rainmeter?
Great! Thanks so much, it's not hiding now. But it's not switching the desktop... I am on desktop number 1 and I'm assuming it should take me to number 2... But nada
-
- Posts: 209
- Joined: July 12th, 2020, 7:47 am
- Location: Ada, Garden City
Re: How to create a workspace switcher in Rainmeter?
Try to open PowerShell window and type manually first.
Switch-Desktop 0, Switch-Desktop 1, Switch-Desktop 2 etc. Look where it will lead you. ) I guess i'll lead you to 0 and 1 desktops, because.. Arrays begins from 0. ))))