all repos — dotfiles @ 3341aec3a12c83d0a8308ad3d0bd13b2276089a5

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