diff --git a/config/niri/.config/niri/config/misc.kdl b/config/niri/.config/niri/config/misc.kdl index db5af45..8c18b91 100644 --- a/config/niri/.config/niri/config/misc.kdl +++ b/config/niri/.config/niri/config/misc.kdl @@ -1,7 +1,7 @@ screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png" debug { - render-drm-device "/dev/dri/renderD128" + render-drm-device "/dev/dri/renderD129" } // gestures { diff --git a/config/niri/.config/niri/config/prime.kdl b/config/niri/.config/niri/config/prime.kdl index 8b13789..d6062de 100644 --- a/config/niri/.config/niri/config/prime.kdl +++ b/config/niri/.config/niri/config/prime.kdl @@ -1 +1,5 @@ - +environment { + __NV_PRIME_RENDER_OFFLOAD "1" + __VK_LAYER_NV_optimus "NVIDIA_only" + __GLX_VENDOR_LIBRARY_NAME "nvidia" +} diff --git a/config/quickshell/.config/quickshell/Constants/Colors.qml b/config/quickshell/.config/quickshell/Constants/Colors.qml index 4b9be9f..f635cb7 100644 --- a/config/quickshell/.config/quickshell/Constants/Colors.qml +++ b/config/quickshell/.config/quickshell/Constants/Colors.qml @@ -2,6 +2,7 @@ import QtQuick import Quickshell import Quickshell.Io import qs.Constants +import qs.Services import qs.Utils pragma Singleton @@ -75,20 +76,37 @@ Singleton { } function setColor(name, value) { - if (!adapter.colors) - adapter.colors = { - }; - - adapter.colors[name] = value; - colorFile.writeAdapter(); + let state = ShellState.colorState; + state[name] = value; + ShellState.colorState = state; } function unsetColor(name) { - if (!adapter.colors || !(name in adapter.colors)) - return ; + let state = ShellState.colorState; + delete state[name]; + ShellState.colorState = state; + } - delete adapter.colors[name]; - colorFile.writeAdapter(); + Component.onCompleted: { + reloadColors(ShellState.colorState); + } + + Connections { + target: ShellState + onColorStateChanged: { + reloadTimer.restart(); + } + } + + Timer { + id: reloadTimer + + interval: 500 + running: false + repeat: false + onTriggered: { + reloadColors(ShellState.colorState); + } } QtObject { @@ -118,38 +136,4 @@ Singleton { readonly property color mLavender: "#b4befe" } - FileView { - id: colorFile - - path: Paths.configDir + "colors.json" - printErrors: false - watchChanges: true - onFileChanged: reload() - - JsonAdapter { - id: adapter - - property var colors: ({ - }) - } - - } - - Connections { - function onColorsChanged() { - colorReloadTimer.restart(); - } - - target: adapter - } - - Timer { - id: colorReloadTimer - - interval: 50 - running: true - repeat: false - onTriggered: reloadColors(adapter.colors) - } - } diff --git a/config/quickshell/.config/quickshell/Services/BackgroundService.qml b/config/quickshell/.config/quickshell/Services/BackgroundService.qml index c4d46d5..5576bfc 100644 --- a/config/quickshell/.config/quickshell/Services/BackgroundService.qml +++ b/config/quickshell/.config/quickshell/Services/BackgroundService.qml @@ -53,6 +53,7 @@ Singleton { return ; previewPath = ""; // clear preview path + cachedPath = ""; // clear cached path ImageCacheService.checkFileExists(path, function(exists) { if (!exists) return ; diff --git a/config/quickshell/.config/quickshell/Services/ShellState.qml b/config/quickshell/.config/quickshell/Services/ShellState.qml index debe5a7..0b552a5 100644 --- a/config/quickshell/.config/quickshell/Services/ShellState.qml +++ b/config/quickshell/.config/quickshell/Services/ShellState.qml @@ -16,6 +16,7 @@ Singleton { property alias leftSiderbarTab: adapter.leftSiderbarTab property alias rightSiderbarTab: adapter.rightSiderbarTab property alias wifiEnabled: adapter.wifiEnabled + property alias colorState: adapter.colorState function save() { saveTimer.restart(); @@ -27,6 +28,7 @@ Singleton { onLeftSiderbarTabChanged: save() onRightSiderbarTabChanged: save() onWifiEnabledChanged: save() + onColorStateChanged: save() Component.onCompleted: { stateFileView.path = stateFile; } @@ -58,6 +60,8 @@ Singleton { property string leftSiderbarTab: "bluetooth" property string rightSiderbarTab: "notes" property bool wifiEnabled: true + property var colorState: ({ + }) } } diff --git a/config/quickshell/.config/quickshell/Services/SunsetService.qml b/config/quickshell/.config/quickshell/Services/SunsetService.qml index bb1e47b..f00dfd2 100644 --- a/config/quickshell/.config/quickshell/Services/SunsetService.qml +++ b/config/quickshell/.config/quickshell/Services/SunsetService.qml @@ -28,6 +28,8 @@ Singleton { } } + Component.onCompleted: checkStart() + Connections { function onIsEnabledChanged() { if (root.isEnabled) diff --git a/config/scripts/.local/snippets/set_display b/config/scripts/.local/snippets/set_display index 9a2ea66..a0f46de 100644 --- a/config/scripts/.local/snippets/set_display +++ b/config/scripts/.local/snippets/set_display @@ -9,7 +9,7 @@ # Constants niri_config_file="$HOME/.config/niri/config/misc.kdl" -prefer_order=(intel nvidia) +prefer_order=(nvidia intel) # Get vendor and path of each GPU default_card_path="$(find /dev/dri/card* 2>/dev/null | head -n 1)"