Add a simple chunkwm indicator to BitBar
This commit is contained in:
parent
56406c8c29
commit
79e7fccab4
1 changed files with 31 additions and 0 deletions
31
config/bitbar/bin/chunkwm.1s.zsh
Executable file
31
config/bitbar/bin/chunkwm.1s.zsh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/zsh
|
||||
|
||||
# <bitbar.title>chunkwm mode</bitbar.title>
|
||||
# <bitbar.version>v1.0</bitbar.version>
|
||||
# <bitbar.author>Danielle McLean</bitbar.author>
|
||||
# <bitbar.author.github>00dani</bitbar.author.github>
|
||||
# <bitbar.desc>Display current desktop ID and layout from chunkwm.</bitbar.desc>
|
||||
# <bitbar.dependencies>brew,chunkwm</bitbar.dependencies>
|
||||
|
||||
# For info about chunkwm, see: https://github.com/koekeishiya/chunkwm
|
||||
|
||||
chunkc=/usr/local/bin/chunkc
|
||||
|
||||
modes=(
|
||||
bsp 🌳
|
||||
monocle 🔍
|
||||
float ⛵
|
||||
)
|
||||
typeset -A icons
|
||||
icons=($modes)
|
||||
|
||||
id=$($chunkc tiling::query --desktop id)
|
||||
mode=$($chunkc tiling::query --desktop mode)
|
||||
print -l "$icons[$mode] $id" "---"
|
||||
for m i in $modes; do
|
||||
if [[ $mode = $m ]]; then
|
||||
print $i $m
|
||||
else
|
||||
print "$i $m | terminal=false bash=$chunkc param1=tiling::desktop param2=--layout param3=$m"
|
||||
fi
|
||||
done
|
Loading…
Reference in a new issue