Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

MystikoLab/sxitch-rs

Repository files navigation

sxitch

This repo has been open sourced and archived. sxitch was originally built with Rust and Iced to provide a fast, keyboard-driven app switcher for macOS. The project is being rewritten as a Swift native app for better macOS integration and performance.

For more information, visit sxitch.app.

Code Structure

The app follows an Elm-like architecture using the Iced GUI framework. The entry point is src/main.rs which sets up logging, loads fonts, and creates the Iced daemon with AppState as the central state container.

  • src/app.rs -- Core state: AppState struct, AppMode enum (Normal/Quit/Hide), window and app management
  • src/app/new.rs -- Initialization: loads config, enumerates running apps, shows onboarding on first run
  • src/app/update.rs -- Message handling: ~80 message variants covering keyboard input, window management, mode switching, config editing, and license validation via Polar.sh
  • src/app/view.rs -- UI rendering: app picker grid/list layout, settings panels, onboarding wizard
  • src/app/subs.rs -- Subscriptions: keyboard event handling, hotkey streams, animation frames, app launch/terminate listeners
  • src/app/theme.rs -- 16 built-in color themes (Dark: Dracula, Catppuccin, Nord, TokyoNight, One Dark; Light: Solarized, GitHub, Catppuccin Latte, One Light)
  • src/app/pages/settings/ -- Settings sub-pages: general (hotkey, position, layout, overrides), themes, license activation, about
  • src/app/pages/onboarding.rs -- First-run tutorial with permission requests and interactive guide
  • src/config.rs -- TOML config for hotkey, theme, layout, overrides, blacklist, autostart, and more
  • src/container.rs -- Custom BezierContainer widget with smooth rounded corners and shadows
  • src/styles.rs -- UI style functions, font loading (Satoshi + Lucide icons)
  • src/license.rs -- License key activation/validation via Polar.sh API with macOS Keychain storage
  • src/platform/macos.rs -- Window configuration, app icon extraction, autostart, window focus (AX APIs)
  • src/platform/macos/accessibility.rs -- Accessibility, Input Monitoring, and Screen Recording permission flows
  • src/platform/macos/launching.rs -- CGEventTap for global hotkeys, full HID keycode mapping, EventTapHandle RAII wrapper
  • src/trayicon.rs -- NSStatusItem menu bar icon with programmatically drawn lightning icon

License

GPLv3. Copyright (C) Umang Surana.

About

A keyboard focussed app switcher

Resources

Stars

1 star

Watchers

1 watching

Forks

Sponsor this project

 

Contributors