From d06784958d73159b5e4abafe5114804662114ed7 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Thu, 9 Jul 2026 22:15:53 -0400 Subject: move ubersicht modules in tree --- .../lib/scripts/yabai-set-mode.sh | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/yabai-set-mode.sh (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/yabai-set-mode.sh') diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/yabai-set-mode.sh b/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/yabai-set-mode.sh new file mode 100755 index 0000000..6f580db --- /dev/null +++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/yabai-set-mode.sh @@ -0,0 +1,40 @@ +#! /usr/bin/env sh + +# make sure to fix permissions! +# Privacy & Security > Automation > skhd > Ubersicht + +# Write information regarding skhd mode to a cache file for widgets to read from. +# Usage: +# $0 --query print location of cache file +# $0 mode_name [color] write mode_name (and optionally, a color) to a cache file +# default color is white. +# by default, a mode named "default" will not be shown. + +CACHE_FILE="$HOME/Library/Caches/uebersicht-simple-bar-index/yabai-mode" + +mkdir -p "$(dirname "$CACHE_FILE")" +touch "$CACHE_FILE" + +main() { + # optional second argument color + color="$2" + if [ -z "$color" ]; then + color="white" + fi + + # update cache file + echo \ + "{\"mode\": \"$1\", \"color\": \"$color\"}" \ + > "$CACHE_FILE" + + osascript -e 'tell application id "tracesOf.Uebersicht" to refresh widget id "simple-bar-index-jsx"' +} + +case "$1" in + --query) + echo "$CACHE_FILE" + ;; + *) + main "$@" + ;; +esac -- cgit v1.3