cleanup nu

This commit is contained in:
Tao Tien 2025-11-13 08:21:25 -08:00
commit 5d3d1e0587
3 changed files with 50 additions and 68 deletions

View file

@ -58,7 +58,6 @@ def bump [...rest] {
}
let r = jj log -r @ --no-pager --no-graph --template 'change_id'
sudo nix flake update
# rc2nix | save -f /home/tao/projects/NOflake/users/tao/plasma.nix;
if (rebuild boot) {
jj desc -r $r -m $"bump (date now | format date "%Y-%m-%d")"
} else {

View file

@ -39,43 +39,26 @@ def "snapper clear" [] {
snapper delete $"($first.number)-($last.number)"
}
def quiet [] {
def "fans" [duty?: int] {
match (hostname) {
"NOcomputer" => {
let mode_path: path = (glob "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" | get 0)
sudo -- nu -c $"5 o> ($mode_path)"
match $duty {
100 => { sudo -- nu -c $"0 o> ($mode_path)" }
_ => { sudo -- nu -c $"5 o> ($mode_path)" }
}
}
"NOlaptop" => {
sudo ectool fanduty 42
}
}
}
def loud [] {
match (hostname) {
"NOcomputer" => {
let mode_path: path = (glob "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" | get 0)
sudo -- nu -c $"5 o> ($mode_path)"
}
"NOlaptop" => {
sudo ectool autofanctrl
}
}
}
def louder [] {
match (hostname) {
"NOcomputer" => {
let mode_path: path = (glob "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" | get 0)
sudo -- nu -c $"0 o> ($mode_path)"
}
"NOlaptop" => {
sudo ectool fanduty 100
match $duty {
null => { sudo ectool autofanctl }
_ => { sudo ectool fanduty $duty }
}
}
}
}
alias "fans max" = fans 100
alias "fans quiet" = fans 42
def asciicam [] {
$env.DISPLAY = null