From 3f0367b09bed508021dd26fa892904bfea8528d6 Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Sun, 23 Aug 2026 13:54:46 +0530 Subject: removed nix-index because it is slow as fuck + added brightness & red shifting keyboard shortcuts --- i3/red-shift.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 i3/red-shift.sh (limited to 'i3/red-shift.sh') diff --git a/i3/red-shift.sh b/i3/red-shift.sh new file mode 100755 index 0000000..bb847e6 --- /dev/null +++ b/i3/red-shift.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +OUTPUT="eDP-1-1" +STEP=0.1 +STATE="${XDG_RUNTIME_DIR:-/tmp}/xrandr-redshift" + +if [[ -f "$STATE" ]]; then + GAMMA=$(cat "$STATE") +else + GAMMA=1.0 +fi + +case "$1" in + up) + GAMMA=$(awk -v g="$GAMMA" -v s="$STEP" 'BEGIN { + g -= s + if (g < 0.1) g = 0.1 + printf "%.1f", g + }') + ;; + down) + GAMMA=$(awk -v g="$GAMMA" -v s="$STEP" 'BEGIN { + g += s + if (g > 1.0) g = 1.0 + printf "%.1f", g + }') + ;; +esac + +echo "$GAMMA" > "$STATE" +xrandr --output "$OUTPUT" --gamma "1.0:${GAMMA}:${GAMMA}" -- cgit v1.2.3