Compare commits
3 Commits
release-v1.3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 34ce24c192 | |||
| a3ae405280 | |||
| c5f24dbb67 |
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
NowPlaying is a KDE Plasma 6 widget inspired by the Cleartext Rainmeter widget. It displays the current song and artist with compact media controls, and is meant to live on the desktop rather than in a panel.
|
NowPlaying is a KDE Plasma 6 widget inspired by the Cleartext Rainmeter widget. It displays the current song and artist with compact media controls, and is meant to live on the desktop rather than in a panel.
|
||||||
|
|
||||||
Now on KDE 6: https://www.pling.com/p/2195583/
|
https://www.pling.com/p/2195583/
|
||||||
|
|
||||||
> Too little too late but I plan to update it regularly now if any issues are created - ruinivist
|
> I think this is pretty much in a "done" state now feature-wise, except of course any bug fixes
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -50,48 +50,6 @@ Create a distributable package:
|
|||||||
make package
|
make package
|
||||||
```
|
```
|
||||||
|
|
||||||
The package is written to `build/org.ruiny.NowPlaying.plasmoid`.
|
|
||||||
|
|
||||||
## Project Structure
|
|
||||||
|
|
||||||
```text
|
|
||||||
.
|
|
||||||
├── package/
|
|
||||||
│ ├── metadata.json
|
|
||||||
│ └── contents/
|
|
||||||
│ ├── config/
|
|
||||||
│ │ ├── config.qml
|
|
||||||
│ │ └── main.xml
|
|
||||||
│ └── ui/
|
|
||||||
│ ├── configGeneral.qml
|
|
||||||
│ ├── main.qml
|
|
||||||
│ ├── Player.qml
|
|
||||||
│ └── Representation.qml
|
|
||||||
├── scripts/
|
|
||||||
│ └── watch.sh
|
|
||||||
└── Makefile
|
|
||||||
```
|
|
||||||
|
|
||||||
## Maintenance
|
|
||||||
|
|
||||||
Format files:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make format
|
|
||||||
```
|
|
||||||
|
|
||||||
Run lint checks:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make lint
|
|
||||||
```
|
|
||||||
|
|
||||||
Enable the repository pre-commit hook:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make hooks-install
|
|
||||||
```
|
|
||||||
|
|
||||||
## Customization
|
## Customization
|
||||||
|
|
||||||
The widget appearance can be tuned from the Plasma widget settings, including:
|
The widget appearance can be tuned from the Plasma widget settings, including:
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ PLAYING]]></default>
|
|||||||
<label>Source priority</label>
|
<label>Source priority</label>
|
||||||
<default></default>
|
<default></default>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry name="sourceWhitelist" type="Bool">
|
||||||
|
<label>Only use listed sources</label>
|
||||||
|
<default>false</default>
|
||||||
|
</entry>
|
||||||
<entry name="trackTextVerticalSpacing" type="Int">
|
<entry name="trackTextVerticalSpacing" type="Int">
|
||||||
<label>Track text vertical spacing</label>
|
<label>Track text vertical spacing</label>
|
||||||
<default>5</default>
|
<default>5</default>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ QtObject {
|
|||||||
readonly property int containerRole: Qt.UserRole + 1
|
readonly property int containerRole: Qt.UserRole + 1
|
||||||
property string sourceName: "any"
|
property string sourceName: "any"
|
||||||
property string sourcePriority: ""
|
property string sourcePriority: ""
|
||||||
|
property bool sourceWhitelist: false
|
||||||
property var mpris2Model
|
property var mpris2Model
|
||||||
property int modelRevision: 0
|
property int modelRevision: 0
|
||||||
readonly property var normalizedSourcePriority: parseSourcePriority(sourcePriority)
|
readonly property var normalizedSourcePriority: parseSourcePriority(sourcePriority)
|
||||||
@@ -99,6 +100,9 @@ QtObject {
|
|||||||
return matchedPlayer;
|
return matchedPlayer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (sourceWhitelist && normalizedSourcePriority.length > 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
return mpris2Model.currentPlayer || null;
|
return mpris2Model.currentPlayer || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ KCM.SimpleKCM {
|
|||||||
property alias cfg_textShadowEnabled: textShadowCheckBox.checked
|
property alias cfg_textShadowEnabled: textShadowCheckBox.checked
|
||||||
property alias cfg_showMediaControls: showMediaControlsCheckBox.checked
|
property alias cfg_showMediaControls: showMediaControlsCheckBox.checked
|
||||||
property alias cfg_sourcePriority: sourcePriorityField.text
|
property alias cfg_sourcePriority: sourcePriorityField.text
|
||||||
|
property alias cfg_sourceWhitelist: sourceWhitelistCheckBox.checked
|
||||||
property alias cfg_trackTextVerticalSpacing: trackTextVerticalSpacingSpinBox.value
|
property alias cfg_trackTextVerticalSpacing: trackTextVerticalSpacingSpinBox.value
|
||||||
property alias cfg_labelVerticalSpacing: labelVerticalSpacingSpinBox.value
|
property alias cfg_labelVerticalSpacing: labelVerticalSpacingSpinBox.value
|
||||||
property alias cfg_separatorGapLabel: separatorGapLabelSpinBox.value
|
property alias cfg_separatorGapLabel: separatorGapLabelSpinBox.value
|
||||||
@@ -59,6 +60,9 @@ KCM.SimpleKCM {
|
|||||||
"text": i18n("Solid background"),
|
"text": i18n("Solid background"),
|
||||||
"value": "default"
|
"value": "default"
|
||||||
}]
|
}]
|
||||||
|
readonly property bool hasSourcePriorityEntries: sourcePriorityField.text.split(",").some((entry) => {
|
||||||
|
return normalizeDesktopEntry(entry).length > 0;
|
||||||
|
})
|
||||||
|
|
||||||
function syncComboByValue(comboBox, options, configuredValue, fallbackValue) {
|
function syncComboByValue(comboBox, options, configuredValue, fallbackValue) {
|
||||||
const requestedValue = configuredValue || fallbackValue;
|
const requestedValue = configuredValue || fallbackValue;
|
||||||
@@ -97,6 +101,7 @@ KCM.SimpleKCM {
|
|||||||
detectedSources = sources;
|
detectedSources = sources;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: cfg_sourceWhitelist = hasSourcePriorityEntries && cfg_sourceWhitelist
|
||||||
onCfg_fontFamilyChanged: {
|
onCfg_fontFamilyChanged: {
|
||||||
const index = availableFonts.indexOf(cfg_fontFamily);
|
const index = availableFonts.indexOf(cfg_fontFamily);
|
||||||
if (index >= 0 && fontFamilyComboBox.currentIndex !== index)
|
if (index >= 0 && fontFamilyComboBox.currentIndex !== index)
|
||||||
@@ -222,7 +227,16 @@ KCM.SimpleKCM {
|
|||||||
|
|
||||||
Kirigami.FormData.label: i18n("Source priority:")
|
Kirigami.FormData.label: i18n("Source priority:")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: i18n("spotify, firefox")
|
placeholderText: i18n("example: spotify, firefox")
|
||||||
|
onTextChanged: configRoot.cfg_sourceWhitelist = configRoot.hasSourcePriorityEntries && configRoot.cfg_sourceWhitelist
|
||||||
|
}
|
||||||
|
|
||||||
|
QQC2.CheckBox {
|
||||||
|
id: sourceWhitelistCheckBox
|
||||||
|
|
||||||
|
Kirigami.FormData.label: ""
|
||||||
|
text: i18n("Only use listed sources")
|
||||||
|
enabled: configRoot.hasSourcePriorityEntries
|
||||||
}
|
}
|
||||||
|
|
||||||
QQC2.Label {
|
QQC2.Label {
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ PlasmoidItem {
|
|||||||
// qmllint disable missing-property
|
// qmllint disable missing-property
|
||||||
property string configuredSourcePriority: plasmoid.configuration.sourcePriority
|
property string configuredSourcePriority: plasmoid.configuration.sourcePriority
|
||||||
// qmllint disable missing-property
|
// qmllint disable missing-property
|
||||||
|
property bool configuredSourceWhitelist: plasmoid.configuration.sourceWhitelist
|
||||||
|
// qmllint disable missing-property
|
||||||
property int configuredTrackTextVerticalSpacing: plasmoid.configuration.trackTextVerticalSpacing
|
property int configuredTrackTextVerticalSpacing: plasmoid.configuration.trackTextVerticalSpacing
|
||||||
// qmllint disable missing-property
|
// qmllint disable missing-property
|
||||||
property int configuredLabelVerticalSpacing: plasmoid.configuration.labelVerticalSpacing
|
property int configuredLabelVerticalSpacing: plasmoid.configuration.labelVerticalSpacing
|
||||||
@@ -77,6 +79,7 @@ PlasmoidItem {
|
|||||||
id: player
|
id: player
|
||||||
|
|
||||||
sourcePriority: root.configuredSourcePriority
|
sourcePriority: root.configuredSourcePriority
|
||||||
|
sourceWhitelist: root.configuredSourceWhitelist
|
||||||
}
|
}
|
||||||
|
|
||||||
fullRepresentation: Representation {
|
fullRepresentation: Representation {
|
||||||
|
|||||||
Reference in New Issue
Block a user