From 20f47307c98e60d4adb80a78c732497b3c2df610 Mon Sep 17 00:00:00 2001 From: tslil Date: Sat, 20 Jun 2026 13:24:46 +0100 Subject: machi_status: parameterise --- machi_status | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/machi_status b/machi_status index cd962bd..72a9cc8 100755 --- a/machi_status +++ b/machi_status @@ -1,3 +1,16 @@ #!/usr/bin/env sh +MODE=$1 -machictl -watch $WAYBAR_OUTPUT_NAME | jq --unbuffered -r '"W \(.current_workspace_index + 1)/\(.total_workspaces)|P \(.workspace_info.current_panel_index + 1)/\(.workspace_info.total_panels)|F \(.panel_info.total_windows)| \(.window_info.title | if length > 48 then .[0:48] + "..." else . end)"' | sed -u 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g' +machictl -watch $WAYBAR_OUTPUT_NAME | jq --unbuffered --arg mode "$MODE" -r ' + if $mode == "W" then + "W \(.current_workspace_index + 1)/\(.total_workspaces)" + elif $mode == "P" then + "P \(.workspace_info.current_panel_index + 1)/\(.workspace_info.total_panels)" + elif $mode == "F" then + "F \(.panel_info.total_windows)" + elif $mode == "T" then + (.window_info.title | if length > 48 then .[0:48] + "..." else . end) + else + "ERR" + end +' | sed -u 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g' -- cgit v1.2.3