summaryrefslogtreecommitdiff
path: root/scripts/.local/bin/dcpug
blob: 762ad966dcc4c0510c2c545ad39f52825a3edd20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

dmenu="$(command -v cdmenu)"
if [ "$dmenu" == "" ]; then
    dmenu="dmenu"
fi

sudo="$(command -v sudo)"
if [ "$sudo" == "" ]; then
    sudo="doas"
fi

profiles="$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | sed 's/ /\\n/g')"

profile=$(printf $profiles | $dmenu)

notify-send "Set CPU profile: $profile"
$sudo cpupower frequency-set --governor $profile
# repeat, for good measure
$sudo cpupower frequency-set --governor $profile