diff options
| -rwxr-xr-x | i3/red-shift.sh | 36 | ||||
| -rw-r--r-- | nixos/desktop-environment.nix | 1 | ||||
| -rw-r--r-- | nixos/environment.nix | 1 | ||||
| -rw-r--r-- | nixos/home.nix | 8 |
4 files changed, 24 insertions, 22 deletions
diff --git a/i3/red-shift.sh b/i3/red-shift.sh index bb847e6..4d311c7 100755 --- a/i3/red-shift.sh +++ b/i3/red-shift.sh @@ -1,31 +1,23 @@ #!/usr/bin/env bash -OUTPUT="eDP-1-1" -STEP=0.1 -STATE="${XDG_RUNTIME_DIR:-/tmp}/xrandr-redshift" +STATE="${XDG_RUNTIME_DIR}/gammastep-temp" +STEP=500 +MIN=1000 +MAX=6500 -if [[ -f "$STATE" ]]; then - GAMMA=$(cat "$STATE") -else - GAMMA=1.0 -fi +current=$(cat "$STATE" 2>/dev/null || echo 6500) 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 - }') + current=$((current + STEP)) + ;; + up) + current=$((current - STEP)) ;; esac -echo "$GAMMA" > "$STATE" -xrandr --output "$OUTPUT" --gamma "1.0:${GAMMA}:${GAMMA}" +current=$(( current < MIN ? MIN : current > MAX ? MAX : current )) + +echo "$current" > "$STATE" +gammastep -m randr -x +gammastep -m randr -O "$current" diff --git a/nixos/desktop-environment.nix b/nixos/desktop-environment.nix index be2b007..f24837c 100644 --- a/nixos/desktop-environment.nix +++ b/nixos/desktop-environment.nix @@ -46,5 +46,6 @@ dunst i3status i3lock-color + gammastep ]; } diff --git a/nixos/environment.nix b/nixos/environment.nix index af157ec..cad93e2 100644 --- a/nixos/environment.nix +++ b/nixos/environment.nix @@ -98,6 +98,7 @@ in omp termshark + wireshark-cli mitmproxy certmitm ventoy diff --git a/nixos/home.nix b/nixos/home.nix index 44d190d..54aab75 100644 --- a/nixos/home.nix +++ b/nixos/home.nix @@ -1,5 +1,6 @@ { config, pkgs, username, terminalworkspace, opt, ... }: { + users.groups.wireshark = {}; users.users.${username} = { isNormalUser = true; description = "User"; @@ -7,6 +8,13 @@ packages = with pkgs; []; shell = pkgs.fish; }; + security.wrappers.dumpcap = { + source = "${pkgs.wireshark-cli}/bin/dumpcap"; + capabilities = "cap_net_raw,cap_net_admin+eip"; + owner = "root"; + group = "wireshark"; + permissions = "0750"; + }; virtualisation.docker.enable = true; programs.fish = { enable = true; |
