Skip to content

Instantly share code, notes, and snippets.

@Sprit3Dan
Created December 8, 2019 09:48
Show Gist options
  • Save Sprit3Dan/bb730c9405d4632cc90a1d36b5400207 to your computer and use it in GitHub Desktop.
Save Sprit3Dan/bb730c9405d4632cc90a1d36b5400207 to your computer and use it in GitHub Desktop.
Sway get currently active workspace id
#!/bin/sh
swaymsg -t get_workspaces | jq '.[] | select(.focused==true) | .id'
@rifazn
Copy link

rifazn commented Jan 8, 2023

Thanks!

Used it to find current workspace width:

swaymsg -t get_workspaces | jq '.[] | select(.focused==true) | .rect.width'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment