commit d8f981fa888a44c625379cd36b5c921ef9037df1 parent 583b8c982e3159a41aa13f7987d1196541866d98 Author: Milutin Popovic <milutin@popovic.xyz> Date: Fri, 3 Apr 2026 15:46:05 +0100 wakup mons Diffstat:
| M | .local/bin/scripts/niri-monitors | | | 16 | ++++++++-------- |
| A | .local/bin/scripts/niri-wakup-monitors | | | 17 | +++++++++++++++++ |
2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/.local/bin/scripts/niri-monitors b/.local/bin/scripts/niri-monitors @@ -20,11 +20,11 @@ move_workspaces() { mulmon_activate() { noctalia-shell kill && \ - niri msg output "$mon_l" on - niri msg output "$mon_r" on - move_workspaces "$mon_l" "l" - move_workspaces "$mon_r" "r" - niri msg output "$mon_n" off + niri msg output "$mon_l" on && \ + niri msg output "$mon_r" on && \ + move_workspaces "$mon_l" "l" && \ + move_workspaces "$mon_r" "r" && \ + niri msg output "$mon_n" off && \ noctalia-shell & MONITOR_OUT=1 export MONITOR_OUT @@ -32,9 +32,9 @@ mulmon_activate() { mulmon_deactivate() { noctalia-shell kill && \ - niri msg output "$mon_n" on - move_workspaces "$mon_n" "l" - move_workspaces "$mon_n" "r" + niri msg output "$mon_n" on && \ + move_workspaces "$mon_n" "l" && \ + move_workspaces "$mon_n" "r" && \ niri msg output "$mon_l" off niri msg output "$mon_r" off noctalia-shell & diff --git a/.local/bin/scripts/niri-wakup-monitors b/.local/bin/scripts/niri-wakup-monitors @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +mon_n="BOE 0x0BCA Unknown" +mon_l="PNP(BNQ) BenQ GL2760 H3E04203019" +mon_r="PNP(BNQ) BenQ GL2760 SCF04101019" + +active_connection() { + count=$(niri msg outputs | grep -E "H3E04203019|SCF04101019" | wc -l | tr -d ' ') + [ "$count" -eq 2 ] +} + +if active_connection; then + niri msg output "$mon_l" on && \ + niri msg output "$mon_r" on && \ +else [ "$MONITOR_OUT" -eq 0 ]; then + niri msg output "$mon_n" on && \ +fi