diff options
Diffstat (limited to '.config/sway')
-rwxr-xr-x | .config/sway/clamshell.sh | 9 | ||||
-rw-r--r-- | .config/sway/config | 24 |
2 files changed, 27 insertions, 6 deletions
diff --git a/.config/sway/clamshell.sh b/.config/sway/clamshell.sh new file mode 100755 index 0000000..b5b9388 --- /dev/null +++ b/.config/sway/clamshell.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +laptop_screen=eDP-1 + +if grep -q open /proc/acpi/button/lid/LID/state; then + swaymsg output $laptop_screen enable +else + swaymsg output $laptop_screen disable +fi diff --git a/.config/sway/config b/.config/sway/config index af9926b..933acfd 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -43,6 +43,7 @@ set $text-color #f8f8f2 set $selection-color #44475a # set $accent-color $color12 set $accent-color #ffffff +set $laptop_screen eDP-1 # Basic color configuration using the Base16 variables for windows and borders. # Property Name Border BG Text Indicator Child Border @@ -61,7 +62,7 @@ set $term $(which foot || which alacritty) # Note: pass the final command to swaymsg so that the resulting window can be opened # on the original workspace that the command was run on. set $menu wofi --show drun -Iai -w 3 -#set $screenshot grim /dev/stdout | wl-copy +set $screenshot_fullscreen grim /dev/stdout | wl-copy set $screenshot slurp \ | grim -l 0 -g - /dev/stdout \ | wl-copy @@ -75,10 +76,11 @@ set $toggle_bar killall -SIGUSR1 waybar # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) output * bg /usr/share/backgrounds/background.png fill -output eDP-1 scale 1 -output eDP-1 adaptive_sync on -output eDP-1 pos 0 0 -output HDMI-1 pos 0 0 +output eDP-1 pos 1920 0 +output HDMI-A-1 pos 0 0 + +bindswitch --reload --locked lid:on output $laptop_screen disable +bindswitch --reload --locked lid:off output $laptop_screen enable # You can get the names of your outputs by running: swaymsg -t get_outputs ### Idle configuration @@ -92,7 +94,7 @@ exec swayidle -w \ before-sleep 'swaylock -f -c 000000' ### Input configuration -input "2821:6228:Asus_Keyboard" xkb_layout us,no,ro +input "2821:6228:Asus_Keyboard" xkb_layout us,no # You can get the names of your inputs by running: swaymsg -t get_inputs # Read `man 5 sway-input` for more information about this section. @@ -111,6 +113,7 @@ input "2821:6228:Asus_Keyboard" xkb_layout us,no,ro # Screenshot bindsym $mod+Shift+s exec $screenshot + bindsym Print exec $screenshot_fullscreen # Lock screen bindsym $mod+x exec $lock @@ -121,6 +124,12 @@ input "2821:6228:Asus_Keyboard" xkb_layout us,no,ro bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+ + # Turn off screen + bindsym --locked XF86DisplayOff output $laptop_screen toggle + + # Disable touchpad(s) + bindsym --locked XF86TouchpadToggle input "type:touchpad" events toggle + # Volume keys bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% @@ -284,6 +293,9 @@ input "type:touchpad" { pointer_accel 0.5 # set mouse sensitivity (between -1 and 1) } +output $laptop_screen enable + +exec_always $HOME/.config/sway/clamshell.sh exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK exec dunst exec nm-applet --indicator |