New configuration based on xfce4 + bpswm. No more tint2
This commit is contained in:
32
scripts/f
Executable file
32
scripts/f
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
path=$1
|
||||
|
||||
if [ -z "$path" ]; then
|
||||
path="."
|
||||
fi
|
||||
|
||||
if [ -d "$path" ]; then
|
||||
ls -lh --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
|
||||
"text")
|
||||
batcat "$path" --paging=never
|
||||
;;
|
||||
|
||||
"image")
|
||||
kitty +kitten icat "$path"
|
||||
;;
|
||||
|
||||
*)
|
||||
xdg-open "$path"
|
||||
esac
|
||||
fi
|
||||
Reference in New Issue
Block a user