Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShiftSpace

A taskbar toggle for Windows that switches your monitors between two arrangements — a personal Space and a work Space — with one click.

ShiftSpace icon

Features

  • One-click switching. A pill on the taskbar, anchored left of the "show hidden icons" chevron. Click to switch Spaces; the knob position shows the active one.
  • Any number of monitors. The settings window detects connected displays and lets you set, per Space, which monitors are enabled, which is primary, and each monitor's refresh rate.
  • Visual arrangement. A drag-and-drop canvas per Space; edges snap together and monitors cannot overlap.
  • Corner snapping. Ctrl+click monitors on the canvas and tick Snap corners of Ctrl+clicked to align their nearest corners exactly.
  • Configurable colors. Option within Settings to customize the pill's colors: solid, gradient, or transparent, with an opacity slider per element.
  • Fullscreen aware. The pill is part of the taskbar and hides and returns with it, including under fullscreen applications.
  • Global hotkeys. Optional shortcuts to toggle Spaces or apply Personal or Work directly.
  • Optional tray mode. The pill can be disabled in Settings; ShiftSpace then runs from a tray icon with the same click and menu behavior.
  • Stable monitor identity. Monitors are tracked by PnP hardware id and GPU output (DEL40A1#UID4353) rather than display numbers, which Windows reassigns when displays are detached.
  • Zero idle cost. Event-driven Win32; the process uses no CPU when idle.
  • Single static exe. No installer, no runtime dependencies. ~300 KB.

Install

Download ShiftSpace.exe from the latest release, put it anywhere, and run it. On first run the settings window opens automatically.

Right-click the pill (or the tray icon) for:

  • Settings… — reconfigure the Spaces
  • Start with Windows — registers under HKCU\...\CurrentVersion\Run
  • Exit

Settings

  1. Pick a Space (Personal / Work) and arrange its monitors on the canvas; edges snap together and monitors cannot overlap. Identify flashes each monitor's number on that screen. Ctrl+click monitors and tick Snap corners of Ctrl+clicked for exact corner-to-corner alignment.
  2. In the table, set which monitors each Space keeps (on), which is the main display (main), and each refresh rate.
  3. Optionally set the pill's colors. Each element has two color stops (Pill color... / Pill color 2...) -- equal stops for a solid, different stops for a gradient -- and an Opacity slider. Untick Show pill on taskbar to use a tray icon instead.
  4. For global hotkeys, click a hotkey's value (Toggle / Personal / Work), click the record button that appears, press the key combination, then click the record button again to stop. X clears a hotkey.
  5. Save.

The configuration is written to %APPDATA%\ShiftSpace\config.ini and can also be edited by hand:

[personal]
DEL40A1#UID4353 = 0,0,1920,1080,360,primary
GSM7F08#UID4356 = 0,-1080,1920,1080,240

[work]
GSM7F08#UID4356 = 0,0,1920,1080,240,primary
DEL40A1#UID4353 = detached

[widget]
# RRGGBB, AARRGGBB for transparency, or two stops for a gradient.
track = A0202020-A0004080
knob = EBEBEB
pill = on

[hotkeys]
toggle = Ctrl+Alt+S
personal = Ctrl+Alt+P
work = Ctrl+Alt+W

Command line

For hotkeys and scheduled tasks:

ShiftSpace.exe personal   # apply the personal Space and exit
ShiftSpace.exe work       # apply the work Space and exit
ShiftSpace.exe status     # report which Space is active (redirect stdout)
ShiftSpace.exe anchor     # diagnostic: how the taskbar anchor is resolved

Building

Requires the Rust MSVC toolchain:

cargo build --release
# -> target/release/ShiftSpace.exe

.cargo/config.toml statically links the CRT, so the exe depends only on system DLLs.

Implementation notes

  • While anything is detached, every adapter enumerates every disconnected monitor as its child, so identity is unreadable. Applying a layout attaches everything first, then maps identities, then applies.
  • All changes are staged with CDS_NORESET and committed atomically. Windows refuses to detach the current primary, and committing a new primary while the old one sits at (0,0) makes Windows scatter every monitor and drop them to 60 Hz.
  • A freshly attached display advertises a reduced mode list and fills it in a moment later, so target refresh rates are applied on a second pass after a settle.
  • On Windows 11 the tray icon cluster is XAML with no child windows, so the pill finds the chevron's left edge by walking the accessibility tree by geometry (a packed chain of small elements ending at the clock) — nothing is matched by name, so it works on any display language. On Windows 10 the chevron is a real Button window and is used directly.
  • Failures are reported via OutputDebugStringW — visible in DebugView.

License

MIT — see LICENSE.

About

One-click taskbar toggle between two monitor arrangements on Windows

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages