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 + } } }