forked from Shinonome/dots-hyprland
Decrease gamma when brightness is requested to go lower beyond 0
This commit is contained in:
@@ -28,6 +28,12 @@ Singleton {
|
||||
}
|
||||
|
||||
function increaseBrightness(): void {
|
||||
// if gamma is not yet 100, first increase gamma
|
||||
if (Hyprsunset.gamma !== 100) {
|
||||
Hyprsunset.setGamma(Hyprsunset.gamma + 5);
|
||||
return;
|
||||
}
|
||||
|
||||
const focusedName = Hyprland.focusedMonitor.name;
|
||||
const monitor = monitors.find(m => focusedName === m.screen.name);
|
||||
if (monitor)
|
||||
@@ -37,8 +43,12 @@ Singleton {
|
||||
function decreaseBrightness(): void {
|
||||
const focusedName = Hyprland.focusedMonitor.name;
|
||||
const monitor = monitors.find(m => focusedName === m.screen.name);
|
||||
if (monitor)
|
||||
if (monitor && monitor.brightness > 0)
|
||||
monitor.setBrightness(monitor.brightness - 0.05);
|
||||
// if brightness is 0, then decrease gamma
|
||||
else {
|
||||
Hyprsunset.setGamma(Hyprsunset.gamma - 5);
|
||||
}
|
||||
}
|
||||
|
||||
reloadableId: "brightness"
|
||||
|
||||
Reference in New Issue
Block a user