Files
nixconfig/modules/home/wayland/apps/eww/bar/scripts/read-mode
T
2026-09-11 22:40:11 +02:00

25 lines
847 B
Bash

#!/usr/bin/env bash
# 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"
active() { hyprctl getoption decoration:screen_shader 2>/dev/null | grep -qF "$shader"; }
case ${1:-} in
status) active && echo true || echo false ;;
*)
detach_self "$@"
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 } })' >/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