From 3348a8d4d681a4d738ed5b73c1d2808e17355fa7 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 20 Dec 2022 14:47:50 -0500 Subject: [PATCH 1/6] .bashrc: Add GUI config Let's ditch pam_environment entirely --- bash/.bashrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bash/.bashrc b/bash/.bashrc index 964d703..7e647f1 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -109,3 +109,7 @@ 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 From 1ab7f02535f687421333874711832f999566ec51 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 20 Dec 2022 15:02:57 -0500 Subject: [PATCH 2/6] .bashrc: Add logic to automatically start sway --- bash/.bashrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bash/.bashrc b/bash/.bashrc index 7e647f1..e19befe 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 @@ -113,3 +119,4 @@ 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 +$MACHINE_START_SWAY && [[ -z "$DISPLAY" && $(tty) == /dev/tty1 ]] && exec sway From 471b4997203e9d83f469445cd5c03cf66661fd84 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 20 Dec 2022 15:11:17 -0500 Subject: [PATCH 3/6] sway: Add shared brightness control bindings --- sway/.config/sway/shared.d/brightness_ctl | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sway/.config/sway/shared.d/brightness_ctl 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) }')" From 0c99d7c42e171144966bf80fe40346fe78043f93 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 20 Dec 2022 16:06:35 -0500 Subject: [PATCH 4/6] .bashrc: Add fcitx env variables --- bash/.bashrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bash/.bashrc b/bash/.bashrc index e19befe..951875f 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -119,4 +119,7 @@ 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 From 12a693154cfca9cc7c1889e15da613f60cf9680a Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 20 Dec 2022 16:06:47 -0500 Subject: [PATCH 5/6] sway: Add alternative key binds for screenshots --- sway/.config/sway/config | 3 +++ 1 file changed, 3 insertions(+) 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 From 372523a6d7ef3fdbd6fda4e2eee9bbb6d1aae664 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Fri, 23 Dec 2022 17:15:01 -0500 Subject: [PATCH 6/6] sway: Add kanshi user service --- sway/.config/systemd/user/kanshi.service | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sway/.config/systemd/user/kanshi.service 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