blob: be63208314c5cc9fa2549851147165f9496927f3 (
plain) (
tree)
|
|
# 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
}}
# Key Mappings
map bg setwallpaper
|