diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 310595e..7bfa43d 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -349,6 +349,7 @@ bind = , F6, exec, ~/.config/hypr/scripts/hyprsunset-toggle.sh bind = , F7, exec, hyprshade toggle ~/.config/hypr/shaders/vibrance.glsl bind = , F8, exec, hyprshade toggle ~/.config/hypr/shaders/grayscale.glsl bind = , F9, exec, hyprshade toggle ~/.config/hypr/shaders/invert-colors.glsl +bind = , F10, exec, ~/.config/hypr/scripts/shader-cycle.sh # Touchpad ein/ausschalten (Fn+F7 = Ctrl+Super+F24 laut Firmware) bind = CTRL SUPER, F24, exec, /home/tekki/.config/hypr/scripts/touchpad-toggle.sh diff --git a/config/hypr/scripts/shader-cycle.sh b/config/hypr/scripts/shader-cycle.sh new file mode 100755 index 0000000..cf6a69c --- /dev/null +++ b/config/hypr/scripts/shader-cycle.sh @@ -0,0 +1,21 @@ +#!/bin/bash +SHADER_DIR="$HOME/.config/hypr/shaders" + +mapfile -t SHADERS < <(find "$SHADER_DIR" -name "*.glsl" | sort) + +if [[ ${#SHADERS[@]} -eq 0 ]]; then + exit 0 +fi + +CURRENT=$(hyprctl getoption decoration:screen_shader | grep "str:" | awk '{print $2}' | tr -d '"') + +INDEX=-1 +for i in "${!SHADERS[@]}"; do + if [[ "${SHADERS[$i]}" == "$CURRENT" ]]; then + INDEX=$i + break + fi +done + +NEXT=$(( (INDEX + 1) % ${#SHADERS[@]} )) +hyprshade on "${SHADERS[$NEXT]}" diff --git a/config/hypr/shaders/chromatic-aberration.glsl b/config/hypr/shaders/chromatic-aberration.glsl new file mode 100644 index 0000000..12b204b --- /dev/null +++ b/config/hypr/shaders/chromatic-aberration.glsl @@ -0,0 +1,17 @@ +#version 300 es +precision highp float; + +in vec2 v_texcoord; +uniform sampler2D tex; +out vec4 fragColor; + +void main() { + float offset = 0.004; + + float r = texture(tex, v_texcoord + vec2( offset, 0.0)).r; + float g = texture(tex, v_texcoord ).g; + float b = texture(tex, v_texcoord - vec2( offset, 0.0)).b; + float a = texture(tex, v_texcoord).a; + + fragColor = vec4(r, g, b, a); +} diff --git a/config/hypr/shaders/crt.glsl b/config/hypr/shaders/crt.glsl new file mode 100644 index 0000000..81a48d8 --- /dev/null +++ b/config/hypr/shaders/crt.glsl @@ -0,0 +1,20 @@ +#version 300 es +precision highp float; + +in vec2 v_texcoord; +uniform sampler2D tex; +out vec4 fragColor; + +void main() { + vec4 c = texture(tex, v_texcoord); + + // Scanlines: jede zweite Zeile leicht abdunkeln + float scanline = mod(floor(v_texcoord.y * 1000.0), 2.0); + c.rgb *= 1.0 - scanline * 0.25; + + // Leichte Vignette für den Röhren-Look + vec2 uv = v_texcoord - 0.5; + c.rgb *= 1.0 - dot(uv, uv) * 1.2; + + fragColor = c; +} diff --git a/config/hypr/shaders/pixelate.glsl b/config/hypr/shaders/pixelate.glsl new file mode 100644 index 0000000..3639995 --- /dev/null +++ b/config/hypr/shaders/pixelate.glsl @@ -0,0 +1,12 @@ +#version 300 es +precision highp float; + +in vec2 v_texcoord; +uniform sampler2D tex; +out vec4 fragColor; + +void main() { + float pixelSize = 0.005; + vec2 uv = floor(v_texcoord / pixelSize) * pixelSize; + fragColor = texture(tex, uv); +} diff --git a/config/hypr/shaders/vignette.glsl b/config/hypr/shaders/vignette.glsl new file mode 100644 index 0000000..01f6e7b --- /dev/null +++ b/config/hypr/shaders/vignette.glsl @@ -0,0 +1,16 @@ +#version 300 es +precision highp float; + +in vec2 v_texcoord; +uniform sampler2D tex; +out vec4 fragColor; + +void main() { + vec4 c = texture(tex, v_texcoord); + + vec2 uv = v_texcoord - 0.5; + float vignette = 1.0 - dot(uv, uv) * 2.2; + c.rgb *= clamp(vignette, 0.0, 1.0); + + fragColor = c; +} diff --git a/config/hypr/shortcuts.md b/config/hypr/shortcuts.md index b1e039d..b3a4cc5 100644 --- a/config/hypr/shortcuts.md +++ b/config/hypr/shortcuts.md @@ -50,3 +50,4 @@ | `F7` | Vibrance an/aus (Farben satter) | | `F8` | Graustufen an/aus | | `F9` | Farben invertieren an/aus | +| `F10` | Shader durchschalten (alle .glsl aus ~/.config/hypr/shaders/) |