mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-05 03:02:34 +01:00
nushell: add some utilities
This commit is contained in:
parent
ed65d54832
commit
15658311ed
2 changed files with 24 additions and 1 deletions
|
@ -45,9 +45,31 @@ alias nv = nvim
|
|||
alias nvide = & neovide "--no-fork"
|
||||
|
||||
# Misc functions
|
||||
def --env mkdircd [p: string] {
|
||||
mkdir $p
|
||||
cd $p
|
||||
}
|
||||
|
||||
def wldd [path: string] {
|
||||
match (which $path) {
|
||||
[{ path: $p }] => { ldd $p },
|
||||
_ => { error make { msg: $"No external command ($path)" } },
|
||||
}
|
||||
}
|
||||
|
||||
def viewdoc [f: path] {
|
||||
let inp = $f | path parse
|
||||
|
||||
match $inp.extension {
|
||||
$e if $e in [ "doc", "docx", "odt", "ppt", "pptx", "odp" ] => {
|
||||
let outp = { extension: "pdf", parent: "/tmp", stem: $inp.stem } | path join
|
||||
libreoffice --convert-to pdf $f --outdir /tmp
|
||||
try { zathura $outp }
|
||||
rm $outp
|
||||
},
|
||||
"pdf" => { zathura $f },
|
||||
"html" => { openbrowser $"file://($f | path expand)" }
|
||||
$e if $e in [ "png", "webp", "jpg", "jpeg", "ff", "bmp" ] => { nsxiv $f },
|
||||
_ => { mpv $f },
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,10 +35,11 @@ in
|
|||
];
|
||||
|
||||
config.mzte-nix-packages = with pkgs; [
|
||||
nix-output-monitor
|
||||
nix-du
|
||||
nix-output-monitor
|
||||
nsxiv
|
||||
nsxiv-pipe
|
||||
nurl
|
||||
(flakePkg "github:nix-community/zon2nix")
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue