dotfiles/.i3blocks/screen_freq

14 lines
349 B
Text
Raw Normal View History

#!/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"