Création du script de gestion de la fréquence de l’écran

This commit is contained in:
Breizh 2024-05-16 16:43:12 +02:00
parent e810eff72c
commit a57cebca97

13
.i3blocks/screen_freq Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
{
runtime="${XDG_RUNTIME_DIR}/i3blocks"
[[ ! -d "$runtime" ]] && mkdir -p "$runtime"
[[ ! -f "$runtime/screen_freq" ]] && [[ -z "$button" ]] && button=1
case $button in
1) xrandr --rate 60; echo "60" > "$runtime/screen_freq";;
3) xrandr --rate 240; echo "240" > "$runtime/screen_freq";;
esac
} &>/dev/null
cat "$runtime/screen_freq"