updated monocle bar to be actually useable, now just need to make a daemon.
This commit is contained in:
@@ -4,18 +4,23 @@ MONITOR=HDMI-A-1
|
||||
|
||||
# get all clients on that monitor: mmsg get all-clients | jq '.clients[] | select( .monitor == "HDMI-A-1") | .id' -r
|
||||
|
||||
MONOCLEMON=$(mmsg get all-monitors | jq -r '.monitors[] | select(.tags[] | select(.is_active == true) | .layout | test("M|K|VK")) | .name')
|
||||
|
||||
ACTIVEMON=$(mmsg get all-monitors | jq '.monitors[] | select(.active == true) | .name' -r)
|
||||
#echo "activemon is $ACTIVEMON"
|
||||
ACTIVETAG=$(mmsg get tags $MONITOR | jq '.tags[] | select(.is_active == true) | .index' -r)
|
||||
#echo "activetag is $ACTIVETAG"
|
||||
ACTIVEWINDOWS=$(mmsg get all-clients | jq -r --arg ACTIVETAG "$ACTIVETAG" --arg ACTIVEMON "$MONITOR" '.clients[] | select(.tags[] == ($ACTIVETAG | tonumber) and .monitor == $ACTIVEMON) | .id')
|
||||
ACTIVEWINDOWS=$(mmsg get all-clients | jq -r --arg ACTIVETAG "$ACTIVETAG" --arg ACTIVEMON "$MONOCLEMON" '.clients[] | select(.tags[] == ($ACTIVETAG | tonumber) and .monitor == $ACTIVEMON) | .id' | sort)
|
||||
#echo "active windows are:"
|
||||
#echo "----------------------------------------"
|
||||
#echo "$ACTIVEWINDOWS"
|
||||
#echo "----------------------------------------"
|
||||
echo "lock" > ~/.config/monocle.lock
|
||||
sleep 0.05
|
||||
INDEX=0
|
||||
echo "" > ~/.config/monocle.state
|
||||
|
||||
|
||||
while read LINE; do
|
||||
ID=$LINE
|
||||
TITLE=$(mmsg get all-clients | jq -r --arg ID "$LINE" '.clients[] | select(.id == ($ID | tonumber)) | .title' )
|
||||
@@ -24,4 +29,7 @@ while read LINE; do
|
||||
|
||||
done <<< "$ACTIVEWINDOWS"
|
||||
|
||||
sleep 0.05
|
||||
rm ~/.config/monocle.lock
|
||||
|
||||
echo "(running)"
|
||||
Reference in New Issue
Block a user