added extra functionality to marker.sh to allow it to target non-focused monitors.
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ACTIVEMON=$(mmsg get all-monitors | jq '.monitors[] | select(.active == true) | .name' -r)
|
ACTIVEMON="$1"
|
||||||
ACTIVETAG=$(mmsg get tags DP-1 | jq '.tags[] | select(.is_active == true) | .index' -r)
|
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')
|
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"
|
echo "active monitor is $ACTIVEMON"
|
||||||
@@ -12,7 +15,7 @@ echo "$ACTIVEWINDOWS"
|
|||||||
echo "$ACTIVEWINDOWS" > ~/.config/marker.state
|
echo "$ACTIVEWINDOWS" > ~/.config/marker.state
|
||||||
echo "$ACTIVEMON:$ACTIVETAG" > ~/.config/marker.workspace
|
echo "$ACTIVEMON:$ACTIVETAG" > ~/.config/marker.workspace
|
||||||
echo "marker state saved"
|
echo "marker state saved"
|
||||||
notify-send "monitor marked"
|
notify-send "monitor $ACTIVEMON marked"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user