diff options
author | Justine Smithies <justine@smithies.me.uk> | 2024-11-08 20:48:58 +0000 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2024-11-08 20:48:58 +0000 |
commit | c2fbc4d1717864a0055592e0b73d71c010e8686c (patch) | |
tree | 76e5bf50cc0f9c1b83f474740a8015d7f4e0ef26 /.config/lf/lfrc | |
parent | b9d24b3b6bdaed04fab07d9150c51d4f0f7a5c7d (diff) |
Initial commit
Diffstat (limited to '.config/lf/lfrc')
-rw-r--r-- | .config/lf/lfrc | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/.config/lf/lfrc b/.config/lf/lfrc new file mode 100644 index 0000000..ebf11ba --- /dev/null +++ b/.config/lf/lfrc @@ -0,0 +1,61 @@ +# 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/*) setsid imv $f >/dev/null 2>&1 &;; + *pdf*) setsid zathura $fx >/dev/null 2>&1 & ;; + text/*|application/json) $EDITOR "$f";; + video/*) setsid mpv $f -quiet >/dev/null 2>&1 & ;; + *) 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 & + # cp -f "$f" ~/.cache/wallpaper && qtile cmd-obj -o cmd -f reload_config + echo "$f" > ~/.cache/wallpaper; sh ~/.config/hypr/scripts/wallpaper.sh > /dev/null 2>&1 & +}} + +# Key Mappings +map bg setwallpaper |