add anti-flashbang with shader

This commit is contained in:
end-4
2026-03-19 12:40:05 +01:00
parent 7cf704d450
commit be1838e40d
4 changed files with 109 additions and 6 deletions
@@ -0,0 +1,38 @@
pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import qs.modules.common.models.hyprland
Singleton {
id: root
readonly property string shaderPath: Quickshell.shellPath("services/hyprlandAntiFlashbangShader/anti-flashbang.glsl")
property bool enabled: confOpt.value == shaderPath
function enable() {
HyprlandConfig.setMany({
"decoration:screen_shader": root.shaderPath,
"debug:damage_tracking": 1, // Turn off dmg tracking to prevent weird flashes. 1 = monitor only
});
}
function disable() {
HyprlandConfig.resetMany([
"decoration:screen_shader",
"debug:damage_tracking"
]);
}
function toggle() {
if (root.enabled) disable()
else enable()
}
HyprlandConfigOption {
id: confOpt
key: "decoration:screen_shader"
}
}