1
0
Fork 0
This commit is contained in:
Luca Bilke 2023-11-22 10:21:14 +01:00
parent 7cf53768a0
commit 3c4e0bccb0
4 changed files with 12 additions and 41 deletions

View File

@ -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-with ${{
clear
set -f
rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -l $fx
read -p "Open with: " method
method=$(rifle -c $XDG_CONFIG_HOME/lf/rifle.conf -l $fx | fzf)
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 ${{
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 extract &aunpack $fx
cmd delete ${{
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 delete &rm -rf -- $fx
cmd trash %{{
for f in $fx; do
@ -52,21 +32,9 @@ cmd trash %{{
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
# d (select for cut) and P to paste hard-link
cmd link %{{
cmd link &{{
set -- $(cat ~/.local/share/lf/files)
mode="$1"
shift
@ -116,7 +84,7 @@ cmd paste &{{
lf -remote "send clear"
}}
cmd dupe %{{
cmd dupe &{{
for file in $fx; do
find "$PWD" "$file" -maxdepth 0 | grep -oP '(?<=.\.~)\d+(?=~$)' | sort -n | tail -1 | (
ext=$(($(cat /dev/stdin)+1))
@ -192,6 +160,7 @@ map <enter> shell
map x $$f
map X !$f
map o open-with
map O $less $f
map a :rename; cmd-home # rename from beginning
map r :rename; cmd-end # rename from end
map i :rename # before extension
@ -203,7 +172,8 @@ map n &echo $f | xclip -r -selection c
map <esc> quit
map g/ cd "/"
map W &setsid $TERMINAL -e lf
map e edit
map e $$EDITOR $f
map E $sudo -e $f
# Load bookmark shortcuts
source "~/.config/lf/shortcutrc"

2
.local/bin/statusbar/sb-date Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
date +'%X %x'

View File

@ -17,5 +17,5 @@ if command -v apt 1>/dev/null 2>&1; then
out="$out$i/"
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

View File

@ -7,7 +7,6 @@ getfsroot() {
list() {
# 1st arg is trash files directory
# 2nd arg is directory to match trash files for
echo "$1 $2" > /dev/stderr
[ ! "$(command ls -A "$1")" ] && exit 1
for file in "$1"/*; do
[ "$(head -1 "$file")" = "[Trash Info]" ] &&