From f6a221c38586622b376feaeffecca3deecb9363e Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Thu, 16 Oct 2025 20:01:15 -0700 Subject: [PATCH] stuff --- users/tao/nushell/extras/stuff.nu | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/users/tao/nushell/extras/stuff.nu b/users/tao/nushell/extras/stuff.nu index be81619..1abd40e 100644 --- a/users/tao/nushell/extras/stuff.nu +++ b/users/tao/nushell/extras/stuff.nu @@ -39,13 +39,13 @@ def "snapper clear" [] { snapper delete $"($first.number)-($last.number)" } -let mode_path: path = ( - glob "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" | get 0 -) def quiet [] { match (hostname) { - "NOcomputer" => {sudo -- nu -c $"5 o> ($mode_path)"} + "NOcomputer" => { + const mode_path: path = "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" + sudo -- nu -c $"5 o> ($mode_path)" + } "NOlaptop" => { sudo ectool fanduty 42 } @@ -54,15 +54,25 @@ def quiet [] { def loud [] { match (hostname) { - "NOcomputer" => {sudo -- nu -c $"5 o> ($mode_path)"} - "NOlaptop" => {sudo ectool autofanctrl} + "NOcomputer" => { + const mode_path: path = "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" + sudo -- nu -c $"5 o> ($mode_path)" + } + "NOlaptop" => { + sudo ectool autofanctrl + } } } def louder [] { match (hostname) { - "NOcomputer" => {sudo -- nu -c $"0 o> ($mode_path)"} - "NOlaptop" => {sudo ectool fanduty 100} + "NOcomputer" => { + const mode_path: path = "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" + sudo -- nu -c $"0 o> ($mode_path)" + } + "NOlaptop" => { + sudo ectool fanduty 100 + } } }