From 321495e9b13e47c41dd89e89f7271436885acad5 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Mon, 3 Jan 2022 10:48:25 -0800 Subject: [PATCH] untangle a few bits --- bin/laptop-disp.sh | 9 ++++++--- bin/statusbar | 11 +++++++---- bin/update-background.sh | 3 +-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bin/laptop-disp.sh b/bin/laptop-disp.sh index ea383ec..c687000 100755 --- a/bin/laptop-disp.sh +++ b/bin/laptop-disp.sh @@ -1,8 +1,11 @@ #!/bin/bash -source $HOME/.config/sway/displays.sh + +#LAPTOP="eDP-1" +LAPTOP="LVDS-1" + if grep -q open /proc/acpi/button/lid/LID*/state; then - swaymsg output $LAPTOP enable + swaymsg "output $LAPTOP enable" else - swaymsg output $LAPTOP disable + swaymsg "output $LAPTOP disable" fi diff --git a/bin/statusbar b/bin/statusbar index 6552586..0fd9d45 100755 --- a/bin/statusbar +++ b/bin/statusbar @@ -1,5 +1,12 @@ #!/bin/bash +# swaymsg -t get_outputs +# LAPTOP="eDP-1" +# EXTERNAL="HDMI-A-1" +LAPTOP="LVDS-1" +EXTERNAL="DP-1" + + #DATE=$(while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done) DATE=$(date +'%Y-%m-%d %k:%M') @@ -40,10 +47,6 @@ else RBT="" fi -# swaymsg -t get_outputs -# LAPTOP="eDP-1" -# EXTERNAL="HDMI-A-1" -source $HOME/.config/sway/displays.sh LAPSTAT=$(swaymsg -t get_outputs -r|jq --arg DISP "$LAPTOP" '.[] | select(.name==$DISP) | .active') if [[ $LAPSTAT == "true" ]]; then diff --git a/bin/update-background.sh b/bin/update-background.sh index 2c3c445..1f8c333 100755 --- a/bin/update-background.sh +++ b/bin/update-background.sh @@ -1,3 +1,2 @@ #!/bin/bash -source $HOME/.config/sway/displays.sh -swaymsg output $LAPTOP bg ~/.background fill +swaymsg "output * bg ~/.background fill"