1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-24 11:51:50 +08:00

fix sway laptop screen for nvidia

This commit is contained in:
Ryan 2024-05-01 11:58:43 +08:00
parent f8d1a32c63
commit 38deee239d
4 changed files with 32 additions and 22 deletions

View File

@ -4,8 +4,8 @@ include ~/.config/sway/conf.d/themes/dark
# laptop output mode # laptop output mode
set $laptop eDP-1 set $laptop eDP-1
bindswitch --reload --locked lid:on output $laptop disable bindswitch --reload --locked lid:on exec ~/.config/sway/scripts/lid_switch/laptop_screen.sh disable
bindswitch --reload --locked lid:off output $laptop enable bindswitch --reload --locked lid:off exec ~/.config/sway/scripts/lid_switch/laptop_screen.sh enable
#workspace_auto_back_and_forth yes #workspace_auto_back_and_forth yes
force_display_urgency_hint 500 ms force_display_urgency_hint 500 ms

View File

@ -0,0 +1,19 @@
#!/bin/sh
# Disable and enable laptop screen only when external monitors found
monitor_count=$(swaymsg -t get_outputs | grep name | wc -l)
laptop_output="eDP-1"
if [ $monitor_count -gt 1 ]; then
case "$1" in
disable)
swaymsg output $laptop_output disable
;;
enable)
swaymsg output $laptop_output enable
;;
*)
echo "Invalid argument"
;;
esac
fi

View File

@ -1,20 +0,0 @@
#!/bin/sh
export PATH="${PATH}:${HOME}/.local/bin"
export XDG_RUNTIME_DIR=/run/user/1000
export XDG_CACHE_HOME=$HOME/.cache
# If not using sway, we exit
if ! pidof sway > /dev/null
then
exit
fi
# If the deamon starts first time, we only init it, and the wallpaper will be updated
if ! pidof swww-daemon > /dev/null
then
swww init
exit
fi
swww img $(find -L ~/.config/sway/Wallpaper/ -type f | shuf -n1) -t wave --transition-fps 60 --transition-duration 5 --transition-wave 16,16

View File

@ -0,0 +1,11 @@
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols {
include "pc"
include "us"
include "inet(evdev)"
replace key <RALT> { [ Super_R ] };
};
};