From 98be7e5531802aedff16a1febeceb6c7c908129e Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 27 May 2019 10:22:02 -0400 Subject: [PATCH] Add bitbar script to show chunkwm workspaces --- .config/bitbar/chunkwm-ws.1s.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 .config/bitbar/chunkwm-ws.1s.sh diff --git a/.config/bitbar/chunkwm-ws.1s.sh b/.config/bitbar/chunkwm-ws.1s.sh new file mode 100755 index 0000000..ec72cd9 --- /dev/null +++ b/.config/bitbar/chunkwm-ws.1s.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +PATH="/usr/local/bin/:$PATH" + +TEAL='\033[0;36m' +RED='\033[0;31m' +NC='\033[0m' + +current_desktop=$(chunkc tiling::query --desktop id) +last_desktop=$(chunkc get _last_active_desktop) +monitor=$(chunkc tiling::query --monitor-for-desktop $current_desktop) +desktops=$(chunkc tiling::query --desktops-for-monitor $monitor) +highlighed=$(awk '{ + gsub("'${current_desktop}'", "'${TEAL}${current_desktop}${NC}'"); + gsub("'${last_desktop}'", "'${RED}${last_desktop}${NC}'"); + print; }' <<< $desktops) + +echo ${highlighed} +echo "---" +for i in ~/.chunkwm_layouts/* +do + echo "Load $(basename $i) | terminal=false bash='/usr/local/bin/chunkc' param1='tiling::desktop' param2='--deserialize' param3='$i'" + echo "Save $(basename $i) | alternate=true terminal=false bash='/usr/local/bin/chunkc' param1='tiling::desktop' param2='--serialize' param3='$i'" +done +