From c19bb194a40c737d01b3d501a390b26306e39a84 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Tue, 14 Oct 2025 23:58:39 +0200 Subject: [PATCH] niri: render with Nvidia dGPU when iGPU is enabled --- .utils/set_display | 11 +++++++++++ README.md | 4 ++-- niri/config.kdl | 4 ++++ niri/config.kdl.template | 4 ++++ quickshell/Assets/Config/Settings.json | 2 +- quickshell/Modules/Bar/Components/CpuTemp.qml | 2 +- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.utils/set_display b/.utils/set_display index ab47338..c4eec2e 100644 --- a/.utils/set_display +++ b/.utils/set_display @@ -27,3 +27,14 @@ else export HYPR_AQ_DRM_DEVICES=/dev/dri/card0 fi + +for file in $HOME/.config/niri/config.kdl $HOME/.config/niri/config.kdl.template; do + [ -f "$file" ] || continue + if [ -n "$NVIDIA_DRI_PATH" ]; then + sed -i "s|render-drm-device \"/dev/dri/card[0-9]*\"|render-drm-device \"$NVIDIA_DRI_PATH\"|" "$file" + elif [ -n "$Intel_DRI_PATH" ]; then + sed -i "s|render-drm-device \"/dev/dri/card[0-9]*\"|render-drm-device \"$Intel_DRI_PATH\"|" "$file" + else + sed -i "s|render-drm-device \"/dev/dri/card[0-9]*\"|render-drm-device \"/dev/dri/card0\"|" "$file" + fi +done \ No newline at end of file diff --git a/README.md b/README.md index cf970bf..537f8b6 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ This feature is only enabled in Niri. Swww also manages wallpapers of the Hyprla ## Wallpaper & Colortheme -[A small utility](https://github.com/Uynide/Wallpaper_Chooser) from myself, which implements a Image Carousel with Qt Widgets, is used to select a wallpaper from the collection. Once selected, [a script](https://github.com/Uyanide/dotfiles/blob/main/.scripts/change-colortheme) will pick the most suitable primary color (so-called flavor) for the wallpaper from the Catppuccin Mocha palette. Many applications that can be configured with a colortheme will adhere the result (including most Qt6 apps via Kvantum and GTK3&4 apps via nwg-look). +[A small utility](https://github.com/Uyanide/Wallpaper_Chooser) from myself, which implements an Image Carousel with Qt Widgets, is used to select a wallpaper from the collection. Once selected, [a script](https://github.com/Uyanide/dotfiles/blob/main/.scripts/change-colortheme) will pick the most suitable primary color (so-called flavor) for the wallpaper from the Catppuccin Mocha palette. Many applications that can be configured with a colortheme will adhere the result (including most Qt6 apps via Kvantum and GTK3&4 apps via nwg-look). -As for the wallpaper collection, see [backgrounds repo for personal use](https://github.com/Uyanide/backgrounds). +As for my wallpaper collection, see [backgrounds repo for personal use](https://github.com/Uyanide/backgrounds). ## Rofi diff --git a/niri/config.kdl b/niri/config.kdl index 9143e7c..18bea7a 100644 --- a/niri/config.kdl +++ b/niri/config.kdl @@ -256,6 +256,10 @@ cursor { hide-when-typing } +debug { + render-drm-device "/dev/dri/card0" +} + screenshot-path "~/Pictures/Screenshots/.niri_screenshot.png" // gestures { diff --git a/niri/config.kdl.template b/niri/config.kdl.template index 310e105..c6fae4f 100644 --- a/niri/config.kdl.template +++ b/niri/config.kdl.template @@ -256,6 +256,10 @@ cursor { hide-when-typing } +debug { + render-drm-device "/dev/dri/card0" +} + screenshot-path "~/Pictures/Screenshots/.niri_screenshot.png" // gestures { diff --git a/quickshell/Assets/Config/Settings.json b/quickshell/Assets/Config/Settings.json index 013c145..d37e67a 100644 --- a/quickshell/Assets/Config/Settings.json +++ b/quickshell/Assets/Config/Settings.json @@ -2,7 +2,7 @@ "location": "Munich", "notifications": { "doNotDisturb": false, - "lastSeenTs": 1760464428000 + "lastSeenTs": 1760477228000 }, "primaryColor": "#89b4fa", "showLyricsBar": false diff --git a/quickshell/Modules/Bar/Components/CpuTemp.qml b/quickshell/Modules/Bar/Components/CpuTemp.qml index 7a2de5b..ae075a3 100644 --- a/quickshell/Modules/Bar/Components/CpuTemp.qml +++ b/quickshell/Modules/Bar/Components/CpuTemp.qml @@ -9,7 +9,7 @@ MonitorItem { fillColor: Colors.yellow critical: SystemStatService.cpuTemp > 80 value: Math.round(SystemStatService.cpuTemp) - maxValue: 120 + maxValue: 100 textSuffix: "°C" onClicked: { if (action.running) {