From 1fce65acd86c490ff880cd8db2f0742641b0f66f Mon Sep 17 00:00:00 2001 From: alisceon Date: Mon, 1 Dec 2025 22:40:14 +0100 Subject: [PATCH] we swayin --- home/wm/sway.nix | 62 ++++++++++++++++++++++++++++++++++------ hosts/common/wm/sway.nix | 7 +++-- 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/home/wm/sway.nix b/home/wm/sway.nix index 716320e..9b0e944 100644 --- a/home/wm/sway.nix +++ b/home/wm/sway.nix @@ -79,6 +79,10 @@ wrapperFeatures.gtk = true; # Fixes common issues with GTK 3 apps config = { modifier = "${key_mod}"; + startup = [ + { command = "systemctl --user start libinput-gestures"; always = true; } + { command = "dbus-update-activation-environment --systemd --all"; always = true; } + ]; bars = [{ command = "${pkgs.waybar}/bin/waybar"; }]; @@ -118,8 +122,8 @@ ' ''; # Workspaces - "${key_mod}+Tab" = "workspace next"; - "${key_mod}+Shift+Tab" = "workspace prev"; + "${key_mod}+f" = "fullscreen"; + "${key_mod}+space" = "floating toggle"; "${key_mod}+1" = "workspace number 1"; "${key_mod}+2" = "workspace number 2"; @@ -130,9 +134,7 @@ "${key_mod}+7" = "workspace number 7"; "${key_mod}+8" = "workspace number 8"; "${key_mod}+9" = "workspace number 9"; - - "${key_mod}+Shift+period" = "move container to workspace next; workspace next"; - "${key_mod}+Shift+comma" = "move container to workspace prev; workspace prev"; + "${key_mod}+0" = "scratchpad show"; "${key_mod}+Shift+1" = "move container to workspace number 1; workspace 1"; "${key_mod}+Shift+2" = "move container to workspace number 2; workspace 2"; @@ -143,6 +145,18 @@ "${key_mod}+Shift+7" = "move container to workspace number 7; workspace 7"; "${key_mod}+Shift+8" = "move container to workspace number 8; workspace 8"; "${key_mod}+Shift+9" = "move container to workspace number 9; workspace 9"; + "${key_mod}+Shift+0" = "move container to scratchpad; scratchpad show"; + + "${key_mod}+Ctrl+1" = "move container to workspace number 1"; + "${key_mod}+Ctrl+2" = "move container to workspace number 2"; + "${key_mod}+Ctrl+3" = "move container to workspace number 3"; + "${key_mod}+Ctrl+4" = "move container to workspace number 4"; + "${key_mod}+Ctrl+5" = "move container to workspace number 5"; + "${key_mod}+Ctrl+6" = "move container to workspace number 6"; + "${key_mod}+Ctrl+7" = "move container to workspace number 7"; + "${key_mod}+Ctrl+8" = "move container to workspace number 8"; + "${key_mod}+Ctrl+9" = "move container to workspace number 9"; + "${key_mod}+Ctrl+0" = "move container to scratchpad"; # Focus "${key_mod}+${key_left}" = "focus left"; @@ -161,8 +175,8 @@ "${key_mod}+Shift+${key_right}" = "move right"; # System - "XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +1%'"; - "XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -1%'"; + "XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +3%'"; + "XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -3%'"; "XF86AudioMute" = "exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'"; "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 10"; "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 10"; @@ -235,11 +249,11 @@ events = [ { event = "before-sleep"; - command = (display "off") + "; " + lock; + command = "display off; systemctl --user stop libinput-gestures" + lock; } { event = "after-resume"; - command = display "on"; + command = "display on; systemctl --user start libinput-gestures"; } { event = "lock"; @@ -578,5 +592,35 @@ indicator-thickness = 10; }; # end settings }; # end swaylock + foot = { + enable = true; + server.enable = true; + settings = { + main = { + term = "xterm-256color"; + font = "${style_font}:size=${style_font_sz}"; + dpi-aware = "no"; + }; + }; + }; }; # end programs + dconf = { + enable = true; + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + gtk-theme = "Adwaita-Dark"; + }; + }; + }; + xdg.configFile."libinput-gestures.conf".text = '' + gesture swipe left 3 swaymsg workspace prev + gesture swipe right 3 swaymsg workspace next + gesture swipe down 3 swaymsg move container to scratchpad + gesture swipe up 3 swaymsg fullscreen + gesture pinch in 3 swaymsg floating enable + gesture pinch out 3 swaymsg floating disable + gesture pinch in 4 swaymsg kill + gesture swipe up 4 ${lock} + ''; } # end file diff --git a/hosts/common/wm/sway.nix b/hosts/common/wm/sway.nix index b7c9f2f..5516b44 100644 --- a/hosts/common/wm/sway.nix +++ b/hosts/common/wm/sway.nix @@ -6,7 +6,10 @@ wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout mako # notification system developed by swaywm maintainer rofi - waybar + + libinput + libinput-gestures + wmctrl ]; # enable Sway window manager @@ -43,5 +46,5 @@ }; # end logind gnome.gnome-keyring.enable = true; }; # end services - users.users.alisceon.extraGroups = [ "video" ]; + users.users.alisceon.extraGroups = [ "video" "input" ]; } \ No newline at end of file