improve eww

This commit is contained in:
2026-09-10 19:54:50 +02:00
parent e551d36e1c
commit 7bb27f9373
46 changed files with 1296 additions and 1092 deletions
@@ -1,23 +1,23 @@
#!/usr/bin/env bash
SHADER="$HOME/.config/eww/shaders/read-mode.glsl"
# Toggle the warm/low-contrast screen shader. fp16 rendering is switched off
# with it: the shader is written for 8-bit output.
shader="$HOME/.config/eww/shaders/read-mode.glsl"
is_active() {
hyprctl getoption decoration:screen_shader | grep -qF "$SHADER"
}
active() { hyprctl getoption decoration:screen_shader 2>/dev/null | grep -qF "$shader"; }
case "$1" in
status)
is_active && echo true || echo false
;;
case ${1:-} in
status) active && echo true || echo false ;;
*)
if is_active; then
hyprctl eval 'hl.config({ decoration = { screen_shader = "" } })'
hyprctl eval 'hl.config({ render = { use_fp16 = 2 } })'
echo false
if active; then
hyprctl eval 'hl.config({ decoration = { screen_shader = "" } })' >/dev/null
hyprctl eval 'hl.config({ render = { use_fp16 = 2 } })' >/dev/null
state=false
else
hyprctl eval 'hl.config({ render = { use_fp16 = 0 } })'
hyprctl eval "hl.config({ decoration = { screen_shader = \"$SHADER\" } })"
echo true
hyprctl eval 'hl.config({ render = { use_fp16 = 0 } })' >/dev/null
hyprctl eval "hl.config({ decoration = { screen_shader = \"$shader\" } })" >/dev/null
state=true
fi
eww update read-mode="$state" 2>/dev/null
echo "$state"
;;
esac