Add NVibrant plugin - NVIDIA digital vibrance toggle#830
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
spiros132
left a comment
There was a problem hiding this comment.
Some feedback about the PR :)
| vibranceValue = s?.vibranceValue ?? d?.vibranceValue ?? 512 | ||
| displayCount = s?.displayCount ?? d?.displayCount ?? 1 | ||
| } | ||
| } |
There was a problem hiding this comment.
You don't need this. Prefer to use the bindings that qml already supports. For example:
readonly property var cfg: pluginApi?.pluginSettings ?? ({})
readonly property var defaults: pluginApi?.manifest?.metadata?.defaultSettings ?? ({})
readonly property string foo: cfg.foo ?? defaults.foo ?? "Foo"| Qt.createQmlObject( | ||
| 'import Quickshell.Io; Process { command: ["bash","-c","' + cmd + '"]; running: true }', | ||
| root, "nvibrantRun" | ||
| ) |
There was a problem hiding this comment.
Prefer not to create the object at runtime like this because it has a lot of overhead.
| root.displayCount = s?.displayCount ?? d?.displayCount ?? 1 | ||
| root.vibrantEnabled = s?.enabled ?? d?.enabled ?? false | ||
| applyVibrance(root.vibrantEnabled ? root.vibranceValue : 0) | ||
| } |
There was a problem hiding this comment.
Same thing as before here. This isn't needed
| var cmd = buildCmd(value) | ||
| Logger.i("NVibrant", "Running: " + cmd) | ||
| Qt.createQmlObject( | ||
| 'import Quickshell.Io; Process { command: ["bash","-c","' + cmd + '"]; running: true }', |
There was a problem hiding this comment.
As before, you could put the Process as a child to root. Also I believe there is a Quickshell.exec which can run the command as well if you don't need to know what the command outputted
| cd ~/.config/noctalia/plugins | ||
| git clone https://github.com/noctalia-dev/noctalia-plugins tmp-clone | ||
| cp -r tmp-clone/nvibrant . | ||
| rm -rf tmp-clone |
There was a problem hiding this comment.
Aren't the above steps a bit redundant? You can just use the git clone and clone it into a nvibrant folder directly without creating a temporary directory.
| root.editDisplayCount = s?.displayCount ?? d?.displayCount ?? 1 | ||
| vibranceSpinBox.value = root.editVibranceValue | ||
| displayCountSpinBox.value = root.editDisplayCount | ||
| } |
There was a problem hiding this comment.
As before this isn't needed.
| m.displayCount = root.editDisplayCount | ||
| if (m.vibrantEnabled) | ||
| m.applyVibrance(root.editVibranceValue) | ||
| } |
There was a problem hiding this comment.
If you use qml bindings and reactivity this if statement shouldn't be needed since the variables will change when pluginSettings changes.
NVibrant — NVIDIA digital vibrance toggle
Adds a bar widget to toggle NVIDIA digital vibrance (color saturation) on/off with a single click.
Features
Requirements
nvibrantinstalled (yay -S nvibrant-bin)