New directory structure + basilisk
This commit is contained in:
29
home/.local/bin/f
Executable file
29
home/.local/bin/f
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
path=$1
|
||||
|
||||
if [ -z "$path" ]; then
|
||||
path="."
|
||||
fi
|
||||
|
||||
if [ -d "$path" ]; then
|
||||
ls -lha --color=tty "$path"
|
||||
else
|
||||
if [ ! -f "$path" ]; then
|
||||
echo "No such file: $path"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
format="$(file -i "$path" | cut -d' ' -f2)"
|
||||
format="${format%%/*}"
|
||||
|
||||
case "$format" in
|
||||
"image")
|
||||
kitty +kitten icat "$path"
|
||||
;;
|
||||
|
||||
*)
|
||||
cat "$path"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
Reference in New Issue
Block a user