summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Seger <pixelkhaos@gmail.com>2025-10-13 13:50:56 +0200
committerGitHub <noreply@github.com>2025-10-13 22:50:56 +1100
commitdde0f85e78755fa50902f29a4bca6d29ae345867 (patch)
tree363a0e1d2c45add224ef974f270e76ac174c50d4
parent[CI] chore: update flake (diff)
downloadcaelestia-shell-dde0f85e78755fa50902f29a4bca6d29ae345867.tar.gz
caelestia-shell-dde0f85e78755fa50902f29a4bca6d29ae345867.tar.bz2
caelestia-shell-dde0f85e78755fa50902f29a4bca6d29ae345867.zip
feat: configurable max volume (#723)
* feat: configurable max volume - Add maxVolume config option to ServiceConfig - Add maxValue property to FilledSlider component - Update OSD sliders to respect maxVolume setting - Update example config in README * fix: remove redundant maxValue prop
-rw-r--r--README.md1
-rw-r--r--config/ServiceConfig.qml1
-rw-r--r--modules/osd/Content.qml2
-rw-r--r--services/Audio.qml4
4 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index 1daa22a..d8be30a 100644
--- a/README.md
+++ b/README.md
@@ -546,6 +546,7 @@ default, you must create it manually.
},
"services": {
"audioIncrement": 0.1,
+ "maxVolume": 1.0,
"defaultPlayer": "Spotify",
"gpuType": "",
"playerAliases": [{ "from": "com.github.th_ch.youtube_music", "to": "YT Music" }],
diff --git a/config/ServiceConfig.qml b/config/ServiceConfig.qml
index c9752d7..36a51aa 100644
--- a/config/ServiceConfig.qml
+++ b/config/ServiceConfig.qml
@@ -8,6 +8,7 @@ JsonObject {
property string gpuType: ""
property int visualiserBars: 45
property real audioIncrement: 0.1
+ property real maxVolume: 1.0
property bool smartScheme: true
property string defaultPlayer: "Spotify"
property list<var> playerAliases: [
diff --git a/modules/osd/Content.qml b/modules/osd/Content.qml
index 639de77..619810f 100644
--- a/modules/osd/Content.qml
+++ b/modules/osd/Content.qml
@@ -46,6 +46,7 @@ Item {
icon: Icons.getVolumeIcon(value, root.muted)
value: root.volume
+ to: Config.services.maxVolume
onMoved: Audio.setVolume(value)
}
}
@@ -70,6 +71,7 @@ Item {
icon: Icons.getMicVolumeIcon(value, root.sourceMuted)
value: root.sourceVolume
+ to: Config.services.maxVolume
onMoved: Audio.setSourceVolume(value)
}
}
diff --git a/services/Audio.qml b/services/Audio.qml
index bc87d46..71ccb86 100644
--- a/services/Audio.qml
+++ b/services/Audio.qml
@@ -44,7 +44,7 @@ Singleton {
function setVolume(newVolume: real): void {
if (sink?.ready && sink?.audio) {
sink.audio.muted = false;
- sink.audio.volume = Math.max(0, Math.min(1, newVolume));
+ sink.audio.volume = Math.max(0, Math.min(Config.services.maxVolume, newVolume));
}
}
@@ -59,7 +59,7 @@ Singleton {
function setSourceVolume(newVolume: real): void {
if (source?.ready && source?.audio) {
source.audio.muted = false;
- source.audio.volume = Math.max(0, Math.min(1, newVolume));
+ source.audio.volume = Math.max(0, Math.min(Config.services.maxVolume, newVolume));
}
}