Skip to content

Add NVibrant plugin - NVIDIA digital vibrance toggle#830

Draft
NoFilterA1 wants to merge 3 commits into
noctalia-dev:mainfrom
NoFilterA1:main
Draft

Add NVibrant plugin - NVIDIA digital vibrance toggle#830
NoFilterA1 wants to merge 3 commits into
noctalia-dev:mainfrom
NoFilterA1:main

Conversation

@NoFilterA1
Copy link
Copy Markdown

NVibrant — NVIDIA digital vibrance toggle

Adds a bar widget to toggle NVIDIA digital vibrance (color saturation) on/off with a single click.

Features

  • One-click toggle in the bar
  • Configurable vibrance level (0–1023)
  • Multi-monitor support
  • State persists across restarts

Requirements

  • nvibrant installed (yay -S nvibrant-bin)
  • NVIDIA GPU with display connected directly (not via hybrid/Optimus iGPU)
9dc107c2-e46e-41c0-b8e5-c15b810bfb2b (1)

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

@spiros132 spiros132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback about the PR :)

Comment thread nvibrant/BarWidget.qml
vibranceValue = s?.vibranceValue ?? d?.vibranceValue ?? 512
displayCount = s?.displayCount ?? d?.displayCount ?? 1
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Comment thread nvibrant/BarWidget.qml
Qt.createQmlObject(
'import Quickshell.Io; Process { command: ["bash","-c","' + cmd + '"]; running: true }',
root, "nvibrantRun"
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer not to create the object at runtime like this because it has a lot of overhead.

Comment thread nvibrant/Main.qml
root.displayCount = s?.displayCount ?? d?.displayCount ?? 1
root.vibrantEnabled = s?.enabled ?? d?.enabled ?? false
applyVibrance(root.vibrantEnabled ? root.vibranceValue : 0)
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as before here. This isn't needed

Comment thread nvibrant/Main.qml
var cmd = buildCmd(value)
Logger.i("NVibrant", "Running: " + cmd)
Qt.createQmlObject(
'import Quickshell.Io; Process { command: ["bash","-c","' + cmd + '"]; running: true }',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread nvibrant/README.md
cd ~/.config/noctalia/plugins
git clone https://github.com/noctalia-dev/noctalia-plugins tmp-clone
cp -r tmp-clone/nvibrant .
rm -rf tmp-clone
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread nvibrant/Settings.qml
root.editDisplayCount = s?.displayCount ?? d?.displayCount ?? 1
vibranceSpinBox.value = root.editVibranceValue
displayCountSpinBox.value = root.editDisplayCount
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As before this isn't needed.

Comment thread nvibrant/Settings.qml
m.displayCount = root.editDisplayCount
if (m.vibrantEnabled)
m.applyVibrance(root.editVibranceValue)
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use qml bindings and reactivity this if statement shouldn't be needed since the variables will change when pluginSettings changes.

@spiros132 spiros132 marked this pull request as draft May 11, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants