untangle a few bits

This commit is contained in:
Morgan McMillian 2022-01-03 10:48:25 -08:00
parent 31e71e3649
commit 321495e9b1
3 changed files with 14 additions and 9 deletions

View file

@ -1,8 +1,11 @@
#!/bin/bash #!/bin/bash
source $HOME/.config/sway/displays.sh
#LAPTOP="eDP-1"
LAPTOP="LVDS-1"
if grep -q open /proc/acpi/button/lid/LID*/state; if grep -q open /proc/acpi/button/lid/LID*/state;
then then
swaymsg output $LAPTOP enable swaymsg "output $LAPTOP enable"
else else
swaymsg output $LAPTOP disable swaymsg "output $LAPTOP disable"
fi fi

View file

@ -1,5 +1,12 @@
#!/bin/bash #!/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=$(while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done)
DATE=$(date +'%Y-%m-%d %k:%M') DATE=$(date +'%Y-%m-%d %k:%M')
@ -40,10 +47,6 @@ else
RBT="" RBT=""
fi 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') LAPSTAT=$(swaymsg -t get_outputs -r|jq --arg DISP "$LAPTOP" '.[] | select(.name==$DISP) | .active')
if [[ $LAPSTAT == "true" ]]; if [[ $LAPSTAT == "true" ]];
then then

View file

@ -1,3 +1,2 @@
#!/bin/bash #!/bin/bash
source $HOME/.config/sway/displays.sh swaymsg "output * bg ~/.background fill"
swaymsg output $LAPTOP bg ~/.background fill