From c73893b5a588be05cd65d93a0b7d77b145c89508 Mon Sep 17 00:00:00 2001 From: Emmet Date: Wed, 29 May 2024 20:20:55 -0500 Subject: [PATCH 1/4] 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 From 5283a87013e0268ce2da763936dc448a199958e0 Mon Sep 17 00:00:00 2001 From: Emmet Date: Wed, 29 May 2024 20:21:45 -0500 Subject: [PATCH 2/4] Fixes some fuzzel hidpi issues --- user/wm/hyprland/hyprland.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/user/wm/hyprland/hyprland.nix b/user/wm/hyprland/hyprland.nix index 4b83b10..8dc9768 100644 --- a/user/wm/hyprland/hyprland.nix +++ b/user/wm/hyprland/hyprland.nix @@ -6,6 +6,7 @@ in ../../app/terminal/alacritty.nix ../../app/terminal/kitty.nix (import ../../app/dmenu-scripts/networkmanager-dmenu.nix { + #dmenu_command = "fuzzel -d -f ${userSettings.font} :size=16"; inherit config lib pkgs; dmenu_command = "fuzzel -d"; inherit config lib pkgs; }) ../input/nihongo.nix @@ -978,7 +979,9 @@ in programs.fuzzel.enable = true; programs.fuzzel.settings = { main = { - font = userSettings.font + ":size=13"; + font = userSettings.font + ":size=20"; + dpi-aware = "no"; + show-actions = "yes"; terminal = "${pkgs.alacritty}/bin/alacritty"; }; colors = { From f0840a99ac803cf3d1257c7b334b252721e98746 Mon Sep 17 00:00:00 2001 From: Emmet Date: Wed, 29 May 2024 20:22:25 -0500 Subject: [PATCH 3/4] Added and reorganized hyprland env vars --- user/wm/hyprland/hyprland.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/user/wm/hyprland/hyprland.nix b/user/wm/hyprland/hyprland.nix index 8dc9768..bc347b4 100644 --- a/user/wm/hyprland/hyprland.nix +++ b/user/wm/hyprland/hyprland.nix @@ -35,6 +35,17 @@ in exec-once = dbus-update-activation-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY exec-once = hyprctl setcursor '' + config.gtk.cursorTheme.name + " " + builtins.toString config.gtk.cursorTheme.size + '' + env = XDG_CURRENT_DESKTOP,Hyprland + env = XDG_SESSION_TYPE,wayland + env = XDG_SESSION_DESKTOP,Hyprland + env = WLR_DRM_DEVICES,/dev/dri/card2:/dev/dri/card1 + env = GDK_BACKEND,wayland,x11,* + env = QT_QPA_PLATFORM,wayland;xcb + env = QT_QPA_PLATFORMTHEME,qt5ct + env = QT_AUTO_SCREEN_SCALE_FACTOR,1 + env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 + env = CLUTTER_BACKEND,wayland + exec-once = hyprprofile Default exec-once = pypr @@ -284,9 +295,6 @@ in force_zero_scaling = true } - env = WLR_DRM_DEVICES,/dev/dri/card2:/dev/dri/card1 - env = QT_QPA_PLATFORMTHEME,qt5ct - binds { movefocus_cycles_fullscreen = false } From 0691e38add2eac115350cbc7df0c748554c36aa7 Mon Sep 17 00:00:00 2001 From: Emmet Date: Wed, 29 May 2024 20:22:40 -0500 Subject: [PATCH 4/4] Without delay, element tray icon doesn't appear --- user/wm/hyprland/hyprland.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/user/wm/hyprland/hyprland.nix b/user/wm/hyprland/hyprland.nix index bc347b4..dde9fe5 100644 --- a/user/wm/hyprland/hyprland.nix +++ b/user/wm/hyprland/hyprland.nix @@ -50,10 +50,10 @@ in exec-once = pypr exec-once = ydotoold - exec-once = element-desktop --hidden #exec-once = STEAM_FRAME_FORCE_CLOSE=1 steam -silent exec-once = nm-applet exec-once = blueman-applet + exec-once = hypr-element-start exec-once = GOMAXPROCS=1 syncthing --no-browser exec-once = protonmail-bridge --noninteractive exec-once = waybar @@ -414,6 +414,10 @@ in nwg-dock-hyprland -f -x -i 64 -nolauncher -a start -ml 8 -mr 8 -mb 8 fi '') + (pkgs.writeScriptBin "hypr-element-start" '' + #!/usr/bin/env sh + sleep 6 && element-desktop --hidden + '') (pkgs.writeScriptBin "hypr-element" '' #!/bin/sh if hyprctl clients | grep "class: Element" > /dev/null