Update quickslider to also decrease gamma when brightness is at 0

This commit is contained in:
altrup
2026-03-22 17:44:30 -04:00
parent 973b83bc15
commit a28ed6023e
2 changed files with 47 additions and 35 deletions
@@ -80,28 +80,21 @@ Singleton {
}
}
function load() { } // Dummy to force init
function load() {
Quickshell.execDetached(["bash", "-c", `pidof hyprsunset || hyprsunset`]);
}
function enableTemperature() {
root.temperatureActive = true;
// console.log("[Hyprsunset] Enabling");
Quickshell.execDetached(["bash", "-c", `
if pidof hyprsunset > /dev/null; then
hyprctl hyprsunset temperature ${root.colorTemperature};
else
hyprsunset --temperature ${root.colorTemperature};
fi
`]);
root.load();
Quickshell.execDetached(["bash", "-c", `hyprctl hyprsunset temperature ${root.colorTemperature}`]);
}
function disableTemperature() {
root.temperatureActive = false;
// console.log("[Hyprsunset] Disabling");
if (root.gamma === 100) {
Quickshell.execDetached(["bash", "-c", `pkill hyprsunset`]);
} else {
Quickshell.execDetached(["hyprctl", "hyprsunset", "identity"]);
}
Quickshell.execDetached(["hyprctl", "hyprsunset", "identity"]);
}
function setGamma(gamma) {
@@ -109,22 +102,8 @@ Singleton {
root.gammaChangeAttempt();
if (root.gamma !== 100) {
// console.log("[Hyprsunset] Enabling");
Quickshell.execDetached(["bash", "-c", `
if pidof hyprsunset > /dev/null; then
hyprctl hyprsunset gamma ${root.gamma};
else
hyprsunset --gamma ${root.gamma};
fi
`]);
} else {
if (!root.temperatureActive) {
Quickshell.execDetached(["bash", "-c", `pkill hyprsunset`]);
} else {
Quickshell.execDetached(["hyprctl", "hyprsunset", "gamma", "100"]);
}
}
root.load();
Quickshell.execDetached(["bash", "-c", `hyprctl hyprsunset gamma ${root.gamma}`]);
}
function fetchState() {