Skip to content

desktops

This directory contains files for managing virtual desktops across different operating systems.

The core functionality is defined in desktops.py, which defines a set of actions for desktop manipulation. These actions are initially implemented with a "Not supported on this operating system" message. This file also contains the Actions class that is inherited from in platform-specific files.

desktops.talon provides the Talon commands for interacting with the actions defined in desktops.py. It maps voice commands like "desk one", "desk next", "window move desk two", etc., to the corresponding actions.

The remaining files provide platform-specific implementations of the actions defined in desktops.py. They are all context-specific using talon.Context, and override the "Not supported" implementations from desktops.py

  • desktops_mac.py provides the implementations for macOS, using keyboard shortcuts like ctrl-number to switch desktops and mouse drags to move windows between desktops. It also adds special handling for the Amethyst window manager using ctrl-alt-shift-number.
  • desktops_linux.py uses the ui.switch_workspace function and ui.active_window().workspace properties to manage virtual desktops on Linux.
  • desktops_win.py provides implementations for Windows, using keyboard shortcuts like super-ctrl-right and super-tab. It does not include window movement commands.

In summary, this directory provides a cross-platform way to manage virtual desktops using Talon, with platform-specific implementations. The files work together by defining the initial actions, the talon commands, and the specific implementations for each operating system.