#!/bin/bash

# Path to the brightness shader file
SHADER_DIR="$HOME/.config/hypr/shaders"
SHADER_FILE="$SHADER_DIR/brightness.frag"

# Ensure shader directory exists
mkdir -p "$SHADER_DIR"

# Create shader file with 100% brightness and no blue light filter
cat > "$SHADER_FILE" << EOF
#version 300 es

precision mediump float;

in vec2 v_texcoord;
out vec4 fragColor;
uniform sampler2D tex;

void main() {
    vec4 pixColor = texture(tex, v_texcoord);
    
    // Adjust brightness
    pixColor.rgb *= 1.00;
    
    fragColor = pixColor;
}
EOF

# Apply shader
if [ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
    export HYPRLAND_INSTANCE_SIGNATURE=$(ls -t /tmp/hypr/ 2>/dev/null | head -n1)
fi
/usr/bin/hyprctl keyword decoration:screen_shader "$SHADER_FILE"

echo "Screen reset: Brightness 100%, Blue light filter OFF"
