aboutsummaryrefslogtreecommitdiff
path: root/.config/waybar/scripts/layout.sh
blob: eef873a5a441310ef5a45b3e44c47304053f82c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

# Get focused output
output="$(mmsg get all-monitors | jq -r '.monitors[] | select(.active == true) | .name')"

case $1 in
  toggle)
    mmsg dispatch switch_layout
    ;;
  *)
    text=$(mmsg get all-monitors | jq -r '.monitors[] | .layout_symbol')
    echo "{\"text\":\""$text"\", \"tooltip\":\""$tooltip"\"}"
    ;;
esac