cleanup
This commit is contained in:
parent
7cf53768a0
commit
3c4e0bccb0
|
@ -15,35 +15,15 @@ set promptfmt "\033[34;1m%u\033[36m@\033[34m%h \033[35m[\033[0;1m%d\033[35m]\033
|
||||||
cmd open $set -f; rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -p 0 $fx; clear
|
cmd open $set -f; rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -p 0 $fx; clear
|
||||||
|
|
||||||
cmd open-with ${{
|
cmd open-with ${{
|
||||||
clear
|
method=$(rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -l $fx | fzf)
|
||||||
set -f
|
|
||||||
rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -l $fx
|
|
||||||
read -p "Open with: " method
|
|
||||||
rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -p $method $fx
|
rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -p $method $fx
|
||||||
clear
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
|
cmd mkdir &mkdir -p "$(echo $* | tr ' ' '\ ')"
|
||||||
|
|
||||||
cmd extract ${{
|
cmd extract &aunpack $fx
|
||||||
clear; tput cup $(($(tput lines)/3)); tput bold
|
|
||||||
set -f
|
|
||||||
printf "%s\n\t" "$fx"
|
|
||||||
printf "extract?[y/N]"
|
|
||||||
read ans
|
|
||||||
clear
|
|
||||||
[ $ans = "y" ] && aunpack $fx
|
|
||||||
}}
|
|
||||||
|
|
||||||
cmd delete ${{
|
cmd delete &rm -rf -- $fx
|
||||||
clear; tput cup $(($(tput lines)/3)); tput bold
|
|
||||||
set -f
|
|
||||||
printf "%s\n\t" "$fx"
|
|
||||||
printf "delete?[y/N]"
|
|
||||||
read ans
|
|
||||||
clear
|
|
||||||
[ $ans = "y" ] && rm -rf -- $fx
|
|
||||||
}}
|
|
||||||
|
|
||||||
cmd trash %{{
|
cmd trash %{{
|
||||||
for f in $fx; do
|
for f in $fx; do
|
||||||
|
@ -52,21 +32,9 @@ cmd trash %{{
|
||||||
done
|
done
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd rsyncto ${{
|
|
||||||
clear; tput cup $(($(tput lines)/3)); tput bold
|
|
||||||
set -f
|
|
||||||
clear; echo -n "rsync -azvhP <selected files> "
|
|
||||||
read dest
|
|
||||||
clear
|
|
||||||
for x in $fx; do
|
|
||||||
eval rsync -azvhP \"$x\" \"$dest\"
|
|
||||||
done &&
|
|
||||||
notify-send "File(s) rsynced." "File(s) copies to $dest."
|
|
||||||
}}
|
|
||||||
|
|
||||||
# y (select for copy) and P to paste soft-link
|
# y (select for copy) and P to paste soft-link
|
||||||
# d (select for cut) and P to paste hard-link
|
# d (select for cut) and P to paste hard-link
|
||||||
cmd link %{{
|
cmd link &{{
|
||||||
set -- $(cat ~/.local/share/lf/files)
|
set -- $(cat ~/.local/share/lf/files)
|
||||||
mode="$1"
|
mode="$1"
|
||||||
shift
|
shift
|
||||||
|
@ -116,7 +84,7 @@ cmd paste &{{
|
||||||
lf -remote "send clear"
|
lf -remote "send clear"
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd dupe %{{
|
cmd dupe &{{
|
||||||
for file in $fx; do
|
for file in $fx; do
|
||||||
find "$PWD" "$file" -maxdepth 0 | grep -oP '(?<=.\.~)\d+(?=~$)' | sort -n | tail -1 | (
|
find "$PWD" "$file" -maxdepth 0 | grep -oP '(?<=.\.~)\d+(?=~$)' | sort -n | tail -1 | (
|
||||||
ext=$(($(cat /dev/stdin)+1))
|
ext=$(($(cat /dev/stdin)+1))
|
||||||
|
@ -192,6 +160,7 @@ map <enter> shell
|
||||||
map x $$f
|
map x $$f
|
||||||
map X !$f
|
map X !$f
|
||||||
map o open-with
|
map o open-with
|
||||||
|
map O $less $f
|
||||||
map a :rename; cmd-home # rename from beginning
|
map a :rename; cmd-home # rename from beginning
|
||||||
map r :rename; cmd-end # rename from end
|
map r :rename; cmd-end # rename from end
|
||||||
map i :rename # before extension
|
map i :rename # before extension
|
||||||
|
@ -203,7 +172,8 @@ map n &echo $f | xclip -r -selection c
|
||||||
map <esc> quit
|
map <esc> quit
|
||||||
map g/ cd "/"
|
map g/ cd "/"
|
||||||
map W &setsid $TERMINAL -e lf
|
map W &setsid $TERMINAL -e lf
|
||||||
map e edit
|
map e $$EDITOR $f
|
||||||
|
map E $sudo -e $f
|
||||||
|
|
||||||
# Load bookmark shortcuts
|
# Load bookmark shortcuts
|
||||||
source "~/.config/lf/shortcutrc"
|
source "~/.config/lf/shortcutrc"
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
date +'%X %x'
|
|
@ -17,5 +17,5 @@ if command -v apt 1>/dev/null 2>&1; then
|
||||||
out="$out$i/"
|
out="$out$i/"
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$updates_available" ] && printf "%b" "$big$icon$reset $(echo "$out" | sed 's/\/$//')"
|
[ -n "$updates_available" ] && printf "%b" "$big$icon$reset $(echo "$out" | sed 's/\/$//')" || exit 0
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,7 +7,6 @@ getfsroot() {
|
||||||
list() {
|
list() {
|
||||||
# 1st arg is trash files directory
|
# 1st arg is trash files directory
|
||||||
# 2nd arg is directory to match trash files for
|
# 2nd arg is directory to match trash files for
|
||||||
echo "$1 $2" > /dev/stderr
|
|
||||||
[ ! "$(command ls -A "$1")" ] && exit 1
|
[ ! "$(command ls -A "$1")" ] && exit 1
|
||||||
for file in "$1"/*; do
|
for file in "$1"/*; do
|
||||||
[ "$(head -1 "$file")" = "[Trash Info]" ] &&
|
[ "$(head -1 "$file")" = "[Trash Info]" ] &&
|
||||||
|
|
Loading…
Reference in New Issue