nushell refactoring
This commit is contained in:
parent
636dddce81
commit
2b3862bf01
9 changed files with 162 additions and 137 deletions
|
|
@ -22,8 +22,6 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
./boxxy.nix
|
./boxxy.nix
|
||||||
(import ./helix.nix {inherit pkgs inputs;})
|
(import ./helix.nix {inherit pkgs inputs;})
|
||||||
# ./plasma.nix
|
|
||||||
# ./firefox.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# home.sessionPath = [
|
# home.sessionPath = [
|
||||||
|
|
@ -34,8 +32,18 @@ in {
|
||||||
source = ./autostart;
|
source = ./autostart;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
home.file.".config/direnv/lib/".source = ./direnv;
|
home.file.".config/direnv/lib/" = {
|
||||||
home.file.".config/direnv/lib/".recursive = true;
|
source = ./direnv;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
home.file.".config/nushell/scripts" = {
|
||||||
|
source = ./nushell/extras;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
home.file.".config/nushell/completions" = {
|
||||||
|
source = ./nushell/completions;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
bacon = {
|
bacon = {
|
||||||
|
|
@ -80,11 +88,7 @@ in {
|
||||||
settings = {
|
settings = {
|
||||||
color = "gruvbox";
|
color = "gruvbox";
|
||||||
flags = {
|
flags = {
|
||||||
battery =
|
battery = true;
|
||||||
# if lib.strings.hasPrefix "NOlaptop" (builtins.readFile /etc/hostname)
|
|
||||||
# then true
|
|
||||||
# else false;
|
|
||||||
true;
|
|
||||||
hide_time = true;
|
hide_time = true;
|
||||||
enable_gpu = true;
|
enable_gpu = true;
|
||||||
};
|
};
|
||||||
|
|
@ -93,7 +97,6 @@ in {
|
||||||
|
|
||||||
direnv = {
|
direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableNushellIntegration = true;
|
|
||||||
nix-direnv.enable = true;
|
nix-direnv.enable = true;
|
||||||
config = {
|
config = {
|
||||||
load_dotenv = true;
|
load_dotenv = true;
|
||||||
|
|
@ -127,6 +130,17 @@ in {
|
||||||
mpv = {
|
mpv = {
|
||||||
config = {
|
config = {
|
||||||
demuxer-max-bytes = "10GiB";
|
demuxer-max-bytes = "10GiB";
|
||||||
|
|
||||||
|
alang = "ja,jp,jpn,en,eng";
|
||||||
|
slang = "en,eng";
|
||||||
|
sub-scale = 0.5;
|
||||||
|
|
||||||
|
hr-seek = "yes";
|
||||||
|
|
||||||
|
hwdec = "auto";
|
||||||
|
vo = "gpu-next";
|
||||||
|
|
||||||
|
target-colorspace-hint = "auto";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -149,8 +163,12 @@ in {
|
||||||
configFile.source = ./nushell/config.nu;
|
configFile.source = ./nushell/config.nu;
|
||||||
envFile.source = ./nushell/env.nu;
|
envFile.source = ./nushell/env.nu;
|
||||||
# extraConfig = builtins.readFile ./nushell/stuff.nu;
|
# extraConfig = builtins.readFile ./nushell/stuff.nu;
|
||||||
extraConfig = lib.concatStrings (map builtins.readFile (map (x: ./nushell/extras/. + x) (map (x: "/" + x) (builtins.attrNames (builtins.readDir ./nushell/extras)))));
|
# extraConfig = lib.concatStrings (map builtins.readFile (map (x: ./nushell/extras/. + x) (map (x: "/" + x) (builtins.attrNames (builtins.readDir ./nushell/extras)))));
|
||||||
plugins = with pkgs.nushellPlugins; [
|
plugins = with pkgs.nushellPlugins; [
|
||||||
|
# skim
|
||||||
|
# desktop_notifications
|
||||||
|
# highlight
|
||||||
|
# units
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -184,7 +202,6 @@ in {
|
||||||
|
|
||||||
starship = {
|
starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableNushellIntegration = true;
|
|
||||||
settings = builtins.fromTOML (builtins.readFile ./starship.toml);
|
settings = builtins.fromTOML (builtins.readFile ./starship.toml);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -213,7 +230,6 @@ in {
|
||||||
|
|
||||||
zoxide = {
|
zoxide = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableNushellIntegration = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
def "nu-complete just" [] {
|
export def "nu-complete just" [] {
|
||||||
(^just --dump --unstable --dump-format json | from json).recipes | transpose recipe data | flatten | where {|row| $row.private == false } | select recipe doc parameters | rename value description
|
(^just --dump --unstable --dump-format json | from json).recipes | transpose recipe data | flatten | where {|row| $row.private == false } | select recipe doc parameters | rename value description
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -825,3 +825,8 @@ $env.config = {
|
||||||
mkdir ($nu.data-dir | path join "vendor/autoload")
|
mkdir ($nu.data-dir | path join "vendor/autoload")
|
||||||
starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")
|
starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")
|
||||||
use std/dirs
|
use std/dirs
|
||||||
|
|
||||||
|
use aliases.nu *
|
||||||
|
use nix.nu *
|
||||||
|
use stuff.nu *
|
||||||
|
use tailscale.nu *
|
||||||
|
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
alias b = btm
|
|
||||||
alias d = dirs
|
|
||||||
alias da = dirs add
|
|
||||||
alias dg = dirs goto
|
|
||||||
alias dn = dirs next
|
|
||||||
alias dp = dirs prev
|
|
||||||
alias dr = dirs drop
|
|
||||||
alias fetch = fastfetch
|
|
||||||
alias follow = readlink -f
|
|
||||||
alias p = pueue
|
|
||||||
alias snapper = snapper -c home
|
|
||||||
alias zl = zellij
|
|
||||||
|
|
||||||
alias cringe = sudo bootctl set-oneshot auto-windows
|
|
||||||
|
|
||||||
def h [query?: path] {
|
|
||||||
(if ($query != null) {sk -1 -q ($query | path basename)} else {sk -1})
|
|
||||||
| if ($in != "") {
|
|
||||||
hx $in
|
|
||||||
}
|
|
||||||
# | complete
|
|
||||||
# | if $in.exit_code == 0 {
|
|
||||||
# $in.stdout | str trim | hx $in
|
|
||||||
# }
|
|
||||||
}
|
|
||||||
|
|
||||||
def srg [] {
|
|
||||||
sk --ansi -i -c 'rg --color=always --line-number "{}"'
|
|
||||||
}
|
|
||||||
|
|
||||||
alias j = jj
|
|
||||||
alias ja = jj log -r 'all()'
|
|
||||||
alias jc = jj desc
|
|
||||||
alias jd = jj diff
|
|
||||||
alias je = jj edit
|
|
||||||
alias jf = jj git fetch
|
|
||||||
alias jg = jj git clone --colocate
|
|
||||||
alias jp = jj git push
|
|
||||||
alias js = jj status
|
|
||||||
alias jw = jj workspace update-stale
|
|
||||||
alias jt = jj log -r @ -T `description`
|
|
||||||
alias jn = jj next --edit
|
|
||||||
|
|
||||||
def jm --wrapped [-r: string = "@", ...rest] {
|
|
||||||
mut r = $r
|
|
||||||
if (jj log -r @ --no-pager --no-graph --template 'if(empty,"empty")' | $in == "empty") {
|
|
||||||
$r = "@-"
|
|
||||||
}
|
|
||||||
jj bookmark set main -r $r ...$rest
|
|
||||||
jj git push
|
|
||||||
}
|
|
||||||
|
|
||||||
alias la = ls -a
|
|
||||||
alias ll = ls -l
|
|
||||||
alias lal = ls -la
|
|
||||||
alias ccp = cp -prv
|
|
||||||
alias mvp = mv-full -pv
|
|
||||||
|
|
||||||
def --env c [path: path = "~"] {
|
|
||||||
cd $path
|
|
||||||
l
|
|
||||||
}
|
|
||||||
|
|
||||||
def l --wrapped [path: path = ".", ...rest] {
|
|
||||||
ls -t $path ...$rest | insert ext {|row| $row.name | parse "{name}.{ext}" | get ext | get 0? } | sort-by --natural type ext name | reject type ext
|
|
||||||
}
|
|
||||||
|
|
||||||
alias list-automounts = systemctl list-units --type=automount
|
|
||||||
|
|
||||||
def remount [] {
|
|
||||||
let reload = list-automounts | detect columns --guess | drop 5 | get DESCRIPTION | input list --multi
|
|
||||||
for mount in $reload {
|
|
||||||
sudo systemctl restart $mount
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def cpedit [file: path] {
|
|
||||||
mv $file $"($file).sym"; cp $"($file).sym" $file; chmod +w $file
|
|
||||||
}
|
|
||||||
|
|
||||||
alias core-job = job
|
|
||||||
alias job = job list
|
|
||||||
82
users/tao/nushell/extras/aliases.nu
Normal file
82
users/tao/nushell/extras/aliases.nu
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
export alias b = btm
|
||||||
|
export alias d = dirs
|
||||||
|
export alias da = dirs add
|
||||||
|
export alias dg = dirs goto
|
||||||
|
export alias dn = dirs next
|
||||||
|
export alias dp = dirs prev
|
||||||
|
export alias dr = dirs drop
|
||||||
|
export alias fetch = fastfetch
|
||||||
|
export alias follow = readlink -f
|
||||||
|
export alias p = pueue
|
||||||
|
export alias snapper = snapper -c home
|
||||||
|
export alias zl = zellij
|
||||||
|
|
||||||
|
export alias cringe = sudo bootctl set-oneshot auto-windows
|
||||||
|
|
||||||
|
export alias la = ls -a
|
||||||
|
export alias ll = ls -l
|
||||||
|
export alias lla = ls -la
|
||||||
|
|
||||||
|
export def --env c [path: path = "~"] {
|
||||||
|
cd $path
|
||||||
|
l
|
||||||
|
}
|
||||||
|
|
||||||
|
export def l --wrapped [path: path = ".", ...rest] {
|
||||||
|
ls -t $path ...$rest | insert ext {|row| $row.name | parse "{name}.{ext}" | get ext | get 0? } | sort-by --natural type ext name | reject type ext
|
||||||
|
}
|
||||||
|
|
||||||
|
export def h [query?: path] {
|
||||||
|
(if ($query != null) {sk -1 -q ($query | path basename)} else {sk -1})
|
||||||
|
| if ($in != "") {
|
||||||
|
hx $in
|
||||||
|
}
|
||||||
|
# | complete
|
||||||
|
# | if $in.exit_code == 0 {
|
||||||
|
# $in.stdout | str trim | hx $in
|
||||||
|
# }
|
||||||
|
}
|
||||||
|
|
||||||
|
export def srg [] {
|
||||||
|
sk --ansi -i -c 'rg --color=always --line-number "{}"'
|
||||||
|
}
|
||||||
|
|
||||||
|
export alias j = jj
|
||||||
|
export alias ja = jj log -r 'all()'
|
||||||
|
export alias jc = jj desc
|
||||||
|
export alias jd = jj diff
|
||||||
|
export alias je = jj edit
|
||||||
|
export alias jf = jj git fetch
|
||||||
|
export alias jg = jj git clone --colocate
|
||||||
|
export alias jp = jj git push
|
||||||
|
export alias js = jj status
|
||||||
|
export alias jw = jj workspace update-stale
|
||||||
|
export alias jt = jj log -r @ -T `description`
|
||||||
|
export alias jn = jj next --edit
|
||||||
|
|
||||||
|
export def jm --wrapped [-r: string = "@", ...rest] {
|
||||||
|
mut r = $r
|
||||||
|
if (jj log -r @ --no-pager --no-graph --template 'if(empty,"empty")' | $in == "empty") {
|
||||||
|
$r = "@-"
|
||||||
|
}
|
||||||
|
jj bookmark set main -r $r ...$rest
|
||||||
|
jj git push
|
||||||
|
}
|
||||||
|
|
||||||
|
export alias list-automounts = systemctl list-units --type=automount
|
||||||
|
|
||||||
|
export def remount [] {
|
||||||
|
let reload = list-automounts | detect columns --guess | drop 5 | get DESCRIPTION | input list --multi
|
||||||
|
for mount in $reload {
|
||||||
|
sudo systemctl restart $mount
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export def cpedit [file: path] {
|
||||||
|
mv $file $"($file).sym"; cp $"($file).sym" $file; chmod +w $file
|
||||||
|
}
|
||||||
|
|
||||||
|
export alias core-job = job
|
||||||
|
export alias job = job list
|
||||||
|
|
||||||
|
export alias mpv-hdr-dv = mpv --target-trc=pq --target-prim=bt.2020 --target-peak=800
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
def --wrapped rebuild [--force (-f), subcommand, ...rest] {
|
export def --wrapped rebuild [--force (-f), subcommand, ...rest] {
|
||||||
if not (
|
if not (
|
||||||
df -h | detect columns --guess | where "Mounted on" == "/" or "Mounted on" == "/boot" | get Use% | each {parse "{usage}%" | get usage | into int} | flatten | all {$in < 99}
|
df -h | detect columns --guess | where "Mounted on" == "/" or "Mounted on" == "/boot" | get Use% | each {parse "{usage}%" | get usage | into int} | flatten | all {$in < 99}
|
||||||
) and not $force {
|
) and not $force {
|
||||||
print "not enough disk space!"
|
print "not enough disk space!"
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
mut builders = ""
|
mut builders = ""
|
||||||
if (open /etc/hostname --raw) == "NOlaptop\n" and ($builders != "") {
|
if (open /etc/hostname --raw) == "NOlaptop\n" and ($builders != "") {
|
||||||
if (ping -c1 -W1 nocomputer | complete | $in.exit_code == 0) {
|
if (ping -c1 -W1 nocomputer | complete | $in.exit_code == 0) {
|
||||||
|
|
@ -27,9 +27,9 @@ def --wrapped rebuild [--force (-f), subcommand, ...rest] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
alias nd = nix develop
|
export alias nd = nix develop
|
||||||
|
|
||||||
def ns [...packages: string] {
|
export def ns [...packages: string] {
|
||||||
let packages = $packages | each {$"nixpkgs#($in)"}
|
let packages = $packages | each {$"nixpkgs#($in)"}
|
||||||
nix shell ...$packages
|
nix shell ...$packages
|
||||||
}
|
}
|
||||||
|
|
@ -38,16 +38,17 @@ def ns [...packages: string] {
|
||||||
# nix search nixpkgs $package
|
# nix search nixpkgs $package
|
||||||
# }
|
# }
|
||||||
|
|
||||||
def post-rebuild [] {
|
export def post-rebuild [] {
|
||||||
rm -r ~/.config/helix/runtime/grammars/
|
rm -r ~/.config/helix/runtime/grammars/
|
||||||
hx --grammar fetch; hx --grammar build
|
hx --grammar fetch; hx --grammar build
|
||||||
rustup update
|
rustup update
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_gen [] {
|
export def get_gen [] {
|
||||||
sudo nix-env --profile /nix/var/nix/profiles/system --list-generations | detect columns --guess -n | last | get column0
|
sudo nix-env --profile /nix/var/nix/profiles/system --list-generations | detect columns --guess -n | last | get column0
|
||||||
}
|
}
|
||||||
def bump [...rest] {
|
|
||||||
|
export def bump [...rest] {
|
||||||
cd /home/tao/projects/NOflake/
|
cd /home/tao/projects/NOflake/
|
||||||
mut r = "@"
|
mut r = "@"
|
||||||
loop {
|
loop {
|
||||||
|
|
@ -57,7 +58,7 @@ def bump [...rest] {
|
||||||
}
|
}
|
||||||
"empty" => {
|
"empty" => {
|
||||||
$r = $r + "-"
|
$r = $r + "-"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
jj new -r $r -m "bump (unbuilt)"
|
jj new -r $r -m "bump (unbuilt)"
|
||||||
|
|
@ -73,18 +74,17 @@ def bump [...rest] {
|
||||||
if ($build_status and ($curr_gen == $new_gen)) {
|
if ($build_status and ($curr_gen == $new_gen)) {
|
||||||
jj desc -r $r -m $"bump (date now | format date "%Y-%m-%d")"
|
jj desc -r $r -m $"bump (date now | format date "%Y-%m-%d")"
|
||||||
jj bookmark set main -r $r
|
jj bookmark set main -r $r
|
||||||
jj git push --allow-empty-description
|
jj git push --allow-empty-description
|
||||||
} else {
|
} else {
|
||||||
jj desc -r $r -m "bump (failed)"
|
jj desc -r $r -m "bump (failed)"
|
||||||
}
|
}
|
||||||
nvd history
|
nvd history
|
||||||
}
|
}
|
||||||
|
|
||||||
alias rb = rebuild boot
|
export alias rb = rebuild boot
|
||||||
alias rs = rebuild switch
|
export alias rs = rebuild switch
|
||||||
|
|
||||||
def gc [] {
|
export def gc [] {
|
||||||
sudo nix-collect-garbage -d
|
sudo nix-collect-garbage -d
|
||||||
snapper clear
|
snapper clear
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
def done [] {
|
export def done [] {
|
||||||
toastify send -a "" done
|
toastify send -a "" done
|
||||||
}
|
}
|
||||||
|
|
||||||
def "config stuff" [] {
|
export def "config stuff" [] {
|
||||||
hx ~/projects/NOflake/users/tao/nushell/stuff.nu
|
hx ~/projects/NOflake/users/tao/nushell/stuff.nu
|
||||||
}
|
}
|
||||||
|
|
||||||
def fixme [] {
|
export def fixme [] {
|
||||||
let items = rg "FIXME|TODO" --json
|
let items = rg "FIXME|TODO" --json
|
||||||
| lines
|
| lines
|
||||||
| each {from json}
|
| each {from json}
|
||||||
|
|
@ -24,26 +24,30 @@ def fixme [] {
|
||||||
hx ($items | get $sel | $"($in.text):($in.line_number)")
|
hx ($items | get $sel | $"($in.text):($in.line_number)")
|
||||||
}
|
}
|
||||||
|
|
||||||
source ~/.zoxide.nu
|
# source ~/.zoxide.nu
|
||||||
def --wrapped --env z [...rest] {
|
export def --wrapped --env z [...rest] {
|
||||||
zo ...$rest
|
zo ...$rest
|
||||||
l
|
l
|
||||||
}
|
}
|
||||||
|
|
||||||
def "snapper list" [] {
|
export def "snapper list" [] {
|
||||||
snapper --csvout list | from csv | reject config subvolume default user used-space userdata active
|
snapper --csvout list | from csv | reject config subvolume default user used-space userdata active
|
||||||
}
|
}
|
||||||
|
|
||||||
def "snapper clear" [] {
|
export def "snapper clear" [] {
|
||||||
let list = snapper --csvout list | from csv | reject config subvolume default user used-space userdata active | skip 1
|
let list = snapper --csvout list | from csv | reject config subvolume default user used-space userdata active | skip 1
|
||||||
|
|
||||||
let first = $list | first
|
let first = $list | first
|
||||||
let last = $list | last
|
let last = $list | last
|
||||||
|
|
||||||
snapper delete $"($first.number)-($last.number)"
|
if $first != $last {
|
||||||
|
snapper delete $"($first.number)-($last.number)"
|
||||||
|
} else {
|
||||||
|
snapper delete $first
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def "fans" [duty?: int] {
|
export def "fans" [duty?: int] {
|
||||||
match (hostname) {
|
match (hostname) {
|
||||||
"NOcomputer" => {
|
"NOcomputer" => {
|
||||||
let mode_path: path = (glob "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" | get 0)
|
let mode_path: path = (glob "/sys/devices/platform/nct6775.656/hwmon/hwmon*/pwm2_enable" | get 0)
|
||||||
|
|
@ -61,15 +65,15 @@ def "fans" [duty?: int] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
alias louder = fans 100
|
export alias louder = fans 100
|
||||||
alias loud = fans
|
export alias loud = fans
|
||||||
alias quiet = fans 42
|
export alias quiet = fans 42
|
||||||
|
|
||||||
def asciicam [] {
|
export def asciicam [] {
|
||||||
$env.DISPLAY = null
|
$env.DISPLAY = null
|
||||||
mpv -vo caca av://v4l2:/dev/video0 --demuxer-lavf-o=input_format=mjpeg --profile=low-latency e>| /dev/null
|
mpv -vo caca av://v4l2:/dev/video0 --demuxer-lavf-o=input_format=mjpeg --profile=low-latency e>| /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
def sunu [command] {
|
export def sunu [command] {
|
||||||
sudo nu --stdin --commands $command
|
sudo nu --stdin --commands $command
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# see if others see us connecting from a mullvad exit node
|
# see if others see us connecting from a mullvad exit node
|
||||||
def check-mullvad [] {
|
export def check-mullvad [] {
|
||||||
print -n "checking mullvad status"
|
print -n "checking mullvad status"
|
||||||
mut check = false
|
mut check = false
|
||||||
mut j = null
|
mut j = null
|
||||||
|
|
@ -13,7 +13,7 @@ def check-mullvad [] {
|
||||||
}
|
}
|
||||||
|
|
||||||
# switch to a specific exit node, or none
|
# switch to a specific exit node, or none
|
||||||
def te [exit_node: string = ""] {
|
export def te [exit_node: string = ""] {
|
||||||
if ($exit_node | is-empty) and (ps | find deluge | is-not-empty) {
|
if ($exit_node | is-empty) and (ps | find deluge | is-not-empty) {
|
||||||
print "stop summoning first!"
|
print "stop summoning first!"
|
||||||
return false
|
return false
|
||||||
|
|
@ -25,12 +25,12 @@ def te [exit_node: string = ""] {
|
||||||
check-mullvad
|
check-mullvad
|
||||||
} else {
|
} else {
|
||||||
print "exit node set"
|
print "exit node set"
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# list all mullvad exit nodes
|
# list all mullvad exit nodes
|
||||||
def tx [] {
|
export def tx [] {
|
||||||
tailscale exit-node list
|
tailscale exit-node list
|
||||||
| lines
|
| lines
|
||||||
| drop 4
|
| drop 4
|
||||||
|
|
@ -42,7 +42,7 @@ tailscale exit-node list
|
||||||
}
|
}
|
||||||
|
|
||||||
# sort mullvad exit nodes by fastest ping
|
# sort mullvad exit nodes by fastest ping
|
||||||
def tsp [] {
|
export def tsp [] {
|
||||||
tx
|
tx
|
||||||
| where COUNTRY == USA
|
| where COUNTRY == USA
|
||||||
| par-each {
|
| par-each {
|
||||||
|
|
@ -66,18 +66,18 @@ tx
|
||||||
}
|
}
|
||||||
|
|
||||||
# switch to a random mullvad exit node
|
# switch to a random mullvad exit node
|
||||||
def tr [] {
|
export def tr [] {
|
||||||
tx
|
tx
|
||||||
| get (random int 0..($in | length))
|
| get (random int 0..($in | length))
|
||||||
| te $in.IP
|
| te $in.IP
|
||||||
| return $in
|
| return $in
|
||||||
}
|
}
|
||||||
|
|
||||||
alias t = tailscale
|
export alias t = tailscale
|
||||||
alias ts = tailscale status
|
export alias ts = tailscale status
|
||||||
alias tu = tailscale up
|
export alias tu = tailscale up
|
||||||
alias td = tailscale down
|
export alias td = tailscale down
|
||||||
alias ta = tailscale exit-node suggest
|
export alias ta = tailscale exit-node suggest
|
||||||
alias tt = tailscale switch --list | detect columns | input list -d Tailnet | get ID | t switch $in
|
export alias tt = tailscale switch --list | detect columns | input list -d Tailnet | get ID | t switch $in
|
||||||
|
|
||||||
alias wno = ssh root@whyfi "etherwake -i br-lan 04:42:1A:E7:62:C3"
|
export alias wno = ssh root@whyfi "etherwake -i br-lan 04:42:1A:E7:62:C3"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue