Added clamshell mode
This commit is contained in:
@@ -38,6 +38,9 @@ seat * hide_cursor 4000
|
||||
# Notifications
|
||||
exec_always --no-startup-id dunst
|
||||
|
||||
# Clamshell Mode Script
|
||||
exec_always ~/dotfiles/.config/sway/clamshell.sh
|
||||
|
||||
# flash focus
|
||||
exec --no-startup-id flashfocus
|
||||
|
||||
@@ -99,6 +102,10 @@ input type:keyboard {
|
||||
repeat_rate 45
|
||||
}
|
||||
|
||||
set $laptop eDP-1
|
||||
bindswitch --reload --locked lid:on output $laptop disable
|
||||
bindswitch --reload --locked lid:off output $laptop enable
|
||||
|
||||
# Monitors
|
||||
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
||||
# output eDP-1 pos 0 0 res 1920x1200
|
||||
|
||||
+19
@@ -59,6 +59,9 @@ seat * hide_cursor 4000
|
||||
# Notifications
|
||||
exec_always --no-startup-id dunst
|
||||
|
||||
# Clamshell Mode Script
|
||||
exec_always ~/dotfiles/.config/sway/clamshell.sh
|
||||
|
||||
# flash focus
|
||||
exec --no-startup-id flashfocus
|
||||
|
||||
@@ -125,6 +128,22 @@ input type:keyboard {
|
||||
repeat_rate 45
|
||||
}
|
||||
#+end_src
|
||||
** Clamshell Mode
|
||||
#+begin_src shell :tangle ~/dotfiles/.config/sway/config :mkdirp yes
|
||||
set $laptop eDP-1
|
||||
bindswitch --reload --locked lid:on output $laptop disable
|
||||
bindswitch --reload --locked lid:off output $laptop enable
|
||||
#+end_src
|
||||
|
||||
When reloading sway while using clamshell mode, the displays may reset (i.e. enable the displays). We use a bash script to mitigate this:
|
||||
#+begin_src shell :tangle ~/dotfiles/.config/sway/clamshell.sh :mkdirp yes
|
||||
#!/usr/bin/bash
|
||||
if grep -q open /proc/acpi/button/lid/LID/state; then
|
||||
swaymsg output <LAPTOP> enable
|
||||
else
|
||||
swaymsg output <LAPTOP> disable
|
||||
fi
|
||||
#+end_src
|
||||
** Wallpaper & Monitor(s)
|
||||
#+begin_src shell :tangle ~/dotfiles/.config/sway/config :mkdirp yes
|
||||
# Monitors
|
||||
|
||||
Reference in New Issue
Block a user