diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-08-23 13:54:46 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-08-23 13:54:46 +0530 |
| commit | 3f0367b09bed508021dd26fa892904bfea8528d6 (patch) | |
| tree | 43d4f4b10f2ec9017c092df9be5dd5413395f584 /i3 | |
| parent | 3f18030ac8158d3eb50dd454c9d674a8c30ea659 (diff) | |
removed nix-index because it is slow as fuck + added brightness & red shifting keyboard shortcuts
Diffstat (limited to 'i3')
| -rw-r--r-- | i3/config | 6 | ||||
| -rwxr-xr-x | i3/red-shift.sh | 31 |
2 files changed, 37 insertions, 0 deletions
@@ -7,6 +7,12 @@ bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status +bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set 10%+ +bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 10%- + +bindsym $mod+bracketleft exec --no-startup-id ~/.config/i3/red-shift.sh up +bindsym $mod+bracketright exec --no-startup-id ~/.config/i3/red-shift.sh down + floating_modifier $mod tiling_drag modifier titlebar 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}" |
