From 64fd3739fbede2ad4b8cd45c72fc54ce1aa2742f Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Sun, 15 Oct 2023 11:52:35 +0100 Subject: Replaced Ranger with lf - Config still a WIP --- .config/lf/lfrc | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .config/lf/lfrc (limited to '.config/lf/lfrc') diff --git a/.config/lf/lfrc b/.config/lf/lfrc new file mode 100644 index 0000000..8fda791 --- /dev/null +++ b/.config/lf/lfrc @@ -0,0 +1,59 @@ +# interpreter for shell commands +set shell bash + +# set '-eu' options for shell commands +# These options are used to have safer shell commands. Option '-e' is used to +# exit on error and option '-u' is used to give error for unset variables. +# Option '-f' disables pathname expansion which can be useful when $f, $fs, and +# $fx variables contain names with '*' or '?' characters. However, this option +# is used selectively within individual commands as it can be limiting at +# times. +set shellopts '-eu' + +# set internal field separator (IFS) to "\n" for shell commands +# This is useful to automatically split file names in $fs and $fx properly +# since default file separator used in these variables (i.e. 'filesep' option) +# is newline. You need to consider the values of these options and create your +# commands accordingly. +set ifs "\n" + +# leave some space at the top and the bottom of the screen +set scrolloff 10 + +# Use the `dim` attribute instead of underline for the cursor in the preview pane +set cursorpreviewfmt "\033[7;2m" + +# Show number of files in dirs instead of single size +set info size +set dircounts + +# Custom Additions +set drawbox true + +# Toggle hidden files +map . set hidden! + +# Set previewer and cleaner +set sixel +set previewer ~/.config/lf/previewer.sh + +# Set colours and icons +set icons + +# Custom Functions +cmd open ${{ + case $(file --mime-type "$f" -bL) in + image/*) imv "$f";; + *pdf*) zathura "$f";; + text/*|application/json) $EDITOR "$f";; + video/*) mpv "$f";; + *) for f in $fx; do setsid $OPENER $f 2>/dev/null & done ;; + esac +}} + +cmd setwallpaper ${{ + cp -f "$f" ~/.cache/wallpaper; pkill swaybg > /dev/null 2>&1; nohup swaybg -m fill -i ~/.cache/wallpaper > /dev/null 2>&1 & +}} + +# Key Mappings +map bg setwallpaper -- cgit v1.2.3