config: add audio increment option
This commit is contained in:
parent
a7990173b4
commit
26171548bf
6 changed files with 17 additions and 6 deletions
|
|
@ -225,6 +225,7 @@ All configuration options are in `~/.config/caelestia/shell.json`.
|
|||
"wallpaperDir": "~/Pictures/Wallpapers"
|
||||
},
|
||||
"services": {
|
||||
"audioIncrement": 0.1,
|
||||
"weatherLocation": "10,10",
|
||||
"useFahrenheit": false,
|
||||
"useTwelveHourClock": false
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@ JsonObject {
|
|||
property string weatherLocation: "" // A lat,long pair or empty for autodetection, e.g. "37.8267,-122.4233"
|
||||
property bool useFahrenheit: [Locale.ImperialUSSystem, Locale.ImperialSystem].includes(Qt.locale().measurementSystem)
|
||||
property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a")
|
||||
property real audioIncrement: 0.1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ Item {
|
|||
|
||||
function onWheel(event: WheelEvent): void {
|
||||
if (event.angleDelta.y > 0)
|
||||
Audio.setVolume(Audio.volume + 0.1);
|
||||
Audio.incrementVolume();
|
||||
else if (event.angleDelta.y < 0)
|
||||
Audio.setVolume(Audio.volume - 0.1);
|
||||
Audio.decrementVolume();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ Item {
|
|||
|
||||
onWheel: event => {
|
||||
if (event.angleDelta.y > 0)
|
||||
Audio.setVolume(Audio.volume + 0.1);
|
||||
Audio.incrementVolume();
|
||||
else if (event.angleDelta.y < 0)
|
||||
Audio.setVolume(Audio.volume - 0.1);
|
||||
Audio.decrementVolume();
|
||||
}
|
||||
|
||||
StyledSlider {
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ Column {
|
|||
|
||||
onWheel: event => {
|
||||
if (event.angleDelta.y > 0)
|
||||
Audio.setVolume(Audio.volume + 0.1);
|
||||
Audio.incrementVolume();
|
||||
else if (event.angleDelta.y < 0)
|
||||
Audio.setVolume(Audio.volume - 0.1);
|
||||
Audio.decrementVolume();
|
||||
}
|
||||
|
||||
FilledSlider {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
pragma Singleton
|
||||
|
||||
import qs.config
|
||||
import Quickshell
|
||||
import Quickshell.Services.Pipewire
|
||||
|
||||
|
|
@ -35,6 +36,14 @@ Singleton {
|
|||
}
|
||||
}
|
||||
|
||||
function incrementVolume(amount: real): void {
|
||||
setVolume(volume + (amount || Config.services.audioIncrement));
|
||||
}
|
||||
|
||||
function decrementVolume(amount: real): void {
|
||||
setVolume(volume - (amount || Config.services.audioIncrement));
|
||||
}
|
||||
|
||||
function setAudioSink(newSink: PwNode): void {
|
||||
Pipewire.preferredDefaultAudioSink = newSink;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue