Skip to content

Kainoa-h/aerospace-sketchybar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

There is currently a bug in aerospace from v0.18.0 to v0.19.1 (and possibly later versions)
If you are having these issues:

  • Multiple workspace icons being highlighted at once
  • Workspaces swtiching back and forth when switching workspaces

Revert back to the latest working aerospace release
brew install --cask nikitabobko/tap/aerospace@0.17.1

If you're on the latest aerospace version and theres no issues, den alls g ig

A simple sketchybar config for aerospace users!

alt text I couldn't find any resources for a simple sketchybar config that worked with aerospace. So this is what I came up with!

The styling is really ugly, i'm sorry. Hopefully that encourages you to tinker with the setup :p

anyways if you're looking for something more fleshed out: Here's my how current configuration looks

Credits:

I'm kinda new to shell scripting and all this stuff. Here are the resources that helped me make this config besides the official sketchybar and aerospace docs :p

Aerospace:

Getting it working:

If you already have an aerospace config or don't want to use mine, add the following into your aerospace.toml to trigger sketchybar & pass workspace data.

exec-on-workspace-change = ['/bin/bash', '-c',
    'sketchybar --trigger aerospace_workspace_change FOCUSED_WORKSPACE=$AEROSPACE_FOCUSED_WORKSPACE PREV_WORKSPACE=$AEROSPACE_PREV_WORKSPACE'
]

You should also add --focus-follows-window to the workspace change binds. This forces the workspace to follow when a window is moved to another workspace. This will cause 'exec-on-workspace-change' to fire, keeping the bar updated. Without this, when windows are moved to a new space, they won't appear in the bar until the bar is focused. From the Aerospace guide:

"Make sure that the window in question receives focus after moving. This flag is a shortcut for manually running aerospace-workspace/aerospace-focus after move-node-to-monitor successful execution."

alt-shift-1 = 'move-node-to-workspace 1 --focus-follows-window'
alt-shift-2 = 'move-node-to-workspace 2 --focus-follows-window'
alt-shift-3 = 'move-node-to-workspace 3 --focus-follows-window'
alt-shift-4 = 'move-node-to-workspace 4 --focus-follows-window'
...

If you need multi-monitor support, extend the key binded to 'move-workspace-to-monitor' to also trigger a sketchybar event

alt-shift-tab = [
  'move-workspace-to-monitor --wrap-around next',
  'exec-and-forget sketchybar --trigger aerospace_monitor_change TARGET_MONITOR=$(aerospace list-monitors --focused --format "%{monitor-appkit-nsscreen-screens-id}") FOCUSED_WORKSPACE=$(aerospace list-workspaces --focused)',
]

You may also want to adjust your window margins if your other monitors are not of the same resolution

[gaps]
inner.horizontal = 10
inner.vertical = 10
outer.left = 20
outer.bottom = 20
outer.top = [{ monitor."BenQ EX2510" = 44 }, 14]
outer.right = 20

Sketchybar

Current Functionality:

  • Dynamically displays/hides active/inactive workspaces. (kinda jank)
  • Displays apps in each workspace
  • Displays total swap memory (updates every 20 seconds)
  • Supports multi-monitors, only showing workspace icons on the monitor the workspace is in

Getting it working:

You will need to install a Nerd Font if you haven't already!

brew tap homebrew/cask-fonts
brew install font-hack-nerd-font

jq as well!

brew install jq

I used the SF font in my config so let's install that too! If you don't want to, that's fine as well. Just remeber to change the fonts used in sketchybarrc

brew install font-sf-pro

Lastly, you'll want to grab the sketchybar app font and add it to your '~/Library/Fonts/' directory!

About

simple starting aerospace & sketchybar config

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages