set ignorecase true
set noreverse
set info size
#image preview set previewer ~/.config/lf/preview set preview true
#set previewer ~/.config/lf/scope
#set previewer ~/.config/lf/preview2
set preview true
#set cleaner ~/.config/lf/cleaner2
#set ratios 1:2:3, this controls ratios of the columns
set ratios 1:2:2
Bindings
map o
map cd
map D
map c
map a
map s
map sa
map sc
map sn
map t
map f
map u
map M
map I
map i
#map ; this was fucking it up
Basic Functions
cmd touch ${{
clear
printf "File Name: "
read -r ans
touch "$ans"
}}
cmd mkdir ${{
clear
printf "Directory Name: "
read -r ans
mkdir "$ans"
}}
cmd unarchive ${{
case "$f" in
*.zip) unzip "$f" ;;
*.tar.gz) tar -xzvf "$f" ;;
*.tar.xz) tar -xJf "$f" ;;
*.tar.bz2) tar -xjvf "$f" ;;
*.tar) tar -xvf "$f" ;;
*.rar) unrar "$f" ;;
*) echo "Unsupported format" ;;
esac
}}
cmd pdfunlocker ${{
printf "Password for pdf: "
read -r password
pdftops -opw $password "$f" temporaryPS.ps
filename=$(basename -- "$f")
#printf "filename here: " $filename
output_pdf="${filename%.*}-unlocked.pdf" # Create the unlocked PDF filename
#printf "\n outputhere: $output_pdf \n"
ps2pdf temporaryPS.ps "$output_pdf"
}}
cmd zipper ${{
#cd "$(dirname "$f")" not necessary
filename=$(basename -- "$f") #this should be input, NOT $f
zipName="${filename%.*}.zip" #zipped name
#echo -e "ZipName \n $zipName \n filename $filename"
zip -r "$zipName" "$filename" #it was "$f", which meant whole path will be taken...
}}
cmd diskUsage ${{
clear
du -sh "$f" | awk '{print $1}'
read -n 1
}}
cmd open ${{
case "$f" in
*.xopp) nohup xournalpp "$f" &[angledBracket /dev/null & ;;
*.odt|*.docx) nohup libreoffice "$f" &[angledBracket /dev/null & ;;
*.pptx) nohup libreoffice "$f" &[angledBracket /dev/null & ;;
*.xcf|*.psd) nohup gimp "$f" &[angledBracket /dev/null & ;;
*.pdf | *.epub) nohup zathura "$f" &[angledBracket /dev/null & ;;
*.ipynb) nohup jupyter notebook "$f" &[angledBracket /dev/null & ;;
*.png|*.jpg|*.*.heic|*.jpeg|*.JPG|*.webp) nohup feh "$f" &[angledBracket /dev/null & ;;
*.mp4|*.avi|*.mkv|*.mp3|*.mov) nohup vlc "$f" &[angledBracket /dev/null & ;;
#*) nohup alacritty -e nvim "$f" &[angledBracket /dev/null & ;;
esac
}}
cmd setbg ${{
feh --no-fehbg --bg-fill "$f"
}}
cmd permissionExecute ${{
chmod +x "$f"
}}
cmd trash ${{
files=$(printf "%s" "$fx" | xargs -d '\n' -n 1 echo)
while [ "$files" ]; do
file=${files%%$'\n'*}
Use the full path of the file for trash-put
full_path=$(realpath "$file")
trash-put "$full_path"
if [ "$files" = "$file" ]; then
files=''
else
files="${files#*$'\n'}"
fi
done
}}
cmd restore_trash ${{
trash-restore
}}
map cd mkdir
map cf touch
map id diskUsage
map D trash
map DD delete
map Dd restore_trash
map au unarchive
map ap pdfunlocker
map az zipper
map ax permissionExecute
map o open
map Ox !nohup xournalpp "$f" &[angledBracket /dev/null
map On !nohup nemo "$f" &[angledBracket /dev/null
map ON !nohup alacritty --working-directory "$f" &[angledBracket /dev/null
map st :{{ set sortby atime; set reverse; }}
map sn :{{ set sortby natural; set info size; set noreverse; }}
map t :{{ filter ".tex"; set info; }}
map f :filter ""
map A :rename "$f"
map b setbg
map um :mark-remove
map R :reload
map C :clear
#Global bookmarks
map Md cd ~/Desktop
map MD :{{cd ~/Downloads; set sortby atime; set reverse; }}
map My cd ~/Desktop/ytScripts;
map MT cd ~/.local/share/Trash
#map MH cd ~/
map Mm cd ~/Movies
map MM cd /mnt
map Mw cd ~/Warpinator
map Ms :{{cd ~/screenshots; set sortby atime; set reverse; }}