Hi, I have just started using rainmeter and I wanted a plugin for the windows virtual desktop.
It uses an undocumented API to control and query the windows virtual desktop features. As they are undocumented microsoft does change the API occasionally but they have been pretty stable for a while now.
I have only tested this plugin on my current system using Windows 10 21H2. I haven't tried it on Windows 11 yet.
I have included a demo skin to show its use.
Anyway check it out, let me know what you think, any suggestions or improvements.
Thanks.
History
It is currently September 12th, 2024, 5:10 am
VirtualDesktop plugin
-
- Posts: 13
- Joined: January 29th, 2022, 12:29 am
VirtualDesktop plugin
Last edited by RadAd on February 1st, 2022, 3:09 am, edited 4 times in total.
-
- Rainmeter Sage
- Posts: 5506
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: VirtualDesktop plugin
The package is "invalid".
You cannot make any changes to rmskin packages after they are created.
If you need, here are the details on creating a rmskin
You cannot make any changes to rmskin packages after they are created.
If you need, here are the details on creating a rmskin
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: VirtualDesktop plugin
Can we get the source code?RadAd wrote: ↑January 29th, 2022, 12:42 am Hi, I have just started using rainmeter and I wanted a plugin for the windows virtual desktop.
It uses an undocumented API to control and query the windows virtual desktop features. As they are undocumented microsoft does change the API occasionally but they have been pretty stable for a while now.
I have only tested this plugin on my current system using Windows 10 21H2. I haven't tried it on Windows 11 yet.
I have included a demo skin to show its use.
Anyway check it out, let me know what you think, any suggestions or improvements.
Thanks.
from the Realm of Death
-
- Posts: 13
- Joined: January 29th, 2022, 12:29 am
Re: VirtualDesktop plugin
RadAd wrote: ↑January 29th, 2022, 12:42 am Hi, I have just started using rainmeter and I wanted a plugin for the windows virtual desktop.
It uses an undocumented API to control and query the windows virtual desktop features. As they are undocumented microsoft does change the API occasionally but they have been pretty stable for a while now.
I have only tested this plugin on my current system using Windows 10 21H2. I haven't tried it on Windows 11 yet.
I have included a demo skin to show its use.
Anyway check it out, let me know what you think, any suggestions or improvements.
Thanks.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 13
- Joined: January 29th, 2022, 12:29 am
Re: VirtualDesktop plugin
I'll be putting it up on github soon.
-
- Rainmeter Sage
- Posts: 5506
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: VirtualDesktop plugin
Thanks for creating this plugin, no issues using it with my Win10 Pro setup.
Having the desktop name (string and number) values exposed allows customizing based on the current desktop;
like separate wallpapers for each VD!
After working with your plugin, I have a few requests, if possible :
1. Can you have the number value of the MeasureVirtualDesktop measure return the actual desktop number?
It returns a number 1 less than the current desktop, so a 'Calc' measure on the number value, or a 'RegExp substitute' on the string value, is needed to have the value match the current desktop number.
2. Is it possible to incorporate the 'Overview' and 'All Tasks' display functions as plugin features?
I am using AHK scripts to simulate combination key presses to activate those in my skins, but it would be great to not have to use additional software.
Thanks again!
Here's another demo using your plugin and 2 AHK scripts for 'overview' and 'all tasks'.
It includes Rainmeter wallpapers, created by Sgt E. V. McKay (if I remember right), compressed to minimize package size, as backgrounds for desktops.
Having the desktop name (string and number) values exposed allows customizing based on the current desktop;
like separate wallpapers for each VD!
After working with your plugin, I have a few requests, if possible :
1. Can you have the number value of the MeasureVirtualDesktop measure return the actual desktop number?
It returns a number 1 less than the current desktop, so a 'Calc' measure on the number value, or a 'RegExp substitute' on the string value, is needed to have the value match the current desktop number.
2. Is it possible to incorporate the 'Overview' and 'All Tasks' display functions as plugin features?
I am using AHK scripts to simulate combination key presses to activate those in my skins, but it would be great to not have to use additional software.
Thanks again!
Here's another demo using your plugin and 2 AHK scripts for 'overview' and 'all tasks'.
It includes Rainmeter wallpapers, created by Sgt E. V. McKay (if I remember right), compressed to minimize package size, as backgrounds for desktops.
You do not have the required permissions to view the files attached to this post.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 13
- Joined: January 29th, 2022, 12:29 am
Re: VirtualDesktop plugin
This is the difference between 0-based and 1-based.eclectic-tech wrote: ↑January 29th, 2022, 9:48 pm After working with your plugin, I have a few requests, if possible :
1. Can you have the number value of the MeasureVirtualDesktop measure return the actual desktop number?
It returns a number 1 less than the current desktop, so a 'Calc' measure on the number value, or a 'RegExp substitute' on the string value, is needed to have the value match the current desktop number.
The normal "computer" way is to be 0-based, which is the way it currently works.
The normal "natural" way is to be 1-based.
I would like to hear what other people think about this. It should really be consistent with other things in rainmeter so as not to confuse users.
There is nothing in the API for that functionality. The only way I know how to do it is with some kind of send keys like you are using. There seems to be other rainmeter plugins that can do it if you want to avoid using AHK.eclectic-tech wrote: ↑January 29th, 2022, 9:48 pm 2. Is it possible to incorporate the 'Overview' and 'All Tasks' display functions as plugin features?
I am using AHK scripts to simulate combination key presses to activate those in my skins, but it would be great to not have to use additional software.
-
- Rainmeter Sage
- Posts: 2734
- Joined: March 23rd, 2015, 5:26 pm
Re: VirtualDesktop plugin
The "Rainmeter way" is generally 1-based. Even true/false is often 1/-1 instead of 1/0.RadAd wrote: ↑January 30th, 2022, 11:39 pm This is the difference between 0-based and 1-based.
The normal "computer" way is to be 0-based, which is the way it currently works.
The normal "natural" way is to be 1-based.
I would like to hear what other people think about this. It should really be consistent with other things in rainmeter so as not to confuse users.
There is a good reason for this. Rainmeter measures are not always synchronous, in that a meter can attempt to read a value from a measure that has not completed initialization yet, because it is running on a different thread. Two good examples are WebParser and UsageMonitor measures. When a measure is uninitialized or disabled, it will return 0. In that scenario, your skin would not be able to tell the difference between zero (the actual value), zero (the measure is not initialized yet), and zero (disabled). Therefore it is often better (if possible or logical) for a measure to return non-zero values.
-
- Posts: 13
- Joined: January 29th, 2022, 12:29 am
Re: VirtualDesktop plugin
Updated to version 1.1
-
- Rainmeter Sage
- Posts: 5506
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: VirtualDesktop plugin
Thanks for the update. No more 'Zero' desktops!
You do not have the required permissions to view the files attached to this post.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::