diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-08-16 23:47:17 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-08-17 22:08:07 -0600 |
| commit | 064bd98a00f75f314a9ad09ef2f515f063674800 (patch) | |
| tree | 8acece9329ded2f61811533302548f42423ffee9 | |
| parent | 6cb743cb070be40901dd472a7b9528864735237d (diff) | |
home/desktop, sys/seat: switch from xorg/i3 to wayland/sway
Diffstat (limited to '')
| -rw-r--r-- | home/desktop.nix | 182 | ||||
| -rw-r--r-- | home/graphics.nix | 5 | ||||
| -rw-r--r-- | home/path.nix | 3 | ||||
| -rw-r--r-- | sys/seat/default.nix | 20 |
4 files changed, 115 insertions, 95 deletions
diff --git a/home/desktop.nix b/home/desktop.nix index f372a69..299031c 100644 --- a/home/desktop.nix +++ b/home/desktop.nix @@ -71,103 +71,111 @@ with lib; { }; }; - xsession = { + wayland.windowManager.sway = { enable = true; - windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - - config = { - modifier = "Mod4"; - focus.followMouse = false; - - bars = singleton { - mode = "dock"; - hiddenState = "hide"; - position = "top"; - workspaceButtons = true; - workspaceNumbers = true; - statusCommand = getExe pkgs.i3status; - trayOutput = "primary"; - colors = { - background = "#000000"; - statusline = "#ffffff"; - separator = "#666666"; - focusedWorkspace = { - border = "#4c7899"; - background = "#285577"; - text = "#ffffff"; - }; - activeWorkspace = { - border = "#333333"; - background = "#5f676a"; - text = "#ffffff"; - }; - inactiveWorkspace = { - border = "#333333"; - background = "#222222"; - text = "#888888"; - }; - urgentWorkspace = { - border = "#2f343a"; - background = "#900000"; - text = "#ffffff"; - }; - bindingMode = { - border = "#2f343a"; - background = "#900000"; - text = "#ffffff"; - }; + config = { + modifier = "Mod4"; + focus.followMouse = false; + + fonts = { + size = 11.0; + names = [ "DejaVu Sans Mono" ]; + style = "Bold Semi-Condensed"; + }; + + bars = singleton { + mode = "dock"; + hiddenState = "hide"; + position = "top"; + workspaceButtons = true; + workspaceNumbers = true; + statusCommand = getExe pkgs.i3status; + trayOutput = "primary"; + colors = { + background = "#000000"; + statusline = "#ffffff"; + separator = "#666666"; + focusedWorkspace = { + border = "#4c7899"; + background = "#285577"; + text = "#ffffff"; + }; + activeWorkspace = { + border = "#333333"; + background = "#5f676a"; + text = "#ffffff"; + }; + inactiveWorkspace = { + border = "#333333"; + background = "#222222"; + text = "#888888"; + }; + urgentWorkspace = { + border = "#2f343a"; + background = "#900000"; + text = "#ffffff"; + }; + bindingMode = { + border = "#2f343a"; + background = "#900000"; + text = "#ffffff"; }; }; + }; - fonts = { - size = 11.0; - names = [ "DejaVu Sans Mono" ]; - style = "Bold Semi-Condensed"; + keybindings = + let + mod = config.wayland.windowManager.sway.config.modifier; + rofi = config.programs.rofi.finalPackage; + + inherit (pkgs.local) st tmux-lift; + in + mkOptionDefault { + "${mod}+a" = "focus parent"; + "${mod}+c" = "focus child"; + "${mod}+d" = "exec --no-startup-id ${getExe rofi} -show run"; + "${mod}+i" = "exec ${getExe pkgs.xcalib} -invert -alter"; + "${mod}+o" = "exec ${getExe pkgs.xautolock} -locknow"; + "${mod}+Return" = "exec ${getExe st} -e ${getExe tmux-lift}"; + "${mod}+Shift+e" = "exec ${getExe pkgs.xorg.setxkbmap} latam"; + "${mod}+Shift+u" = "exec ${getExe pkgs.xorg.setxkbmap} us"; }; - keybindings = - let - mod = config.xsession.windowManager.i3.config.modifier; - rofi = config.programs.rofi.finalPackage; - - inherit (pkgs.local) st tmux-lift; - in - mkOptionDefault { - "${mod}+a" = "focus parent"; - "${mod}+c" = "focus child"; - "${mod}+d" = "exec --no-startup-id ${getExe rofi} -show run"; - "${mod}+i" = "exec ${getExe pkgs.xcalib} -invert -alter"; - "${mod}+o" = "exec ${getExe pkgs.xautolock} -locknow"; - "${mod}+Return" = "exec ${getExe st} -e ${getExe tmux-lift}"; - "${mod}+Shift+e" = "exec ${getExe pkgs.xorg.setxkbmap} latam"; - "${mod}+Shift+u" = "exec ${getExe pkgs.xorg.setxkbmap} us"; - }; + startup = [ + { + command = "${getExe pkgs.xautolock} -time 10 -locker '${pkgs.i3lock-color}/bin/i3lock-color -fe -c222222'"; + } + ]; - startup = [ - { - command = "${getExe pkgs.xautolock} -time 10 -locker '${pkgs.i3lock-color}/bin/i3lock-color -fe -c222222'"; - notification = false; - } - ]; + window.commands = [ + # (No) Title Bars + { + command = "border pixel 5"; + criteria.class = "^.*"; + } - window.commands = [ - # (No) Title Bars - { - command = "border pixel 5"; - criteria.class = "^.*"; - } - - { - command = "floating enabled"; - criteria.class = "floating"; - } - ]; - }; + { + command = "floating enabled"; + criteria.class = "floating"; + } + ]; }; - }; + extraSessionCommands = '' + export SDL_VIDEODRIVER=wayland + # needs qt5.qtwayland in systemPackages + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + # Fix for some Java AWT applications (e.g. Android Studio), + # use this if they aren't displayed properly: + export _JAVA_AWT_WM_NONREPARENTING=1 + ''; + + swaynag.enable = true; + systemd.enable = true; + + xwayland = true; + }; }; } diff --git a/home/graphics.nix b/home/graphics.nix index cf60475..f964a7b 100644 --- a/home/graphics.nix +++ b/home/graphics.nix @@ -25,9 +25,6 @@ with lib; { }; }; - qt = { - enable = true; - platformTheme.name = "gtk"; - }; + qt.enable = true; }; } diff --git a/home/path.nix b/home/path.nix index eb07a60..5480f72 100644 --- a/home/path.nix +++ b/home/path.nix @@ -42,8 +42,7 @@ with lib; { pkgs.tomb pkgs.units pkgs.usbutils - pkgs.xautolock - pkgs.xclip # keepassxc-cli clip + pkgs.wl-clipboard pkgs.xsel pkgs.xournalpp pkgs.yubikey-manager diff --git a/sys/seat/default.nix b/sys/seat/default.nix index f391058..71041c0 100644 --- a/sys/seat/default.nix +++ b/sys/seat/default.nix @@ -17,6 +17,11 @@ in default = false; }; + wayland = mkOption { + type = types.bool; + default = true; + }; + videoDrivers = mkOption { type = with types; listOf str; }; @@ -79,16 +84,27 @@ in ) (mkIf cfg.graphical { + environment = { + sessionVariables.NIXOS_OZONE_WL = "1"; + + systemPackages = with pkgs; [ + qt5.qtwayland + qt6.qtwayland + ]; + }; + + hardware.opengl.enable = true; + programs.dconf.enable = true; services = { libinput.enable = true; - udev.packages = [ + udev.packages = with pkgs; [ pkgs.android-udev-rules ]; - xserver = { + xserver = mkIf (!cfg.wayland) { enable = true; videoDrivers = cfg.videoDrivers ++ [ "modesetting" "fbdev" ]; displayManager.startx.enable = true; |
