From 1076289490f9bf3f7c019475e425b0036bc636d3 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 6 Sep 2023 07:55:03 +0000 Subject: [PATCH] sway: enable xwayland (but not for sxmo) --- hosts/modules/gui/sway/default.nix | 14 +++++++++++--- hosts/modules/gui/sway/sway-config.nix | 4 +--- hosts/modules/gui/sxmo/default.nix | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hosts/modules/gui/sway/default.nix b/hosts/modules/gui/sway/default.nix index 0fe2fdfe3..adeaa5778 100644 --- a/hosts/modules/gui/sway/default.nix +++ b/hosts/modules/gui/sway/default.nix @@ -39,6 +39,9 @@ in bindsym --locked XF86AudioLowerVolume exec $volume_down ''; }; + background = mkOption { + type = types.path; + }; font = mkOption { type = types.string; default = "pango:monospace 11"; @@ -46,9 +49,6 @@ in default font (for e.g. window titles) ''; }; - background = mkOption { - type = types.path; - }; mod = mkOption { type = types.string; default = "Mod4"; @@ -68,6 +68,14 @@ in - etc ''; }; + xwayland = mkOption { + type = types.bool; + default = true; + description = '' + whether or not to enable xwayland (allows running X11 apps on sway). + some electron apps (e.g. element-desktop) require xwayland. + ''; + }; # TODO: split these into their own option scope brightness_down_cmd = mkOption { diff --git a/hosts/modules/gui/sway/sway-config.nix b/hosts/modules/gui/sway/sway-config.nix index 177ccb0f7..3bb923417 100644 --- a/hosts/modules/gui/sway/sway-config.nix +++ b/hosts/modules/gui/sway/sway-config.nix @@ -20,8 +20,6 @@ let ''; # TODO: splatmoji release > 1.2.0 should allow `-s none` to disable skin tones emoji_cmd = "${pkgs.splatmoji}/bin/splatmoji -s medium-light type"; - - xwayland = "disable"; in pkgs.substituteAll { src = ./sway-config; inherit @@ -33,7 +31,6 @@ in pkgs.substituteAll { terminal_cmd vol_down_cmd vol_up_cmd - xwayland ; inherit (config) background @@ -46,6 +43,7 @@ in pkgs.substituteAll { mod workspace_layout ; + xwayland = if config.xwayland then "enable" else "disable"; playerctl = "${pkgs.playerctl}/bin/playerctl"; waybar = "${pkgs.waybar}/bin/waybar"; } diff --git a/hosts/modules/gui/sxmo/default.nix b/hosts/modules/gui/sxmo/default.nix index 35f7670f6..8e7a0aa31 100644 --- a/hosts/modules/gui/sxmo/default.nix +++ b/hosts/modules/gui/sxmo/default.nix @@ -211,9 +211,11 @@ in # - `bindsym $mod+Shift+p exec sxmo_appmenu.sh sys` # - `input * xkb_options compose:ralt` # these could be added, but i don't see much benefit. - mod = "Mod1"; # prefer Alt font = "Sxmo 10"; + mod = "Mod1"; # prefer Alt + xwayland = false; # disable to reduce RAM usage. workspace_layout = "tabbed"; + brightness_down_cmd = "sxmo_brightness.sh down"; brightness_up_cmd = "sxmo_brightness.sh up"; screenshot_cmd = "sxmo_screenshot.sh";