Grammar for managing windows workspaces

27 views
Skip to first unread message

Mike Roberts

unread,
Mar 27, 2019, 9:18:18 AM3/27/19
to Dragonfly Speech Recognition
This was added to caster recently but I'm posting it here too since it has completely altered my workflow and pretty much solved for me the tricky problem of window management.

The grammar is here:


And you will also need VirtualDesktopAccessor.dll from the same repo.

The commands are fairly self-explanatory and allow for easy movement of windows between workspaces. It takes a while to discipline yourself to create a new workspace for every task that you're working on, but once you're used to it you never have to alt-tab or click around the taskbar again. I usually have browsers on workspace one, longform reading material on workspace two, text editors on three and four, etc.

Caspar

unread,
Mar 28, 2019, 11:11:46 PM3/28/19
to Dragonfly Speech Recognition
I wish you had posted about 3 or 4 days earlier!

About 2 days ago I finished writing a grammar to solve this workspace problem another way: you can switch windows by saying one or more words in their title; standalone version of it is at https://gist.github.com/caspark/9c2c5e2853a14b6e28e9aa4f121164a6

Regardless, I had tried to use windows virtual desktops in my workflow before but failed because there weren't enough shortcuts available - good thinking in using a library to reach inside Windows to do this for us! Thanks for sharing and publishing, I'll be trying to incorporate this into my grammar as well :)

alexander15w

unread,
Mar 29, 2019, 2:25:11 PM3/29/19
to Dragonfly Speech Recognition
well it seems that this is a common problem unsurprisingly :-)

fwiw, here is Mark's version from the Vocola side of the world although it is written in Python so should be easily transferable

https://github.com/mdbridge/bit-bucket/blob/master/voice/Vocola_development/unofficial/vocola_ext_window_switching.py

the main entry point if I remember correctly is this function:

the really nice thing is that the specification can be a regular expression, soil allows for some flexibility for example here are a couple of commands :

RegularAnd(x) := EvalTemplate('(" " + %s + ")").lower()[:].replace(" ", ")(?=.*")[1:]', $x)  ;

ragular <_anything>= Window.Go( RegularAnd($1) );
subby <_anything> = Window.Go( RegularAnd( "Sublime "  $1 ) );

that said, sometimes I find Windows fails to bring up the window and just blinks it in the taskbar.

I'm curious if anybody else has ever seen that. The only thing that I have found to be 100% reliable is forcing a control click on that taskbar item.

Hawkeye Parker

unread,
Mar 29, 2019, 5:13:47 PM3/29/19
to Dragonfly Speech Recognition
"you can switch windows by saying one or more words in their title"

I have a grammar for this, an extension of the _window_control.py module:


see 'get_app_window()' and WinSelectorRule()

Mike Roberts

unread,
Apr 3, 2019, 8:39:02 AM4/3/19
to Dragonfly Speech Recognition
"There weren't enough shortcuts available"

It's totally bizarre, Microsoft finally got around to implementing a feature which has been standard on other operating systems for years, and then just didn't bother making half the keyboard shortcuts for it. Inexplicable.

Dane

unread,
Apr 3, 2019, 10:32:04 PM4/3/19
to Dragonfly Speech Recognition
Thank you all for these solutions! I also encountered this problem years ago when I used Windows 10 as my main desktop OS. It's ridiculous that they still haven't implemented workspace switching shortcuts.

Dane Finlay

James Stout

unread,
Apr 6, 2019, 8:46:30 PM4/6/19
to dragonf...@googlegroups.com
Regarding "Windows fails to bring up the window and just blinks it in the taskbar.": Yes, I see that too. What I have found to be reliable is simulating Windows key plus a number to activate a specific window. If you dock all of your applications to specific persistent locations, you can name commands that simulate this for each application.

--
You received this message because you are subscribed to the Google Groups "Dragonfly Speech Recognition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dragonflyspee...@googlegroups.com.
To post to this group, send email to dragonf...@googlegroups.com.
Visit this group at https://groups.google.com/group/dragonflyspeech.
To view this discussion on the web visit https://groups.google.com/d/msgid/dragonflyspeech/75a60037-de6a-43ce-b7dd-0eac7116d6a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages