|
|
@ -5,6 +5,19 @@ def main [] {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def `main open-file` [path: string] {
|
|
|
|
def `main open-file` [path: string] {
|
|
|
|
zellij action move-focus right
|
|
|
|
match ($path | path parse | get extension | str downcase) {
|
|
|
|
zellij action write-chars $":open ($path)\r"
|
|
|
|
"png" => { open-image $path }
|
|
|
|
|
|
|
|
"jpg" => { open-image $path }
|
|
|
|
|
|
|
|
"jpeg" => { open-image $path }
|
|
|
|
|
|
|
|
_ => { open-editor $path }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def open-editor [path: string] {
|
|
|
|
|
|
|
|
zellij ac move-focus right
|
|
|
|
|
|
|
|
zellij ac write-chars $":open ($path)\r"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def open-image [path: string] {
|
|
|
|
|
|
|
|
zellij ac new-pane -f -- chafa -C on --scale max $path
|
|
|
|
}
|
|
|
|
}
|
|
|
|