forked from Shinonome/dots-hyprland
add a weak anti flashbang variant
This commit is contained in:
@@ -10,7 +10,9 @@ Singleton {
|
||||
id: root
|
||||
|
||||
readonly property string shaderPath: Quickshell.shellPath("services/hyprlandAntiFlashbangShader/anti-flashbang.glsl")
|
||||
property bool enabled: confOpt.value == shaderPath
|
||||
readonly property string weakShaderPath: Quickshell.shellPath("services/hyprlandAntiFlashbangShader/anti-flashbang-weak.glsl")
|
||||
property bool enabled: confOpt.value == shaderPath || weak
|
||||
property bool weak: confOpt.value == weakShaderPath
|
||||
|
||||
function enable() {
|
||||
HyprlandConfig.setMany({
|
||||
@@ -19,6 +21,13 @@ Singleton {
|
||||
});
|
||||
}
|
||||
|
||||
function enableWeak() {
|
||||
HyprlandConfig.setMany({
|
||||
"decoration:screen_shader": root.weakShaderPath,
|
||||
"debug:damage_tracking": 1,
|
||||
});
|
||||
}
|
||||
|
||||
function disable() {
|
||||
HyprlandConfig.resetMany([
|
||||
"decoration:screen_shader",
|
||||
@@ -30,6 +39,16 @@ Singleton {
|
||||
if (root.enabled) disable()
|
||||
else enable()
|
||||
}
|
||||
|
||||
function cycle() {
|
||||
if (!enabled) {
|
||||
enableWeak();
|
||||
} else if (weak) {
|
||||
enable();
|
||||
} else {
|
||||
disable();
|
||||
}
|
||||
}
|
||||
|
||||
HyprlandConfigOption {
|
||||
id: confOpt
|
||||
|
||||
Reference in New Issue
Block a user