all repos — dotfiles @ 04d6b71a5e7ced19cb1a7dd2f5d4724f2c36d940

my *nix dotfiles

nix/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