From 4caa59dd9e2da6e0d9290094b7866cc6b2f70467 Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Sun, 22 Mar 2026 16:36:17 -0400 Subject: [PATCH 01/16] Decrease gamma when brightness is requested to go lower beyond 0 --- .../models/hyprland/HyprlandConfigOption.qml | 2 +- .../models/quickToggles/NightLightToggle.qml | 4 +- .../indicators/BrightnessIndicator.qml | 2 +- .../nightLight/NightLightDialog.qml | 4 +- .../quickToggles/classicStyle/NightLight.qml | 4 +- .../nightLight/NightLightControl.qml | 4 +- .../ii/modules/waffle/looks/WIcons.qml | 2 +- .../quickshell/ii/services/Brightness.qml | 12 +++- .../quickshell/ii/services/Hyprsunset.qml | 68 ++++++++++++++----- 9 files changed, 72 insertions(+), 30 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/models/hyprland/HyprlandConfigOption.qml b/dots/.config/quickshell/ii/modules/common/models/hyprland/HyprlandConfigOption.qml index 0422aab02..3219a8a12 100644 --- a/dots/.config/quickshell/ii/modules/common/models/hyprland/HyprlandConfigOption.qml +++ b/dots/.config/quickshell/ii/modules/common/models/hyprland/HyprlandConfigOption.qml @@ -3,7 +3,7 @@ import QtQml import QtQuick import Quickshell.Io import qs.services -import "../" +import ".." NestableObject { id: root diff --git a/dots/.config/quickshell/ii/modules/common/models/quickToggles/NightLightToggle.qml b/dots/.config/quickshell/ii/modules/common/models/quickToggles/NightLightToggle.qml index d53af9740..f71c97ee9 100644 --- a/dots/.config/quickshell/ii/modules/common/models/quickToggles/NightLightToggle.qml +++ b/dots/.config/quickshell/ii/modules/common/models/quickToggles/NightLightToggle.qml @@ -12,11 +12,11 @@ QuickToggleModel { name: Translation.tr("Night Light") statusText: (auto ? Translation.tr("Auto, ") : "") + (toggled ? Translation.tr("Active") : Translation.tr("Inactive")) - toggled: Hyprsunset.active + toggled: Hyprsunset.temperatureActive icon: auto ? "night_sight_auto" : "bedtime" mainAction: () => { - Hyprsunset.toggle() + Hyprsunset.toggleTemperature() } hasMenu: true diff --git a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/BrightnessIndicator.qml b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/BrightnessIndicator.qml index fbdbd7152..a4381757c 100644 --- a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/BrightnessIndicator.qml +++ b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/BrightnessIndicator.qml @@ -9,7 +9,7 @@ OsdValueIndicator { property var focusedScreen: Quickshell.screens.find(s => s.name === Hyprland.focusedMonitor?.name) property var brightnessMonitor: Brightness.getMonitorForScreen(focusedScreen) - icon: Hyprsunset.active ? "routine" : "light_mode" + icon: Hyprsunset.temperatureActive ? "routine" : "light_mode" rotateIcon: true scaleIcon: true name: Translation.tr("Brightness") diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml index e6f7509f2..6ad9307cb 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml @@ -44,9 +44,9 @@ WindowDialog { iconSize: Appearance.font.pixelSize.larger buttonIcon: "check" text: Translation.tr("Enable now") - checked: Hyprsunset.active + checked: Hyprsunset.temperatureActive onCheckedChanged: { - Hyprsunset.toggle(checked) + Hyprsunset.toggleTemperature(checked) } } diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/quickToggles/classicStyle/NightLight.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/quickToggles/classicStyle/NightLight.qml index 8b7e69a5a..7fa6f18ae 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/quickToggles/classicStyle/NightLight.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/quickToggles/classicStyle/NightLight.qml @@ -6,10 +6,10 @@ import Quickshell.Io QuickToggleButton { id: nightLightButton - toggled: Hyprsunset.active + toggled: Hyprsunset.temperatureActive buttonIcon: Config.options.light.night.automatic ? "night_sight_auto" : "bedtime" onClicked: { - Hyprsunset.toggle() + Hyprsunset.toggleTemperature() } altAction: () => { diff --git a/dots/.config/quickshell/ii/modules/waffle/actionCenter/nightLight/NightLightControl.qml b/dots/.config/quickshell/ii/modules/waffle/actionCenter/nightLight/NightLightControl.qml index 591e56399..09d00fda9 100644 --- a/dots/.config/quickshell/ii/modules/waffle/actionCenter/nightLight/NightLightControl.qml +++ b/dots/.config/quickshell/ii/modules/waffle/actionCenter/nightLight/NightLightControl.qml @@ -87,9 +87,9 @@ Item { name: Translation.tr("Enable now") description: Translation.tr("More comfortable viewing at night") iconName: WIcons.nightLightIcon - checked: Hyprsunset.active + checked: Hyprsunset.temperatureActive onCheckedChanged: { - Hyprsunset.toggle(checked); + Hyprsunset.toggleTemperature(checked); } } diff --git a/dots/.config/quickshell/ii/modules/waffle/looks/WIcons.qml b/dots/.config/quickshell/ii/modules/waffle/looks/WIcons.qml index b804aa3d9..ce026da29 100644 --- a/dots/.config/quickshell/ii/modules/waffle/looks/WIcons.qml +++ b/dots/.config/quickshell/ii/modules/waffle/looks/WIcons.qml @@ -71,7 +71,7 @@ Singleton { property string bluetoothIcon: BluetoothStatus.connected ? "bluetooth-connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth-disabled" - property string nightLightIcon: Hyprsunset.active ? "weather-moon" : "weather-moon-off" + property string nightLightIcon: Hyprsunset.temperatureActive ? "weather-moon" : "weather-moon-off" property string notificationsIcon: Notifications.silent ? "alert-snooze" : "alert" diff --git a/dots/.config/quickshell/ii/services/Brightness.qml b/dots/.config/quickshell/ii/services/Brightness.qml index b0c7f303e..939bc37d8 100644 --- a/dots/.config/quickshell/ii/services/Brightness.qml +++ b/dots/.config/quickshell/ii/services/Brightness.qml @@ -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" diff --git a/dots/.config/quickshell/ii/services/Hyprsunset.qml b/dots/.config/quickshell/ii/services/Hyprsunset.qml index 8f0e36529..f1c17025e 100644 --- a/dots/.config/quickshell/ii/services/Hyprsunset.qml +++ b/dots/.config/quickshell/ii/services/Hyprsunset.qml @@ -17,9 +17,10 @@ Singleton { property string to: Config.options?.light?.night?.to ?? "06:30" property bool automatic: Config.options?.light?.night?.automatic && (Config?.ready ?? true) property int colorTemperature: Config.options?.light?.night?.colorTemperature ?? 5000 + property int gamma: 100 property bool shouldBeOn property bool firstEvaluation: true - property bool active: false + property bool temperatureActive: false property int fromHour: Number(from.split(":")[0]) property int fromMinute: Number(from.split(":")[1]) @@ -71,24 +72,55 @@ Singleton { if (!root.automatic || root.manualActive !== undefined) return; if (root.shouldBeOn) { - root.enable(); + root.enableTemperature(); } else { - root.disable(); + root.disableTemperature(); } } function load() { } // Dummy to force init - function enable() { - root.active = true; + function enableTemperature() { + root.temperatureActive = true; // console.log("[Hyprsunset] Enabling"); - Quickshell.execDetached(["bash", "-c", `pidof hyprsunset || hyprsunset --temperature ${root.colorTemperature}`]); + Quickshell.execDetached(["bash", "-c", ` + if pidof hyprsunset > /dev/null; then + hyprctl hyprsunset temperature ${root.colorTemperature}; + else + hyprsunset --temperature ${root.colorTemperature}; + fi + `]); } - function disable() { - root.active = false; + function disableTemperature() { + root.temperatureActive = false; // console.log("[Hyprsunset] Disabling"); - Quickshell.execDetached(["bash", "-c", `pkill hyprsunset`]); + if (root.gamma === 100) { + Quickshell.execDetached(["bash", "-c", `pkill hyprsunset`]); + } else { + Quickshell.execDetached(["hyprctl", "hyprsunset", "identity"]); + } + } + + function setGamma(gamma) { + root.gamma = Math.max(0, Math.min(100, gamma)); + + 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"]); + } + } } function fetchState() { @@ -104,26 +136,26 @@ Singleton { onStreamFinished: { const output = stateCollector.text.trim(); if (output.length == 0 || output.startsWith("Couldn't")) - root.active = false; + root.temperatureActive = false; else - root.active = (output != "6500"); // 6500 is the default when off - // console.log("[Hyprsunset] Fetched state:", output, "->", root.active); + root.temperatureActive = (output != "6500"); // 6500 is the default when off + // console.log("[Hyprsunset] Fetched state:", output, "->", root.temperatureActive); } } } - function toggle(active = undefined) { + function toggleTemperature(active = undefined) { if (root.manualActive === undefined) { - root.manualActive = root.active; + root.manualActive = root.temperatureActive; root.manualActiveHour = root.clockHour; root.manualActiveMinute = root.clockMinute; } root.manualActive = active !== undefined ? active : !root.manualActive; if (root.manualActive) { - root.enable(); + root.enableTemperature(); } else { - root.disable(); + root.disableTemperature(); } } @@ -131,9 +163,9 @@ Singleton { Connections { target: Config.options.light.night function onColorTemperatureChanged() { - if (!root.active) return; + if (!root.temperatureActive) return; Hyprland.dispatch(`hyprctl hyprsunset temperature ${Config.options.light.night.colorTemperature}`); Quickshell.execDetached(["hyprctl", "hyprsunset", "temperature", `${Config.options.light.night.colorTemperature}`]); } } -} +} \ No newline at end of file From 9d065f2c8efab525b3c8919e5d8dafb134c50a8f Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Sun, 22 Mar 2026 16:37:25 -0400 Subject: [PATCH 02/16] Undo temp fix --- .../ii/modules/common/models/hyprland/HyprlandConfigOption.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dots/.config/quickshell/ii/modules/common/models/hyprland/HyprlandConfigOption.qml b/dots/.config/quickshell/ii/modules/common/models/hyprland/HyprlandConfigOption.qml index 3219a8a12..0422aab02 100644 --- a/dots/.config/quickshell/ii/modules/common/models/hyprland/HyprlandConfigOption.qml +++ b/dots/.config/quickshell/ii/modules/common/models/hyprland/HyprlandConfigOption.qml @@ -3,7 +3,7 @@ import QtQml import QtQuick import Quickshell.Io import qs.services -import ".." +import "../" NestableObject { id: root From 973b83bc155943b1c2b962a8d5c139f6faf51b01 Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Sun, 22 Mar 2026 16:52:35 -0400 Subject: [PATCH 03/16] Add gamma indicator --- .../modules/ii/onScreenDisplay/OnScreenDisplay.qml | 13 +++++++++++++ .../onScreenDisplay/indicators/GammaIndicator.qml | 14 ++++++++++++++ dots/.config/quickshell/ii/services/Hyprsunset.qml | 4 ++++ dots/.config/quickshell/ii/translations/en_US.json | 1 + 4 files changed, 32 insertions(+) create mode 100644 dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml diff --git a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OnScreenDisplay.qml b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OnScreenDisplay.qml index 21b9c4320..05bce49ae 100644 --- a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OnScreenDisplay.qml +++ b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OnScreenDisplay.qml @@ -25,6 +25,10 @@ Scope { id: "brightness", sourceUrl: "indicators/BrightnessIndicator.qml" }, + { + id: "gamma", + sourceUrl: "indicators/GammaIndicator.qml" + }, ] function triggerOsd() { @@ -52,6 +56,15 @@ Scope { } } + Connections { + target: Hyprsunset + function onGammaChangeAttempt() { + root.protectionMessage = ""; + root.currentIndicator = "gamma"; + root.triggerOsd(); + } + } + Connections { // Listen to volume changes target: Audio.sink?.audio ?? null diff --git a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml new file mode 100644 index 000000000..7dac9e84f --- /dev/null +++ b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml @@ -0,0 +1,14 @@ +import qs.services +import QtQuick +import Quickshell +import Quickshell.Hyprland +import qs.modules.ii.onScreenDisplay + +OsdValueIndicator { + id: rotateIcon + + icon: "wb_twilight" + scaleIcon: true + name: Translation.tr("Gamma") + value: Hyprsunset.gamma / 100 ?? 0.5 +} diff --git a/dots/.config/quickshell/ii/services/Hyprsunset.qml b/dots/.config/quickshell/ii/services/Hyprsunset.qml index f1c17025e..6af2d6da5 100644 --- a/dots/.config/quickshell/ii/services/Hyprsunset.qml +++ b/dots/.config/quickshell/ii/services/Hyprsunset.qml @@ -13,6 +13,8 @@ import Quickshell.Hyprland */ Singleton { id: root + signal gammaChangeAttempt() + property string from: Config.options?.light?.night?.from ?? "19:00" property string to: Config.options?.light?.night?.to ?? "06:30" property bool automatic: Config.options?.light?.night?.automatic && (Config?.ready ?? true) @@ -105,6 +107,8 @@ Singleton { function setGamma(gamma) { root.gamma = Math.max(0, Math.min(100, gamma)); + root.gammaChangeAttempt(); + if (root.gamma !== 100) { // console.log("[Hyprsunset] Enabling"); Quickshell.execDetached(["bash", "-c", ` diff --git a/dots/.config/quickshell/ii/translations/en_US.json b/dots/.config/quickshell/ii/translations/en_US.json index 82cae2c08..01569de04 100644 --- a/dots/.config/quickshell/ii/translations/en_US.json +++ b/dots/.config/quickshell/ii/translations/en_US.json @@ -81,6 +81,7 @@ "Unknown function call: %1": "Unknown function call: %1", "Online | %1's model | Delivers fast, responsive and well-formatted answers. Disadvantages: not very eager to do stuff; might make up unknown function calls": "Online | %1's model | Delivers fast, responsive and well-formatted answers. Disadvantages: not very eager to do stuff; might make up unknown function calls", "Volume": "Volume", + "Gamma": "Gamma", "Medium": "Medium", "Copy code": "Copy code", "Exceeded max allowed": "Exceeded max allowed", From a28ed6023ebbb778752048d0180ec4c33ad1471a Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Sun, 22 Mar 2026 17:44:30 -0400 Subject: [PATCH 04/16] Update quickslider to also decrease gamma when brightness is at 0 --- .../modules/ii/sidebarRight/QuickSliders.qml | 45 ++++++++++++++++--- .../quickshell/ii/services/Hyprsunset.qml | 37 ++++----------- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml index 26925001e..7983e6098 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml @@ -40,10 +40,24 @@ Rectangle { visible: active active: Config.options.sidebar.quickSliders.showBrightness sourceComponent: QuickSlider { - materialSymbol: "brightness_6" - value: root.brightnessMonitor.brightness + materialSymbol: "light_mode" + secondaryMaterialSymbol: "wb_twilight" + value: Hyprsunset.gamma === 100? 0.3 + root.brightnessMonitor.brightness * 0.7 : Hyprsunset.gamma / 100 * 0.3 + tooltipContent: Hyprsunset.gamma === 100 ? `${Math.round(root.brightnessMonitor.brightness * 100)}%` : `${Hyprsunset.gamma}%` onMoved: { - root.brightnessMonitor.setBrightness(value) + if (value >= 0.3) { + // 0.3 - 1.0 brightness + root.brightnessMonitor.setBrightness((value - 0.3) / 0.7); + if (Hyprsunset.gamma !== 100) { + Hyprsunset.setGamma(100); + } + } else { + // 0 - 0.3 gamma + if (root.brightnessMonitor.brightness !== 0) { + root.brightnessMonitor.setBrightness(0); + } + Hyprsunset.setGamma(value * 100 / 0.3); + } } } } @@ -84,6 +98,7 @@ Rectangle { component QuickSlider: StyledSlider { id: quickSlider required property string materialSymbol + property string secondaryMaterialSymbol configuration: StyledSlider.Configuration.M stopIndicatorValues: [] @@ -91,9 +106,9 @@ Rectangle { id: icon property bool nearFull: quickSlider.value >= 0.9 anchors { - verticalCenter: parent.verticalCenter - right: nearFull ? quickSlider.handle.right : parent.right - rightMargin: quickSlider.nearFull ? 14 : 8 + verticalCenter: quickSlider.verticalCenter + right: nearFull ? quickSlider.handle.right : quickSlider.right + rightMargin: nearFull ? 14 : 8 } iconSize: 20 color: nearFull ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSecondaryContainer @@ -105,7 +120,25 @@ Rectangle { Behavior on anchors.rightMargin { animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) } + } + MaterialSymbol { + id: secondaryIcon + visible: secondaryMaterialSymbol.length > 0 + property real iconLocation: 0.3 + property bool nearIcon: iconLocation - quickSlider.value <= 0.1 && iconLocation - quickSlider.value > -0.03 + anchors { + verticalCenter: quickSlider.verticalCenter + right: nearIcon ? quickSlider.handle.right : quickSlider.right + rightMargin: nearIcon ? 14 : (1 - iconLocation) * quickSlider.width + } + iconSize: 20 + color: quickSlider.value >= iconLocation - 0.1 ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSecondaryContainer + text: secondaryMaterialSymbol + + Behavior on color { + animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this) + } } } } diff --git a/dots/.config/quickshell/ii/services/Hyprsunset.qml b/dots/.config/quickshell/ii/services/Hyprsunset.qml index 6af2d6da5..5749ee251 100644 --- a/dots/.config/quickshell/ii/services/Hyprsunset.qml +++ b/dots/.config/quickshell/ii/services/Hyprsunset.qml @@ -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() { From fc7524a30f88ad6d468342a01a23bd28946ab418 Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Sun, 22 Mar 2026 18:02:00 -0400 Subject: [PATCH 05/16] Add gamma slider to night light dialog --- .../modules/ii/sidebarRight/QuickSliders.qml | 1 + .../nightLight/NightLightDialog.qml | 34 ++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml index 7983e6098..6c619abb7 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml @@ -42,6 +42,7 @@ Rectangle { sourceComponent: QuickSlider { materialSymbol: "light_mode" secondaryMaterialSymbol: "wb_twilight" + stopIndicatorValues: Hyprsunset.gamma !== 100 && root.brightnessMonitor.brightness !== 0 ? [0.3 + root.brightnessMonitor.brightness * 0.7] : [] value: Hyprsunset.gamma === 100? 0.3 + root.brightnessMonitor.brightness * 0.7 : Hyprsunset.gamma / 100 * 0.3 tooltipContent: Hyprsunset.gamma === 100 ? `${Math.round(root.brightnessMonitor.brightness * 100)}%` : `${Hyprsunset.gamma}%` onMoved: { diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml index 6ad9307cb..4f70983d9 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml @@ -15,7 +15,7 @@ WindowDialog { id: root property var screen: root.QsWindow.window?.screen property var brightnessMonitor: Brightness.getMonitorForScreen(screen) - backgroundHeight: 600 + backgroundHeight: 700 WindowDialogTitle { text: Translation.tr("Eye protection") @@ -146,6 +146,33 @@ WindowDialog { id: brightnessColumn Layout.topMargin: -16 Layout.fillWidth: true + + WindowDialogSlider { + anchors { + left: parent.left + right: parent.right + leftMargin: 4 + rightMargin: 4 + } + value: root.brightnessMonitor.brightness + onMoved: root.brightnessMonitor.setBrightness(value) + } + } + + WindowDialogSectionHeader { + text: Translation.tr("Gamma") + } + + WindowDialogSeparator { + Layout.topMargin: -22 + Layout.leftMargin: 0 + Layout.rightMargin: 0 + } + + Column { + id: gammaColumn + Layout.topMargin: -16 + Layout.fillWidth: true Layout.fillHeight: true WindowDialogSlider { @@ -155,9 +182,8 @@ WindowDialog { leftMargin: 4 rightMargin: 4 } - // text: Translation.tr("Brightness") - value: root.brightnessMonitor.brightness - onMoved: root.brightnessMonitor.setBrightness(value) + value: Hyprsunset.gamma / 100 + onMoved: Hyprsunset.setGamma(value * 100) } } From 065b34ccded029c38200a0a7bee987fed69f1437 Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Sun, 22 Mar 2026 23:05:09 -0400 Subject: [PATCH 06/16] Add divider to brightness quick slider --- .../modules/common/widgets/StyledSlider.qml | 134 +++++++++++------- .../modules/ii/sidebarRight/QuickSliders.qml | 5 +- 2 files changed, 85 insertions(+), 54 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml index 971a1eb10..4d373f928 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml @@ -17,6 +17,7 @@ Slider { id: root property list stopIndicatorValues: [1] + property list dividerValues: [] enum Configuration { Wavy = 4, XS = 12, @@ -45,6 +46,7 @@ Slider { property real handleHeight: (configuration === StyledSlider.Configuration.Wavy) ? 24 : Math.max(33, trackWidth + 9) property real handleWidth: root.pressed ? handlePressedWidth : handleDefaultWidth property real handleMargins: 4 + property real dividerMargins: 2 property real trackDotSize: 3 property bool usePercentTooltip: true property string tooltipContent: usePercentTooltip ? `${Math.round(((value - from) / (to - from)) * 100)}%` : `${Math.round(value)}` @@ -94,71 +96,99 @@ Slider { } background: Item { + id: background anchors.verticalCenter: parent.verticalCenter - width: parent.width + anchors.horizontalCenter: parent.horizontalCenter + width: root.effectiveDraggingWidth implicitHeight: trackWidth - + property var normalized: root.dividerValues.map(v => (v - root.from) / (root.to - root.from)) + property var leftValues: [0, ...normalized.filter(v => v < root.visualPosition), root.visualPosition] + property var rightValues: [root.visualPosition, ...normalized.filter(v => v > root.visualPosition), 1] + property var leftWidths: leftValues.map((v, i, a) => a[i + 1] - v).slice(0, -1) + property var rightWidths: rightValues.map((v, i, a) => a[i + 1] - v).slice(0, -1) + // Fill left - Loader { - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - } - width: root.handleMargins + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2 + root.handleMargins) - height: root.trackWidth - active: !root.wavy - sourceComponent: Rectangle { - color: root.highlightColor - topLeftRadius: root.trackRadius - bottomLeftRadius: root.trackRadius - topRightRadius: root.unsharpenRadius - bottomRightRadius: root.unsharpenRadius + Repeater { + model: background.leftWidths.length + + Loader { + required property real index + anchors { + verticalCenter: background.verticalCenter + } + property real leftMargin: index > 0 ? root.dividerMargins : 0 + property real rightMargin: index < background.leftWidths.length - 1 ? root.dividerMargins : root.handleMargins + x: background.leftValues[index] * root.effectiveDraggingWidth + leftMargin + width: background.leftWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === background.leftWidths.length - 1 ? handleWidth / 2 : 0) + height: root.trackWidth + active: !root.wavy + sourceComponent: Rectangle { + color: root.highlightColor + topLeftRadius: index === 0 ? root.trackRadius : root.unsharpenRadius + bottomLeftRadius: index === 0 ? root.trackRadius : root.unsharpenRadius + topRightRadius: root.unsharpenRadius + bottomRightRadius: root.unsharpenRadius + } } } - Loader { - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - } - width: root.handleMargins + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2 + root.handleMargins) - height: root.height - active: root.wavy - sourceComponent: WavyLine { - id: wavyFill - frequency: root.waveFrequency - fullLength: root.width - color: root.highlightColor - amplitudeMultiplier: root.wavy ? 0.5 : 0 - width: root.handleMargins + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2 + root.handleMargins) - height: root.trackWidth - Connections { - target: root - function onValueChanged() { wavyFill.requestPaint(); } - function onHighlightColorChanged() { wavyFill.requestPaint(); } + Repeater { + model: background.leftWidths.length + + Loader { + required property int index + anchors { + verticalCenter: background.verticalCenter } - FrameAnimation { - running: root.animateWave - onTriggered: { - wavyFill.requestPaint() + property real leftMargin: index > 0 ? root.dividerMargins : 0 + property real rightMargin: index < background.leftWidths.length - 1 ? root.dividerMargins : root.handleMargins + x: background.leftValues[index] * root.effectiveDraggingWidth + leftMargin + width: background.leftWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === background.leftWidths.length - 1 ? handleWidth / 2 : 0) + height: root.height + active: root.wavy + sourceComponent: WavyLine { + id: wavyFill + frequency: root.waveFrequency + fullLength: root.width + color: root.highlightColor + amplitudeMultiplier: root.wavy ? 0.5 : 0 + width: parent.width + height: root.trackWidth + Connections { + target: root + function onValueChanged() { wavyFill.requestPaint(); } + function onHighlightColorChanged() { wavyFill.requestPaint(); } + } + FrameAnimation { + running: root.animateWave + onTriggered: { + wavyFill.requestPaint() + } } } - } + } } // Fill right - Rectangle { - anchors { - verticalCenter: parent.verticalCenter - right: parent.right + Repeater { + model: background.rightWidths.length + + Rectangle { + required property int index + anchors { + verticalCenter: background.verticalCenter + } + property real leftMargin: index > 0 ? root.dividerMargins : root.handleMargins + property real rightMargin: index < background.rightWidths.length - 1 ? root.dividerMargins : 0 + x: background.rightValues[index] * root.effectiveDraggingWidth + leftMargin + (index === 0 ? handleWidth / 2 : 0) + width: background.rightWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === 0 ? handleWidth / 2 : 0) + height: trackWidth + color: root.trackColor + topRightRadius: index === background.rightWidths.length - 1 ? root.trackRadius : root.unsharpenRadius + bottomRightRadius: index === background.rightWidths.length - 1 ? root.trackRadius : root.unsharpenRadius + topLeftRadius: root.unsharpenRadius + bottomLeftRadius: root.unsharpenRadius } - width: root.handleMargins + ((1 - root.visualPosition) * root.effectiveDraggingWidth) - (root.handleWidth / 2 + root.handleMargins) - height: trackWidth - color: root.trackColor - topRightRadius: root.trackRadius - bottomRightRadius: root.trackRadius - topLeftRadius: root.unsharpenRadius - bottomLeftRadius: root.unsharpenRadius } // Stop indicators diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml index 6c619abb7..11651824b 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml @@ -102,6 +102,7 @@ Rectangle { property string secondaryMaterialSymbol configuration: StyledSlider.Configuration.M stopIndicatorValues: [] + dividerValues: secondaryMaterialSymbol.length > 0 ? [secondaryIcon.iconLocation] : [] MaterialSymbol { id: icon @@ -127,11 +128,11 @@ Rectangle { id: secondaryIcon visible: secondaryMaterialSymbol.length > 0 property real iconLocation: 0.3 - property bool nearIcon: iconLocation - quickSlider.value <= 0.1 && iconLocation - quickSlider.value > -0.03 + property bool nearIcon: iconLocation - quickSlider.value <= 0.1 && iconLocation - quickSlider.value > (quickSlider.rightPadding - 7) / quickSlider.effectiveDraggingWidth anchors { verticalCenter: quickSlider.verticalCenter right: nearIcon ? quickSlider.handle.right : quickSlider.right - rightMargin: nearIcon ? 14 : (1 - iconLocation) * quickSlider.width + rightMargin: nearIcon ? 14 : (1 - iconLocation) * quickSlider.width + 7 } iconSize: 20 color: quickSlider.value >= iconLocation - 0.1 ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSecondaryContainer From 3e0f480ce0748c1ec84e31ca2020510fb7ebc0d9 Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Sun, 22 Mar 2026 23:14:26 -0400 Subject: [PATCH 07/16] Add padding logic to background --- .../ii/modules/common/widgets/StyledSlider.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml index 4d373f928..7df9701f4 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml @@ -99,7 +99,7 @@ Slider { id: background anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: root.effectiveDraggingWidth + width: root.width implicitHeight: trackWidth property var normalized: root.dividerValues.map(v => (v - root.from) / (root.to - root.from)) property var leftValues: [0, ...normalized.filter(v => v < root.visualPosition), root.visualPosition] @@ -118,8 +118,8 @@ Slider { } property real leftMargin: index > 0 ? root.dividerMargins : 0 property real rightMargin: index < background.leftWidths.length - 1 ? root.dividerMargins : root.handleMargins - x: background.leftValues[index] * root.effectiveDraggingWidth + leftMargin - width: background.leftWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === background.leftWidths.length - 1 ? handleWidth / 2 : 0) + x: background.leftValues[index] * root.effectiveDraggingWidth + leftMargin + (index > 0 ? leftPadding : 0) + width: background.leftWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === background.leftWidths.length - 1 ? handleWidth / 2 : 0) + (index === 0 ? leftPadding : 0) height: root.trackWidth active: !root.wavy sourceComponent: Rectangle { @@ -142,8 +142,8 @@ Slider { } property real leftMargin: index > 0 ? root.dividerMargins : 0 property real rightMargin: index < background.leftWidths.length - 1 ? root.dividerMargins : root.handleMargins - x: background.leftValues[index] * root.effectiveDraggingWidth + leftMargin - width: background.leftWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === background.leftWidths.length - 1 ? handleWidth / 2 : 0) + x: background.leftValues[index] * root.effectiveDraggingWidth + leftMargin + (index > 0 ? leftPadding : 0) + width: background.leftWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === background.leftWidths.length - 1 ? handleWidth / 2 : 0) + (index === 0 ? leftPadding : 0) height: root.height active: root.wavy sourceComponent: WavyLine { @@ -180,8 +180,8 @@ Slider { } property real leftMargin: index > 0 ? root.dividerMargins : root.handleMargins property real rightMargin: index < background.rightWidths.length - 1 ? root.dividerMargins : 0 - x: background.rightValues[index] * root.effectiveDraggingWidth + leftMargin + (index === 0 ? handleWidth / 2 : 0) - width: background.rightWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === 0 ? handleWidth / 2 : 0) + x: background.rightValues[index] * root.effectiveDraggingWidth + leftMargin + (index === 0 ? handleWidth / 2 : 0) + leftPadding + width: background.rightWidths[index] * root.effectiveDraggingWidth - leftMargin - rightMargin - (index === 0 ? handleWidth / 2 : 0) + (index === background.rightWidths.length - 1 ? rightPadding : 0) height: trackWidth color: root.trackColor topRightRadius: index === background.rightWidths.length - 1 ? root.trackRadius : root.unsharpenRadius @@ -207,7 +207,7 @@ Slider { implicitWidth: root.handleWidth implicitHeight: root.handleHeight - x: root.handleMargins + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2) + x: leftPadding + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2) anchors.verticalCenter: parent.verticalCenter radius: Appearance.rounding.full color: root.handleColor From e06a3be7264c817b4e1acf1e661d83aed80c8f4d Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Sun, 22 Mar 2026 23:38:21 -0400 Subject: [PATCH 08/16] Fix small visual bug when slider goes over divider --- .../quickshell/ii/modules/common/widgets/StyledSlider.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml index 7df9701f4..b17afd86b 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml @@ -102,8 +102,9 @@ Slider { width: root.width implicitHeight: trackWidth property var normalized: root.dividerValues.map(v => (v - root.from) / (root.to - root.from)) - property var leftValues: [0, ...normalized.filter(v => v < root.visualPosition), root.visualPosition] - property var rightValues: [root.visualPosition, ...normalized.filter(v => v > root.visualPosition), 1] + property var filtered: normalized.filter(v => Math.abs(v - root.visualPosition) * effectiveDraggingWidth > handleMargins + handleWidth / 2 - dividerMargins) + property var leftValues: [0, ...filtered.filter(v => v < root.visualPosition), root.visualPosition] + property var rightValues: [root.visualPosition, ...filtered.filter(v => v > root.visualPosition), 1] property var leftWidths: leftValues.map((v, i, a) => a[i + 1] - v).slice(0, -1) property var rightWidths: rightValues.map((v, i, a) => a[i + 1] - v).slice(0, -1) From deadf6cc4f51079c03fc9ed996bb3ecfe55deafe Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:54:19 -0400 Subject: [PATCH 09/16] Fix math for quickslider icon changing sides of handle --- .../quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml index 11651824b..d7e0a0b57 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml @@ -128,11 +128,11 @@ Rectangle { id: secondaryIcon visible: secondaryMaterialSymbol.length > 0 property real iconLocation: 0.3 - property bool nearIcon: iconLocation - quickSlider.value <= 0.1 && iconLocation - quickSlider.value > (quickSlider.rightPadding - 7) / quickSlider.effectiveDraggingWidth + property bool nearIcon: iconLocation - quickSlider.value <= 0.1 && iconLocation - quickSlider.value > (quickSlider.handleWidth + 8 - 14) / quickSlider.effectiveDraggingWidth anchors { verticalCenter: quickSlider.verticalCenter right: nearIcon ? quickSlider.handle.right : quickSlider.right - rightMargin: nearIcon ? 14 : (1 - iconLocation) * quickSlider.width + 7 + rightMargin: nearIcon ? 14 : (1 - iconLocation) * quickSlider.effectiveDraggingWidth + quickSlider.rightPadding + 8 } iconSize: 20 color: quickSlider.value >= iconLocation - 0.1 ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSecondaryContainer From 78c6e3c16f88f9bb77d25313f0174850a2aac15e Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Mon, 23 Mar 2026 22:15:25 -0400 Subject: [PATCH 10/16] Fix hyprsunset config not applying on launch --- .../quickshell/ii/services/Hyprsunset.qml | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/dots/.config/quickshell/ii/services/Hyprsunset.qml b/dots/.config/quickshell/ii/services/Hyprsunset.qml index 5749ee251..c9fac1a6d 100644 --- a/dots/.config/quickshell/ii/services/Hyprsunset.qml +++ b/dots/.config/quickshell/ii/services/Hyprsunset.qml @@ -80,14 +80,30 @@ Singleton { } } - function load() { + function startHyprsunset() { Quickshell.execDetached(["bash", "-c", `pidof hyprsunset || hyprsunset`]); } + function load() { + root.startHyprsunset(); + updateHyprsunset.restart(); + } + + Timer { + id: updateHyprsunset + interval: 100 + repeat: false + onTriggered: { + root.ensureState(); + root.setGamma(root.gamma); + } + } + function enableTemperature() { root.temperatureActive = true; + // console.log("[Hyprsunset] Enabling"); - root.load(); + root.startHyprsunset(); Quickshell.execDetached(["bash", "-c", `hyprctl hyprsunset temperature ${root.colorTemperature}`]); } @@ -102,7 +118,7 @@ Singleton { root.gammaChangeAttempt(); - root.load(); + root.startHyprsunset(); Quickshell.execDetached(["bash", "-c", `hyprctl hyprsunset gamma ${root.gamma}`]); } From 72b8b7aecb3f6af7e72e6e0ad3282942d0bc2c70 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 24 Mar 2026 17:16:03 +0100 Subject: [PATCH 11/16] fix bar scrolls not also changing gamma --- dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml | 4 ++-- .../quickshell/ii/modules/ii/screenCorners/ScreenCorners.qml | 4 ++-- .../ii/modules/ii/verticalBar/VerticalBarContent.qml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml b/dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml index 2a72e3382..d8bf9a34b 100644 --- a/dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml +++ b/dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml @@ -59,8 +59,8 @@ Item { // Bar content region implicitWidth: leftSectionRowLayout.implicitWidth implicitHeight: Appearance.sizes.baseBarHeight - onScrollDown: root.brightnessMonitor.setBrightness(root.brightnessMonitor.brightness - 0.05) - onScrollUp: root.brightnessMonitor.setBrightness(root.brightnessMonitor.brightness + 0.05) + onScrollDown: Brightness.decreaseBrightness() + onScrollUp: Brightness.increaseBrightness() onMovedAway: GlobalStates.osdBrightnessOpen = false onPressed: event => { if (event.button === Qt.LeftButton) diff --git a/dots/.config/quickshell/ii/modules/ii/screenCorners/ScreenCorners.qml b/dots/.config/quickshell/ii/modules/ii/screenCorners/ScreenCorners.qml index cbb8087ae..1e1ec07ba 100644 --- a/dots/.config/quickshell/ii/modules/ii/screenCorners/ScreenCorners.qml +++ b/dots/.config/quickshell/ii/modules/ii/screenCorners/ScreenCorners.qml @@ -98,7 +98,7 @@ Scope { if (!Config.options.sidebar.cornerOpen.valueScroll) return; if (cornerWidget.isLeft) - cornerPanelWindow.brightnessMonitor.setBrightness(cornerPanelWindow.brightnessMonitor.brightness - 0.05); + Brightness.decreaseBrightness() else { const currentVolume = Audio.value; const step = currentVolume < 0.1 ? 0.01 : 0.02 || 0.2; @@ -109,7 +109,7 @@ Scope { if (!Config.options.sidebar.cornerOpen.valueScroll) return; if (cornerWidget.isLeft) - cornerPanelWindow.brightnessMonitor.setBrightness(cornerPanelWindow.brightnessMonitor.brightness + 0.05); + Brightness.increaseBrightness() else { const currentVolume = Audio.value; const step = currentVolume < 0.1 ? 0.01 : 0.02 || 0.2; diff --git a/dots/.config/quickshell/ii/modules/ii/verticalBar/VerticalBarContent.qml b/dots/.config/quickshell/ii/modules/ii/verticalBar/VerticalBarContent.qml index 69ffc4bbe..4e34d421a 100644 --- a/dots/.config/quickshell/ii/modules/ii/verticalBar/VerticalBarContent.qml +++ b/dots/.config/quickshell/ii/modules/ii/verticalBar/VerticalBarContent.qml @@ -54,8 +54,8 @@ Item { // Bar content region height: (root.height - middleSection.height) / 2 width: Appearance.sizes.verticalBarWidth - onScrollDown: root.brightnessMonitor.setBrightness(root.brightnessMonitor.brightness - 0.05) - onScrollUp: root.brightnessMonitor.setBrightness(root.brightnessMonitor.brightness + 0.05) + onScrollDown: Brightness.decreaseBrightness() + onScrollUp: Brightness.increaseBrightness() onMovedAway: GlobalStates.osdBrightnessOpen = false onPressed: event => { if (event.button === Qt.LeftButton) From 8f66afe1090d36608112192717bcedf1213c63bf Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 24 Mar 2026 17:17:01 +0100 Subject: [PATCH 12/16] minor formatting fix --- .../quickshell/ii/modules/common/widgets/StyledSlider.qml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml index b17afd86b..66c6ee0af 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml @@ -176,9 +176,7 @@ Slider { Rectangle { required property int index - anchors { - verticalCenter: background.verticalCenter - } + anchors.verticalCenter: background.verticalCenter property real leftMargin: index > 0 ? root.dividerMargins : root.handleMargins property real rightMargin: index < background.rightWidths.length - 1 ? root.dividerMargins : 0 x: background.rightValues[index] * root.effectiveDraggingWidth + leftMargin + (index === 0 ? handleWidth / 2 : 0) + leftPadding @@ -208,7 +206,7 @@ Slider { implicitWidth: root.handleWidth implicitHeight: root.handleHeight - x: leftPadding + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2) + x: root.leftPadding + (root.visualPosition * root.effectiveDraggingWidth) - (root.handleWidth / 2) anchors.verticalCenter: parent.verticalCenter radius: Appearance.rounding.full color: root.handleColor From b6fc897b39d3c40330fc103fded16be820e0afcc Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 24 Mar 2026 17:18:01 +0100 Subject: [PATCH 13/16] make gamma indicator icon not scale --- .../ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml index 7dac9e84f..f86a8d7c0 100644 --- a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml +++ b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml @@ -8,7 +8,6 @@ OsdValueIndicator { id: rotateIcon icon: "wb_twilight" - scaleIcon: true name: Translation.tr("Gamma") value: Hyprsunset.gamma / 100 ?? 0.5 } From f86d42d8f267371accb0992fb4cf5e15ec8ca972 Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Tue, 24 Mar 2026 13:12:32 -0400 Subject: [PATCH 14/16] fix anchors formatting --- .../quickshell/ii/modules/common/widgets/StyledSlider.qml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml index 66c6ee0af..af25619bd 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/StyledSlider.qml @@ -114,9 +114,7 @@ Slider { Loader { required property real index - anchors { - verticalCenter: background.verticalCenter - } + anchors.verticalCenter: background.verticalCenter property real leftMargin: index > 0 ? root.dividerMargins : 0 property real rightMargin: index < background.leftWidths.length - 1 ? root.dividerMargins : root.handleMargins x: background.leftValues[index] * root.effectiveDraggingWidth + leftMargin + (index > 0 ? leftPadding : 0) @@ -138,9 +136,7 @@ Slider { Loader { required property int index - anchors { - verticalCenter: background.verticalCenter - } + anchors.verticalCenter: background.verticalCenter property real leftMargin: index > 0 ? root.dividerMargins : 0 property real rightMargin: index < background.leftWidths.length - 1 ? root.dividerMargins : root.handleMargins x: background.leftValues[index] * root.effectiveDraggingWidth + leftMargin + (index > 0 ? leftPadding : 0) From 75594fb5cff79f556aa7499735963e48762a4555 Mon Sep 17 00:00:00 2001 From: altrup <51763643+altrup@users.noreply.github.com> Date: Tue, 24 Mar 2026 13:22:39 -0400 Subject: [PATCH 15/16] Change bar scroll icon to gamma when changing gamma --- dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml b/dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml index d8bf9a34b..3bec75890 100644 --- a/dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml +++ b/dots/.config/quickshell/ii/modules/ii/bar/BarContent.qml @@ -70,7 +70,7 @@ Item { // Bar content region // Visual content ScrollHint { reveal: barLeftSideMouseArea.hovered - icon: "light_mode" + icon: Hyprsunset.gamma === 100 ? "light_mode" : "wb_twilight" tooltipText: Translation.tr("Scroll to change brightness") side: "left" anchors.left: parent.left From 35fb3d4da8dfb89dbb544199e362d48e7e6120c8 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 24 Mar 2026 22:55:36 +0100 Subject: [PATCH 16/16] make 25 lowest possible gamma --- .../ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml | 2 ++ .../ii/onScreenDisplay/indicators/GammaIndicator.qml | 1 + .../quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml | 6 +++--- .../modules/ii/sidebarRight/nightLight/NightLightDialog.qml | 2 ++ dots/.config/quickshell/ii/services/Hyprsunset.qml | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml index fc10c8a2a..e209ce286 100644 --- a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml +++ b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/OsdValueIndicator.qml @@ -11,6 +11,8 @@ Item { required property string name property bool rotateIcon: false property bool scaleIcon: false + property alias from: valueProgressBar.from + property alias to: valueProgressBar.to property real valueIndicatorVerticalPadding: 9 property real valueIndicatorLeftPadding: 10 diff --git a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml index f86a8d7c0..7fed00163 100644 --- a/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml +++ b/dots/.config/quickshell/ii/modules/ii/onScreenDisplay/indicators/GammaIndicator.qml @@ -9,5 +9,6 @@ OsdValueIndicator { icon: "wb_twilight" name: Translation.tr("Gamma") + from: Hyprsunset.gammaLowerLimit / 100 value: Hyprsunset.gamma / 100 ?? 0.5 } diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml index d7e0a0b57..4e80f7203 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml @@ -42,9 +42,9 @@ Rectangle { sourceComponent: QuickSlider { materialSymbol: "light_mode" secondaryMaterialSymbol: "wb_twilight" - stopIndicatorValues: Hyprsunset.gamma !== 100 && root.brightnessMonitor.brightness !== 0 ? [0.3 + root.brightnessMonitor.brightness * 0.7] : [] - value: Hyprsunset.gamma === 100? 0.3 + root.brightnessMonitor.brightness * 0.7 : Hyprsunset.gamma / 100 * 0.3 - tooltipContent: Hyprsunset.gamma === 100 ? `${Math.round(root.brightnessMonitor.brightness * 100)}%` : `${Hyprsunset.gamma}%` + stopIndicatorValues: Hyprsunset.gamma !== 100 && root.brightnessMonitor?.brightness !== 0 ? [0.3 + root.brightnessMonitor?.brightness * 0.7] : [] + value: Hyprsunset.gamma === 100? 0.3 + root.brightnessMonitor?.brightness * 0.7 : Hyprsunset.gamma / 100 * 0.3 + tooltipContent: Hyprsunset.gamma === 100 ? `${Math.round(root.brightnessMonitor?.brightness * 100)}%` : `${Translation.tr("Gamma")} ${Hyprsunset.gamma}%` onMoved: { if (value >= 0.3) { // 0.3 - 1.0 brightness diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml index 4f70983d9..7c7004b99 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/nightLight/NightLightDialog.qml @@ -182,8 +182,10 @@ WindowDialog { leftMargin: 4 rightMargin: 4 } + from: Hyprsunset.gammaLowerLimit / 100 value: Hyprsunset.gamma / 100 onMoved: Hyprsunset.setGamma(value * 100) + tooltipContent: `${Math.round(value * 100)}%` } } diff --git a/dots/.config/quickshell/ii/services/Hyprsunset.qml b/dots/.config/quickshell/ii/services/Hyprsunset.qml index c9fac1a6d..d51d4fe99 100644 --- a/dots/.config/quickshell/ii/services/Hyprsunset.qml +++ b/dots/.config/quickshell/ii/services/Hyprsunset.qml @@ -15,6 +15,8 @@ Singleton { id: root signal gammaChangeAttempt() + readonly property real gammaLowerLimit: 25 + property string from: Config.options?.light?.night?.from ?? "19:00" property string to: Config.options?.light?.night?.to ?? "06:30" property bool automatic: Config.options?.light?.night?.automatic && (Config?.ready ?? true) @@ -114,7 +116,7 @@ Singleton { } function setGamma(gamma) { - root.gamma = Math.max(0, Math.min(100, gamma)); + root.gamma = Math.max(root.gammaLowerLimit, Math.min(100, gamma)); root.gammaChangeAttempt();