Add a simple chunkwm indicator to BitBar

This commit is contained in:
Danielle McLean 2018-07-26 09:31:55 +10:00
parent 56406c8c29
commit 79e7fccab4
Signed by: 00dani
GPG key ID: 8EB789DDF3ABD240

View 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