diff --git a/.config/sway/conf.d/theme b/.config/sway/conf.d/theme index af70df9..70c9ca3 100644 --- a/.config/sway/conf.d/theme +++ b/.config/sway/conf.d/theme @@ -4,8 +4,8 @@ include ~/.config/sway/conf.d/themes/dark # laptop output mode set $laptop eDP-1 -bindswitch --reload --locked lid:on output $laptop disable -bindswitch --reload --locked lid:off output $laptop enable +bindswitch --reload --locked lid:on exec ~/.config/sway/scripts/lid_switch/laptop_screen.sh disable +bindswitch --reload --locked lid:off exec ~/.config/sway/scripts/lid_switch/laptop_screen.sh enable #workspace_auto_back_and_forth yes force_display_urgency_hint 500 ms diff --git a/.config/sway/scripts/lid_switch/laptop_screen.sh b/.config/sway/scripts/lid_switch/laptop_screen.sh new file mode 100755 index 0000000..c64d6e3 --- /dev/null +++ b/.config/sway/scripts/lid_switch/laptop_screen.sh @@ -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 diff --git a/.config/sway/scripts/update-wallpaper.sh b/.config/sway/scripts/update-wallpaper.sh deleted file mode 100755 index 8663669..0000000 --- a/.config/sway/scripts/update-wallpaper.sh +++ /dev/null @@ -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 diff --git a/.config/sway/xkb_files/ralt_to_rsuper.xkb b/.config/sway/xkb_files/ralt_to_rsuper.xkb new file mode 100644 index 0000000..4f6f590 --- /dev/null +++ b/.config/sway/xkb_files/ralt_to_rsuper.xkb @@ -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 { [ Super_R ] }; + }; +};