ambrevar/shell: Add mimimi-save-power.
parent
4e5a66874f
commit
2b39ed9655
|
@ -388,3 +388,21 @@ INTERFACE is a string in the form of `wlp2s0'."
|
|||
(export-always 'current-ip)
|
||||
(defun current-ip ()
|
||||
(ipv4 (current-interface)))
|
||||
|
||||
(export-always 'mimimi-save-power)
|
||||
(defun mimimi-save-power ()
|
||||
(flet ((bbswitch-off ()
|
||||
(let* ((bbswitch-path (cmd:$cmd "guix" "build" "bbswitch-module"))
|
||||
(modules (str:concat bbswitch-path "/lib/modules"))
|
||||
(first-dir (namestring (first (uiop:subdirectories modules))))
|
||||
(switch "/proc/acpi/bbswitch"))
|
||||
(unless (uiop:file-exists-p switch)
|
||||
(cmd:cmd
|
||||
"sudo" "insmod" (str:concat first-dir "/extra/bbswitch.ko.gz")))
|
||||
(cmd:cmd
|
||||
(format nil "sudo sh -c 'tee ~a <<<OFF'" switch))))
|
||||
(enable-audio-codec-power-management ()
|
||||
(cmd:cmd
|
||||
"sudo sh -c 'echo 1 > /sys/module/snd_hda_intel/parameters/power_save'")))
|
||||
(bbswitch-off)
|
||||
(enable-audio-codec-power-management)))
|
||||
|
|
Loading…
Reference in New Issue