config/shell/browse: select locate result with fzf
This commit is contained in:
parent
b64646913d
commit
14f4d4c9b2
1776
.config/digikamrc
1776
.config/digikamrc
File diff suppressed because it is too large
Load Diff
|
@ -37,11 +37,12 @@ cd() {
|
|||
}
|
||||
|
||||
# LOCATE
|
||||
loci() { locate --all --ignore-case --basename --existing "$@" | command grep --extended-regexp --ignore-case --color=always $(echo "$|${@:$#}" | sed 's/ /|/g') | fzf --reverse --height=30% }
|
||||
alias fselect='fzf -0 -1 --reverse --height=30%'
|
||||
loci() { locate --all --ignore-case --basename --existing "$@" | command grep --extended-regexp --ignore-case --color=always $(echo "$|${@:$#}" | sed 's/ /|/g') | fselect }
|
||||
alias loc='noglob loci'
|
||||
alias uloc='noglob sudo updatedb && loci'
|
||||
# locate exactly
|
||||
locei() { locate --all --basename "\\$1" "$@" | fzf --reverse --height=30% }
|
||||
locei() { locate --all --basename "\\$1" "$@" | fselect }
|
||||
alias loce='noglob locei'
|
||||
# locate all
|
||||
alias loca='noglob sudo updatedb --prunenames "" /var/lib/mlocate/all.db && loci --database ""'
|
||||
|
|
|
@ -18,7 +18,7 @@ then shift
|
|||
if file "$path" | grep -i ' playlist' || expr "$path" : ".*\.m3u8\?$" >/dev/null
|
||||
then pushd "$(dirname "$path")" >/dev/null && cat "$path" | xargs --delim='\n' "$0" $verbose -r && popd >/dev/null
|
||||
else
|
||||
find "$path" -name "*.flac" -o -name "*.mp3" | while read file
|
||||
find "$path" -name "*.flac" -o -name "*.mp3" | sort | while read file
|
||||
do case "$path" in
|
||||
($MUSIC/*) echo "${file#$MUSIC/}";;
|
||||
(*) mkdir -p "$LINKS" && ln -fs "$file" "$LINKS/$(basename "$file")" && echo "${LINKS#$MUSIC/}/$(basename "$file")";;
|
||||
|
|
Loading…
Reference in New Issue