LittleVaaty / VDesk

Launch programs on new virtual desktops.
GNU General Public License v3.0
34 stars 0 forks source link

Retrieve desktop info #18

Closed Ami-Mizuno closed 2 months ago

Ami-Mizuno commented 3 months ago

First thanks for this. i find it very useful.

Might i suggest a means of retrieving various info from desktops? Some of the following would be nice

vdesk total ;returns total count of desktops. vdesk name -n 1 {-all} ;retrieve the name of a particular desktop or a list of all desktop names. vdesk switch -name "Name" ; switch to desktop via name not number.

some others that could be interesting would be gathering process info on a particular desktop. for example checking if desktop 1 has notepad on it or something.

LittleVaaty commented 3 months ago

Hi, thank for your return. For the 3 first suggest, it could be possible to do For the last one, I'm not sure windows allow to retrieve that info, but i will investigate

Ami-Mizuno commented 3 months ago

awsome. ya the last one was just me tossing out some stuff. the other ones would be much more usefull. however any data one can get would be helpful. thanks for the quick response.

LittleVaaty commented 2 months ago

After some diggings, i can't list all the app on a given desktop. But i can add a way to test if a process existe on a given desktop, is that something that you could work with ?

Ami-Mizuno commented 2 months ago

yes thats good. what about the named versions of commands? like switching etc.. in fact really switching is about all i need but allowing basically named version instead of number would be nice. essentially desktop name becomes its id. the user will have to deal with collisions and can do so via using # instead

vdesk -s "Visual Studio" vdesk -r "File" -o "Virtual Machines"

I may be forgeting the switches proper but im sure you get the idea.

As for listing processes you could use the toolhelp apis to take a snapshot, enum processes, open a handle to them. im not sure if the desktop info can be retrieved via a proc handle. ill dig into it later.

LittleVaaty commented 2 months ago

The switch is comming, but it;s a little bit tricky. If i replace the id by the name i break compatility with version of windows that don't support the name or i need to figure how to a allow both to live side by side, but the parsing library don't allow it, and i will need to drop it sooner than expected.

For the process i will look into it later, but it will be in a seperate PR

Ami-Mizuno commented 2 months ago

i understand. perhaps a different switch? -o can type check if # else string? or a -on-name -on-id? not really sure. maintaining previous versions will just have to fallback to # maybe adding a -caps dtnames returns false for older versions?

still good work. i have a corsair scimitar mouse (the one with 16 buttons) i had it setup with a left,middle,right button that would pass kbd keys to move left or right.

my method now is simply defining dt ids in a config file and using that to handle translations so i can use the mouse buttons to jump straight to the desktop i want.

LittleVaaty commented 2 months ago

I think i will go with just --on and either i can parse it as int, and it will use index or i can't and it will use name

Ami-Mizuno commented 2 months ago

well all right man. sounds great :) Can't wait to give it a go 😊