Contributing¶
Thanks for your interest in contributing to KVitals!
Getting Started¶
- Fork the repository
- Clone your fork:
- Install locally for development:
Development Workflow¶
Making Changes¶
- Edit files in the project directory
- Reinstall and test:
- Check for QML errors:
Fast Iteration
You don't always need to restart plasmashell. For config-only changes, just reopen the settings dialog. For QML changes, a restart is required.
Adding a New Metric¶
For adding a sub-metric to an existing sensor group (the most common addition):
- Find sensor ID: Identify the sensor path in
ksystemstatsusingkstatsviewerorqdbus org.kde.ksystemstats1 /org/kde/ksystemstats1 org.kde.ksystemstats1.allSensors. - Metric definition: Add the metric entry to
DEFINITIONSincontents/ui/models/MetricDefinitions.js. If the sub-metric should be enabled by default on new installs, add its key toGROUPS[group].defaultSubMetricsinMetricDefinitions.jsand update the static<default>incontents/config/main.xml. - Sensor module: Subscribe to the sensor and expose the numeric or formatted property in
contents/ui/sensors/<Group>Sensors.qml. - Metric store: Push the metric in
contents/ui/models/MetricStore.qmlusing_createMetric("group.subKey", { ... }). - Config UI: Add
{ key: "subKey", label: i18n("...") }tometricMeta[group].subsincontents/ui/configMetrics.qml.
To add an entirely new hardware category (such as NPU or Cooler), see the module guide in Architecture Documentation.
Adding a New Setting¶
- Add the entry to
contents/config/main.xmlwith a default value. - Add the matching
cfg_<key>property and UI control to the appropriate config tab (configGeneral.qml,configMetrics.qml,configIcons.qml, orconfigColors.qml) so the KCM can load and persist the value. - Expose the value in
contents/ui/models/MetricConfig.qml(for metric settings) or read it incontents/ui/main.qml(for general presentation settings).
Pull Requests¶
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes and test locally
- Ensure ShellCheck passes
- Push and open a PR against
master
Commit Messages
Use conventional commits for clear history:
feat:: New featurefix:: Bug fixchore:: Maintenancedocs:: Documentation
Code Style¶
- QML: Follow KDE QML conventions, use Kirigami components where possible
- Commits: Use conventional commits (
feat:,fix:,chore:,docs:)
Reporting Issues¶
When filing a bug report, please include:
- KDE Plasma version (
plasmashell --version) - Linux distribution and version
- Whether you're using Intel or AMD CPU
- Relevant journal output (
journalctl -b | grep kvitals)