From 96664adf4584a35ea16a2789c0ddea1504f9fa89 Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Wed, 14 Aug 2024 21:38:51 -0700 Subject: [PATCH] Update sway for headless VNC - Change aux workspace names from numbers - Add headless startup glue --- .config/sway/config | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/.config/sway/config b/.config/sway/config index 009aab4..85a250e 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -51,7 +51,7 @@ bindsym $mod+Shift+q kill bindsym button3 kill # rofi launcher -bindsym $mod+space exec "rofi -m HDMI-A-2 -show run" +bindsym $mod+space exec "rofi -threads 1 -m HDMI-A-2 -show run" # thunar -- file manager bindsym $mod+Shift+Return exec "thunar" @@ -108,7 +108,23 @@ set $ws6 "6" set $ws7 "7" set $ws8 "8" set $ws9 "9" -set $ws10 "10" +set $wsD "D" +set $wsT "T" +set $wsH "H" + +# force display-specific workspaces to display +workspace 1 output HDMI-A-2 +workspace 2 output HDMI-A-2 +workspace 3 output HDMI-A-2 +workspace 4 output HDMI-A-2 +workspace 5 output HDMI-A-2 +workspace 6 output HDMI-A-2 +workspace 7 output HDMI-A-2 +workspace 8 output HDMI-A-2 +workspace 9 output HDMI-A-2 +workspace D output HDMI-A-2 +workspace T output HDMI-A-1 +workspace H output HEADLESS-1 # switch to workspace bindsym $mod+1 workspace $ws1 @@ -120,11 +136,12 @@ bindsym $mod+6 workspace $ws6 bindsym $mod+7 workspace $ws7 bindsym $mod+8 workspace $ws8 bindsym $mod+9 workspace $ws9 -bindsym $mod+0 workspace $ws10 +bindsym $mod+0 workspace $wsD +bindsym $mod+T workspace $wsT # tilda replacement: workspace 10 is a full screen terminal # menu key (old tilda hotkey) just swaps to it -bindsym Menu workspace $ws10 +bindsym Menu workspace $wsD # move focused container to workspace bindsym $mod+Shift+1 move container to workspace $ws1 @@ -136,7 +153,9 @@ bindsym $mod+Shift+6 move container to workspace $ws6 bindsym $mod+Shift+7 move container to workspace $ws7 bindsym $mod+Shift+8 move container to workspace $ws8 bindsym $mod+Shift+9 move container to workspace $ws9 -bindsym $mod+Shift+0 move container to workspace $ws10 +bindsym $mod+Shift+0 move container to workspace $wsD +bindsym $mod+Shift+H move container to workspace $wsH +bindsym $mod+Shift+T move container to workspace $wsT # reload the configuration file bindsym $mod+Shift+c reload @@ -183,9 +202,9 @@ workspace_auto_back_and_forth yes # Make windows created with a special floating class float for_window [app_id=".*__user_requests_float"] floating enable, border pixel 1, resize set 800 600 -# Make mpv earmarked for the TV go to workspace 9, have no decorations and not steal focus +# Make mpv earmarked for the TV go to workspace T, have no decorations and not steal focus for_window [app_id="mpv__tv"] border none -assign [app_id="mpv__tv"] workspace number 9 +assign [app_id="mpv__tv"] workspace T no_focus [app_id="mpv__tv"] # Set mouse acceleration to 0 in Sway @@ -194,12 +213,11 @@ input * { pointer_accel 0.0 } -# Set up displays (main desktop, main and TV) -output "Samsung Electric Company T24B350 Unknown" pos -1920 0 +# Set up displays (main desktop, main and TV, with a headless for VNC shenanigans) output "Ancor Communications Inc VE247 G6LMQS117385" transform 270 pos 0 0 output "Synaptics Inc 232-S13 0x000001B0" pos 1080 0 mode 1280x720@60.000Hz +output HEADLESS-1 pos 3000,0 mode 1920x1080@60Hz -# Execute dbus environment stuff -# This makes the user keychain work among other things -exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP -exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP +# Perform bootstrap tasks the default Sway config does +# This mostly translates to populating environment variables into Sway +include /etc/sway/config.d/*