diff --git a/modules/apps/programs.nix b/modules/apps/programs.nix index aa0fcc5..f00bb5a 100644 --- a/modules/apps/programs.nix +++ b/modules/apps/programs.nix @@ -1,12 +1,7 @@ { lib, config, pkgs, ... }: let inherit (lib) mkIf; inherit (config) conf; - # Ugly workaround xwl-satellite crashes and prusa not being wayland-native - prusa-wrapper = pkgs.makeDesktopItem { - name = "prusa-wrapper"; - desktopName = "Prusa"; - exec = "${pkgs.xwayland-run}/bin/xwayland-run -- i3"; - }; + mkSwayWrapper = import ./sway-wrapper.nix; in { imports = [ ./firefox.nix @@ -27,15 +22,8 @@ in { nautilus libreoffice-qt6-fresh inkscape - prusa-wrapper - planify # freecad -- broken dependency - ]; - - xsession.windowManager.i3 = { - enable = true; - config.startup = [{ command = "${pkgs.prusa-slicer}/bin/prusa-slicer"; }]; - }; + ] ++ [(mkSwayWrapper { lib = lib; pkgs = pkgs; app = "${pkgs.prusa-slicer}/bin/prusa-slicer"; name = "Prusa"; })]; home.file = { ".config/vesktop/settings.json" = { diff --git a/modules/apps/sway-wrapper.nix b/modules/apps/sway-wrapper.nix new file mode 100644 index 0000000..887e965 --- /dev/null +++ b/modules/apps/sway-wrapper.nix @@ -0,0 +1,13 @@ +{ lib, pkgs, app, name, ... }: let + inherit (lib) concatStrings; + config = pkgs.writeTextFile { + name = concatStrings [ "i3-config" name ]; + text = '' + exec ${app} + ''; + }; +in pkgs.makeDesktopItem { + name = name; + desktopName = name; + exec = "${pkgs.xwayland-run}/bin/xwayland-run -- ${pkgs.i3}/bin/i3 -c ${config}"; +}