epic management
This commit is contained in:
parent
d34d652a2d
commit
aeade93e13
3 changed files with 68 additions and 4 deletions
2
bashrc
2
bashrc
|
@ -116,4 +116,4 @@ type systemctl 2>/dev/null 1>&2 && if systemctl -q is-active graphical.target &&
|
||||||
exec startx
|
exec startx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -e "/usr/local/bin/afetch" ] && afetch || fetch min
|
[ -e "/usr/bin/afetch" ] && afetch || fetch min
|
||||||
|
|
36
scripts/o
Executable file
36
scripts/o
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Open files
|
||||||
|
file="$1"
|
||||||
|
|
||||||
|
# If executable, run 'file' and exit
|
||||||
|
file "$file" | grep -q "shell" && "$EDITOR" "$file" && exit
|
||||||
|
file "$file" | grep -q "executable" && file "$file" && exit
|
||||||
|
|
||||||
|
# If directory, list contents
|
||||||
|
[ -d "$file" ] && (cd "$file" && /usr/bin/ls -A1Fx --color --group-directories-first) && exit
|
||||||
|
|
||||||
|
case $file in
|
||||||
|
# Images
|
||||||
|
*.jpeg) "$IMAGE" "$file" ;;
|
||||||
|
*.png) "$IMAGE" "$file" ;;
|
||||||
|
*.jpg) "$IMAGE" "$file" ;;
|
||||||
|
*.gif) "$IMAGE" "$file" ;;
|
||||||
|
*.svg) "$IMAGE" "$file" ;;
|
||||||
|
# Videos
|
||||||
|
*.webm) "$VIDEO" "$file" ;;
|
||||||
|
*.mp4) "$VIDEO" "$file" ;;
|
||||||
|
*.flv) "$VIDEO" "$file" ;;
|
||||||
|
*.mkv) "$VIDEO" "$file" ;;
|
||||||
|
*.avi) "$VIDEO" "$file" ;;
|
||||||
|
*.m4v) "$VIDEO" "$file" ;;
|
||||||
|
# Audio
|
||||||
|
*.flac) "$VIDEO" "$file" ;;
|
||||||
|
*.mp3) "$VIDEO" "$file" ;;
|
||||||
|
*.ogg) "$VIDEO" "$file" ;;
|
||||||
|
# Documents
|
||||||
|
*.pdf) "$READER" "$file" ;;
|
||||||
|
*.csv) libreoffice "$file" ;;
|
||||||
|
# Other
|
||||||
|
*.html) "$BROWSER" "$file";;
|
||||||
|
*) ! [ -d "$file" ] && "$EDITOR" "$file" ;;
|
||||||
|
esac
|
34
scripts/p
34
scripts/p
|
@ -2,11 +2,39 @@
|
||||||
# Preview files & dirs
|
# Preview files & dirs
|
||||||
file="$1"
|
file="$1"
|
||||||
|
|
||||||
|
# Helps with fzf_nav visualization
|
||||||
|
rfile() {
|
||||||
|
file "$1" | sed 's/,\s/\n/g'
|
||||||
|
}
|
||||||
|
|
||||||
|
# If executable, run 'file' and exit
|
||||||
|
file "$file" | grep -q "executable" && rfile "$file" && exit
|
||||||
|
|
||||||
# If directory, list contents
|
# If directory, list contents
|
||||||
[ -d "$file" ] && (cd "$file" && /usr/bin/ls -A1Fx --color --group-directories-first)
|
[ -d "$file" ] && (cd "$file" && /usr/bin/ls -A1Fx --color --group-directories-first) && exit
|
||||||
|
|
||||||
case $file in
|
case $file in
|
||||||
*.csv) column -s, -t < "$file" ;;
|
# Images
|
||||||
*.html) links -dump "$file" ;;
|
*.jpeg) rfile "$file" ;;
|
||||||
|
*.png) rfile "$file" ;;
|
||||||
|
*.jpg) rfile "$file" ;;
|
||||||
|
*.gif) rfile "$file" ;;
|
||||||
|
*.svg) rfile "$file" ;;
|
||||||
|
# Videos
|
||||||
|
*.webm) rfile "$file" ;;
|
||||||
|
*.mp4) rfile "$file" ;;
|
||||||
|
*.flv) rfile "$file" ;;
|
||||||
|
*.mkv) rfile "$file" ;;
|
||||||
|
*.avi) rfile "$file" ;;
|
||||||
|
*.m4v) rfile "$file" ;;
|
||||||
|
# Audio
|
||||||
|
*.flac) rfile "$file" ;;
|
||||||
|
*.mp3) rfile "$file" ;;
|
||||||
|
*.ogg) rfile "$file" ;;
|
||||||
|
# Documents
|
||||||
|
*.pdf) pdftotext "$file" - || file "$file" ;;
|
||||||
|
*.csv) column -s, -t < "$file" || cat "$file" ;;
|
||||||
|
# Other
|
||||||
|
*.html) links -dump "$file" || cat "$file" ;;
|
||||||
*) ! [ -d "$file" ] && head -n 47 "$file" && printf "\n\n ..." ;;
|
*) ! [ -d "$file" ] && head -n 47 "$file" && printf "\n\n ..." ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue