skhd Mode Indicator

> Published on Sat, 9 Dec 2023, 20:58> Updated on Tue, 14 May 2024, 17:37

Configuring a mode indicator for skhd requires defining on on_enter command for any modes you want to show. This on_enter command calls a script provided by simple-bar to cache the name of the mode as well as your preferred color (default color is white).

You can use any color (e.g. the 8 standard shell colors) defined as a variable by simple-bar (see ./lib/styles/core/variables.js, or the Uebersicht debug console).

shell
# ~/.skhdrc

# define a mode named "default". A mode named "default" will NOT be shown by simple-bar.
:: default : ~/.config/ubersicht/widgets/simple-bar/lib/scripts/yabai-set-mode.sh default

# define a mode named "tree" that will be colored blue
:: tree : ~/.config/ubersicht/widgets/simple-bar/lib/scripts/yabai-set-mode.sh tree blue

# define a mode called "binding" (in skhd) that will display in simple-bar as "binds"
:: binding : ~/.config/ubersicht/widgets/simple-bar/lib/scripts/yabai-set-mode.sh binds green

The yabai-set-mode.sh script uses an AppleScript command to refresh simple-bar. That command requires permissions, which you can set in System Preferences > Privacy & Security > Automation > skhd > ubersicht.

The mode indicator should appear within about a second after you enter a mode, in the process widget. You can debug this if it doesn't work by moving your mouse to different windows, or checking the skhd log/err files.

Instructions added by @Amar1729

Something is wrong in this documentation? Please open an issue on GitHub in simple-bar repo.