forked from Shinonome/dots-hyprland
Add gamma indicator
This commit is contained in:
@@ -25,6 +25,10 @@ Scope {
|
|||||||
id: "brightness",
|
id: "brightness",
|
||||||
sourceUrl: "indicators/BrightnessIndicator.qml"
|
sourceUrl: "indicators/BrightnessIndicator.qml"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "gamma",
|
||||||
|
sourceUrl: "indicators/GammaIndicator.qml"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
function triggerOsd() {
|
function triggerOsd() {
|
||||||
@@ -52,6 +56,15 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: Hyprsunset
|
||||||
|
function onGammaChangeAttempt() {
|
||||||
|
root.protectionMessage = "";
|
||||||
|
root.currentIndicator = "gamma";
|
||||||
|
root.triggerOsd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
// Listen to volume changes
|
// Listen to volume changes
|
||||||
target: Audio.sink?.audio ?? null
|
target: Audio.sink?.audio ?? null
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -13,6 +13,8 @@ import Quickshell.Hyprland
|
|||||||
*/
|
*/
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
signal gammaChangeAttempt()
|
||||||
|
|
||||||
property string from: Config.options?.light?.night?.from ?? "19:00"
|
property string from: Config.options?.light?.night?.from ?? "19:00"
|
||||||
property string to: Config.options?.light?.night?.to ?? "06:30"
|
property string to: Config.options?.light?.night?.to ?? "06:30"
|
||||||
property bool automatic: Config.options?.light?.night?.automatic && (Config?.ready ?? true)
|
property bool automatic: Config.options?.light?.night?.automatic && (Config?.ready ?? true)
|
||||||
@@ -105,6 +107,8 @@ Singleton {
|
|||||||
function setGamma(gamma) {
|
function setGamma(gamma) {
|
||||||
root.gamma = Math.max(0, Math.min(100, gamma));
|
root.gamma = Math.max(0, Math.min(100, gamma));
|
||||||
|
|
||||||
|
root.gammaChangeAttempt();
|
||||||
|
|
||||||
if (root.gamma !== 100) {
|
if (root.gamma !== 100) {
|
||||||
// console.log("[Hyprsunset] Enabling");
|
// console.log("[Hyprsunset] Enabling");
|
||||||
Quickshell.execDetached(["bash", "-c", `
|
Quickshell.execDetached(["bash", "-c", `
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
"Unknown function call: %1": "Unknown function call: %1",
|
"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",
|
"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",
|
"Volume": "Volume",
|
||||||
|
"Gamma": "Gamma",
|
||||||
"Medium": "Medium",
|
"Medium": "Medium",
|
||||||
"Copy code": "Copy code",
|
"Copy code": "Copy code",
|
||||||
"Exceeded max allowed": "Exceeded max allowed",
|
"Exceeded max allowed": "Exceeded max allowed",
|
||||||
|
|||||||
Reference in New Issue
Block a user