diff --git a/bin/lock.sh b/bin/lock.sh index a3400f2..533b608 100755 --- a/bin/lock.sh +++ b/bin/lock.sh @@ -1,16 +1,13 @@ #! /bin/bash -gtklock +__lock() { + gtklock +} -# leave it here in case i'll need it later -# swaylock \ -# --screenshots \ -# --indicator \ -# --indicator-radius 100 \ -# --indicator-thickness 7 \ -# --clock \ -# --ring-color ffeced \ -# --key-hl-color 0291ff \ -# --effect-blur 7x5 \ -# --effect-vignette 0.5:0.5 \ -# --fade-in 0.2 +amount_of_outputs=$(swaymsg -t get_outputs | grep -i name | wc -l) + +if [[ "$amount_of_outputs" == "1" ]]; then + __lock +else + swaymsg output eDP-1 disable +fi diff --git a/config/.config/sway/config b/config/.config/sway/config index ffa31e9..efae5ae 100644 --- a/config/.config/sway/config +++ b/config/.config/sway/config @@ -90,8 +90,7 @@ output $mainMonitor { mode 1920x1080@144Hz } -bindswitch --reload --locked lid:on output $laptopMonitor disable -bindswitch --reload --locked lid:off output $laptopMonitor enable +bindswitch --reload lid:on exec "$HOME/dotfiles/bin/lock.sh"