aboutsummaryrefslogtreecommitdiff
path: root/.config/lf/lfrc
diff options
context:
space:
mode:
Diffstat (limited to '.config/lf/lfrc')
-rw-r--r--.config/lf/lfrc59
1 files changed, 59 insertions, 0 deletions
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