all repos — dotfiles @ 90e97419fc0c57e0d5ca9363167389af3f4116cd

my *nix dotfiles

bin/cputil.nix (view raw)

 1{ pkgs, ... }:
 2
 3let
 4  name = "cputil";
 5  cpufreqctl = "${pkgs.auto-cpufreq}/bin/cpufreqctl.auto-cpufreq";
 6  asusctl = "${pkgs.asusctl}/bin/asusctl";
 7in
 8pkgs.writeShellScriptBin name
 9  ''
10    mode="$1"
11    case "$mode" in
12      "perf")
13        doas ${cpufreqctl} --governor --set=performance
14        ${asusctl} profile -P performance
15        ;;
16      "save")
17        doas ${cpufreqctl} --governor --set=powersave
18        ${asusctl} profile -P quiet
19        printf "\n"
20    esac
21  ''
22