diff --git a/bash/.bashrc b/bash/.bashrc index 964d703..951875f 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -8,6 +8,12 @@ alias ls='ls --color=auto' PS1='[\u@\h \W]\$ ' +# Default config +export MACHINE_START_SWAY=false # Whether to start Sway from bash + +# Source machine-specific config +[[ -f ~/.machine_config ]] && source ~/.machine_config + # Execute tmux in Alacritty if [[ "$TERM" == "alacritty" || "$TERM_PROGRAM" == "WezTerm" ]]; then exec tmux @@ -109,3 +115,11 @@ export PASSWORD_STORE_ENABLE_EXTENSIONS=true # Use gpg-agent-ssh export SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh + +# Desktop stuff (Sway) +export QT_QPA_PLATFORMTHEME=qt5ct +export GTK_THEME=Gruvbox-Material-Dark-HIDPI +export GTK_IM_MODULE=fcitx +export QT_IM_MODULE=fcitx +export SDL_IM_MODULE=fcitx +$MACHINE_START_SWAY && [[ -z "$DISPLAY" && $(tty) == /dev/tty1 ]] && exec sway diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 0f085ad..9033d69 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -230,6 +230,9 @@ bindsym $mod+x exec bemenu-run | xargs swaymsg exec -- bindsym Print exec grimshot --notify save area bindsym Ctrl+Print exec grimshot --notify save window bindsym Shift+Print exec grimshot --notify save screen +# Use F10 too since on GPD WM2, Fn and Shift / Ctrl conflict +bindsym Ctrl+F10 exec grimshot --notify save window +bindsym Shift+F10 exec grimshot --notify save screen bindsym Ctrl+Tab workspace next bindsym Ctrl+grave workspace prev diff --git a/sway/.config/sway/shared.d/brightness_ctl b/sway/.config/sway/shared.d/brightness_ctl new file mode 100644 index 0000000..62b415d --- /dev/null +++ b/sway/.config/sway/shared.d/brightness_ctl @@ -0,0 +1,4 @@ +# set brightness logarithmically by factor 1.4 +# .72 is just slightly bigger than 1 / 1.4 +bindsym --locked XF86MonBrightnessUp exec light -S "$(light -G | awk '{ print int(($1 + .72) * 1.4) }')" +bindsym --locked XF86MonBrightnessDown exec light -S "$(light -G | awk '{ print int($1 / 1.4) }')" diff --git a/sway/.config/systemd/user/kanshi.service b/sway/.config/systemd/user/kanshi.service new file mode 100644 index 0000000..fa9bce3 --- /dev/null +++ b/sway/.config/systemd/user/kanshi.service @@ -0,0 +1,9 @@ +[Unit] +Description=Dynamic Display Output Configuration +BindsTo=sway-session.target + +[Service] +ExecStart=/usr/bin/kanshi + +[Install] +WantedBy=sway-session.target