From db212bdf8c281425644746ee10b9e84c80d85527 Mon Sep 17 00:00:00 2001 From: SDGDen Date: Tue, 2 Jun 2026 03:49:30 +0200 Subject: [PATCH] added extra functionality to marker.sh to allow it to target non-focused monitors. --- sdgos/misc/marker.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sdgos/misc/marker.sh b/sdgos/misc/marker.sh index 61b5f43..a1c3bdb 100755 --- a/sdgos/misc/marker.sh +++ b/sdgos/misc/marker.sh @@ -1,7 +1,10 @@ #!/bin/bash -ACTIVEMON=$(mmsg get all-monitors | jq '.monitors[] | select(.active == true) | .name' -r) -ACTIVETAG=$(mmsg get tags DP-1 | jq '.tags[] | select(.is_active == true) | .index' -r) +ACTIVEMON="$1" +if [ "$ACTIVEMON" == "" ]; then + ACTIVEMON=$(mmsg get all-monitors | jq '.monitors[] | select(.active == true) | .name' -r) +fi +ACTIVETAG=$(mmsg get tags $ACTIVEMON | jq '.tags[] | select(.is_active == true) | .index' -r) ACTIVEWINDOWS=$(mmsg get all-clients | jq -r --arg ACTIVETAG "$ACTIVETAG" --arg ACTIVEMON "$ACTIVEMON" '.clients[] | select(.tags[] == ($ACTIVETAG | tonumber) and .monitor == $ACTIVEMON) | .id') echo "active monitor is $ACTIVEMON" @@ -12,7 +15,7 @@ echo "$ACTIVEWINDOWS" echo "$ACTIVEWINDOWS" > ~/.config/marker.state echo "$ACTIVEMON:$ACTIVETAG" > ~/.config/marker.workspace echo "marker state saved" -notify-send "monitor marked" +notify-send "monitor $ACTIVEMON marked"