From c73893b5a588be05cd65d93a0b7d77b145c89508 Mon Sep 17 00:00:00 2001 From: Emmet Date: Wed, 29 May 2024 20:20:55 -0500 Subject: [PATCH] cura works much better on xwayland --- profiles/work/home.nix | 19 ++++++++++++++++++- user/app/ranger/rifle.conf | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/profiles/work/home.nix b/profiles/work/home.nix index 96c8ec0..375e13d 100644 --- a/profiles/work/home.nix +++ b/profiles/work/home.nix @@ -96,7 +96,24 @@ mpv yt-dlp blender-hip - cura + # cura is moderately broken on wayland, so use xwayland + (pkgs.cura.overrideAttrs (oldAttrs: { + postInstall = oldAttrs.postInstall + ''cp -rf ${(pkgs.makeDesktopItem { + name = "com.ultimaker.cura"; + icon = "cura-icon"; + desktopName = "Cura"; + exec = "env QT_QPA_PLATFORM=xcb ${pkgs.cura}/bin/cura %F"; + tryExec = "env QT_QPA_PLATFORM=xcb ${pkgs.cura}/bin/cura"; + terminal = false; + type = "Application"; + categories = ["Graphics"]; + mimeTypes = ["model/stl" "application/vnd.ms-3mfdocument" "application/prs.wavefront-obj" + "image/bmp" "image/gif" "image/jpeg" "image/png" "text/x-gcode" "application/x-amf" + "application/x-ply" "application/x-ctm" "model/vnd.collada+xml" "model/gltf-binary" + "model/gltf+json" "model/vnd.collada+xml+zip"]; + })}/share/applications $out/share''; + })) + (pkgs.writeShellScriptBin "curax" ''env QT_QPA_PLATFORM=xcb ${pkgs.cura}/bin/cura'') curaengine_stable openscad (stdenv.mkDerivation { diff --git a/user/app/ranger/rifle.conf b/user/app/ranger/rifle.conf index e637fe0..b61237f 100644 --- a/user/app/ranger/rifle.conf +++ b/user/app/ranger/rifle.conf @@ -87,6 +87,8 @@ ext xopp~, has blender, X, flag f = xournalpp "$@" &>/dev/null ext helio, has helio, X, flag f = helio "$@" &>/dev/null ext kdenlive, has kdenlive-accel, X, flag f = kdenlive-accel "$@" &>/dev/null ext flp, has flstudio, X, flag f = flstudio "$@" &>/dev/null +ext 3mf, has curax, X, flag f = curax "$@" &>/dev/null +ext 3mf, has cura, X flag f = cura "$@" &>/dev/null #-------------------------------------------- # Scripts