feat: crt/vignette/chromatic-aberration/pixelate shader + dynamischer F10-cycle

This commit is contained in:
2026-04-23 21:07:00 +02:00
parent 55668c1fb0
commit d3c70b0f84
7 changed files with 88 additions and 0 deletions
+1
View File
@@ -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
+21
View File
@@ -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]}"
@@ -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);
}
+20
View File
@@ -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;
}
+12
View File
@@ -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);
}
+16
View File
@@ -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;
}
+1
View File
@@ -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/) |