this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix brightness controls not working

+19 -5
+1
home.nix
··· 84 84 kdePackages.qtdeclarative 85 85 kdePackages.qtstyleplugin-kvantum 86 86 wallust 87 + bc 87 88 88 89 # Niri 89 90 xwayland-satellite
+4 -1
home/niri/keybinds.nix
··· 11 11 12 12 volume-up = spawn pactl [ "set-sink-volume" "@DEFAULT_SINK@" "+5%" ]; 13 13 volume-down = spawn pactl [ "set-sink-volume" "@DEFAULT_SINK@" "-5%" ]; 14 + brightness-up = spawn "sh" [ "brightness" "up" ]; 15 + brightness-down = spawn "sh" [ "brightness" "down" ]; 14 16 screenshot = spawn "sh" [ "-c" "${grim} - | ${swappy} -f -" ]; 15 17 in { 16 18 ··· 22 24 23 25 "xf86audioraisevolume".action = volume-up; 24 26 "xf86audiolowervolume".action = volume-down; 25 - 27 + "xf86monbrightnessup".action = brightness-up; 28 + "xf86monbrightnessdown".action = brightness-down; 26 29 "control+super+xf86audioraisevolume".action = spawn "brightness" "up"; 27 30 "control+super+xf86audiolowervolume".action = spawn "brightness" "down"; 28 31
+14 -4
home/niri/scripts.nix
··· 2 2 3 3 let 4 4 brightnessScript = pkgs.writeShellScriptBin "brightness" '' 5 - BUS=10 6 5 STEP=5 7 6 MIN=0 8 7 MAX=100 9 8 OSD_FILE="/tmp/brightness_osd_level" 9 + DEVICE=amdgpu_bl2 10 10 11 - current=$(ddcutil --bus=$BUS getvcp 10 | grep -oP "current value\\s*=\\s*\\K[0-9]+") 12 - new=$current 11 + current=$(brightnessctl --device $DEVICE get) 12 + device_max=$(brightnessctl --device $DEVICE max) 13 + 14 + new=$(echo "scale=2; ($current / $device_max) * 100" | bc \ 15 + | sed 's/\.[0-9]*$//' \ 16 + | awk '{ print int(($1 + 2) / 5) * 5 }') 17 + 18 + current=$(echo "scale=2; ($current / $device_max) * 100" | bc \ 19 + | sed 's/\.[0-9]*$//' \ 20 + | awk '{ print int(($1 + 2) / 5) * 5 }') 21 + 22 + echo $current $device_max $new 13 23 14 24 if [[ "$1" == "up" ]]; then 15 25 new=$((current + STEP)) ··· 21 31 exit 1 22 32 fi 23 33 24 - ddcutil --bus=$BUS setvcp 10 "$new" 34 + brightnessctl --device $DEVICE set "$new%" 25 35 echo "$new" > "$OSD_FILE" 26 36 ''; 27 37 in