set ratios 1:2:3 set cleaner ~/.config/lf/cleaner set previewer ~/.config/lf/preview # Basic Settings set preview true set drawbox false set icons true set ignorecase true # Custom Functions cmd open ${{ case $(echo -n $f | rev | cut -d'.' -f1 | rev) in jnlp) javaws "$f" ;; mp3|flac|webm|ogg) mpv "$f" ;; *) case $(file --mime-type "$f" -bL) in text/*|application/json) $EDITOR "$f" ;; video/*) mpv "$f" ;; audio/*) mpv "$f" ;; application/pdf) zathura "$f" ;; image/*) nsxiv "$f" ;; *) xdg-open "$f" ;; esac ;; esac }} cmd execute ${{ exec "$f" }} cmd vimv ${{ exec vimv }} cmd mkdir ${{ printf "Directory Name: " read ans mkdir $ans }} cmd mkfile ${{ printf "File Name: " read ans $EDITOR $ans }} cmd chmod ${{ printf "Mode Bits: " read ans for file in "$fx" do chmod $ans $file done }} cmd sudomkfile ${{ printf "File Name: " read ans doas $EDITOR $ans }} cmd setwallpaper %cp "$f" ~/background.jpg && xwallpaper --center "$f" cmd fzf_jump ${{ res="$(find . -maxdepth 3 | fzf --reverse --header='Jump to location')" if [ -f "$res" ]; then cmd="select" elif [ -d "$res" ]; then cmd="cd" fi lf -remote "send $id $cmd \"$res\"" }} cmd broot_jump ${{ f=$(mktemp) res="$(broot --outcmd $f && cat $f | sed 's/cd //')" rm -f "$f" if [ -f "$res" ]; then cmd="select" elif [ -d "$res" ]; then cmd="cd" fi lf -remote "send $id $cmd \"$res\"" }} cmd open_config ${{ $EDITOR $(bookmenu -b ~/.config/bookmenu/configs -f fzf -o) }} cmd dragon %dragon-drop -a -x $fx cmd dragon-stay %dragon-drop -a $fx cmd dragon-individual %dragon-drop $fx cmd cpdragon %cpdragon cmd mvdragon %mvdragon cmd dlfile %dlfile # Archive bindings cmd unarchive ${{ case "$f" in *.zip) unzip "$f" ;; *.tar.gz) tar -xzvf "$f" ;; *.tar.bz2) tar -xjvf "$f" ;; *.tar.xz) tar -xJvf "$f" ;; *.tar) tar -xvf "$f" ;; *) echo "Unsupported format" ;; esac }} cmd gitpull ${{ git pull read dummy }} cmd gitadd ${{ git add $(basename $fx) }} cmd gitaddall ${{ git add . }} cmd gitpush ${{ git push read dummy }} cmd gitcommit ${{ git commit -S }} cmd gitdiff ${{ git diff read dummy }} cmd gitdifffile ${{ git diff `basename $fx` read dummy }} cmd gitstatus ${{ git status | less }} cmd gitrestore ${{ git restore `basename $fx` read dummy }} cmd gitsubmoduleupdate ${{ git submodule update read dummy }} cmd gitsubmoduleinit ${{ git submodule update --init read dummy }} cmd gitsubmoduleadd ${{ read url read folder git submodule add "$url" "$folder" read dummy }} cmd make ${{ make -j4 all read dummy }} cmd makeinstall ${{ sudo make -j4 install read dummy }} cmd makeclean ${{ make -j4 clean read dummy }} cmd openshell ${{ zsh }} cmd catclip ${{ catclip "$fx" }} cmd zip %zip -r "$f" "$f" cmd tar %tar cvf "$f.tar" "$f" cmd targz %tar cvzf "$f.tar.gz" "$f" cmd tarbz2 %tar cjvf "$f.tar.bz2" "$f" # Trash cli bindings cmd trash ${{ files=$(printf "$fx" | tr '\n' ';') while [ "$files" ]; do # extract the substring from start of string up to delimiter. # this is the first "element" of the string. file=${files%%;*} trash-put "$(basename "$file")" # if there's only one element left, set `files` to an empty string. # this causes us to exit this `while` loop. # else, we delete the first "element" of the string from files, and move onto the next. if [ "$files" = "$file" ]; then files='' else files="${files#*;}" fi done }} cmd clear_trash %trash-empty cmd restore_trash ${{ trash-restore }} cmd stripspace %stripspace "$f" # Bindings # Remove some defaults map m map o map n map "'" map '"' map d map c map e map f map , # ZachIR bindings map ,gp gitpull map ,gP gitpush map ,gc gitcommit map ,ga gitadd map ,gA gitaddall map ,gd gitdifffile map ,gD gitdiff map ,gu gitsubmoduleupdate map ,gi gitsubmoduleinit map ,gm gitsubmoduleadd map ,gs gitstatus map ,gr gitrestore map ,mk make map ,mi makeinstall map ,mC makeclean map ,ss openshell map ,sc catclip map ,vv vimv # Not really image preview map - $~/.config/lf/draw_img "$f" cmd video_preview ${{ CACHE=$(mktemp /tmp/thumb_cache.XXXXX) ffmpegthumbnailer -i "$f" -o $CACHE -s 0 ~/.config/lf/draw_img $CACHE && rm $CACHE }} map + :video_preview # File Openers map ee $$EDITOR "$f" map u $view "$f" # Archive Mappings map az zip map at tar map ag targz map ab targz map au unarchive # Trash Mappings map dd trash map tc clear_trash map tr restore_trash # Broot Mapping map f broot_jump # Dragon Mapping map dr dragon map ds dragon-stay map di dragon-individual map dm mvdragon map dc cpdragon map dl dlfile map ss stripspace # Basic Functions map .. set hidden! map ./ execute map DD delete map p paste map x cut map y copy map open map mf mkfile map mr sudomkfile map md mkdir map ms $mkscript map ch chmod map bg setwallpaper map o open_config map br $vimv $fx map r rename map H top map L bottom map R reload map C clear map U unselect # Movement map g. cd "/home/zachir" ## PATHS map gE. cd "/etc" map gO. cd "/opt" map gOa cd "/opt/Audio Assault" map gR cd "/" map gU. cd "/usr" map gUs cd "/usr/share" map gV. cd "/var" map gaw cd "/home/zachir/.config/awesome" map gb. cd "/home/zachir/.local/bin" map gbb cd "/home/zachir/.local/bin/blocks" map gbf cd "/home/zachir/.local/bin/slatpak-sc" map gbg cd "/home/zachir/.local/bin/generics" map gbi cd "/home/zachir/.local/bin/ignore" map gbsc cd "/home/zachir/.local/bin/scripts" map gbsh cd "/home/zachir/.local/bin/shortcmds" map gbsp cd "/home/zachir/.local/bin/sp" map gc cd "/home/zachir/.config" map gdb cd "/home/zachir/.local/src/dwmbar" map gdc cd "/home/zachir/Documents" map gdl cd "/home/zachir/.local/src/dwl" map gdm cd "/home/zachir/.local/src/dmenu" map gdo cd "/home/zachir/Downloads" map gdp cd "/home/zachir/Downloads/plugin/zachir_librem.one" map gdw cd "/home/zachir/Downloads/wine" map ge cd "/home/zachir/Desktop" map gf cd "/home/zachir/.var/app" map gh cd "/home/zachir/.config/hypr" map glb cd "/home/zachir/.local/bin" map glc cd "/home/zachir/Games/cache" map glf cd "/home/zachir/.config/lf" map gls cd "/home/zachir/.local/share" map gn3 cd "/home/zachir/.vst3/native" map gns cd "/home/zachir/.vst/native" map gnv cd "/home/zachir/.config/nvim" map gp cd "/home/zachir/Pictures" map gqb cd "/home/zachir/.config/qutebrowser" map gqp cd "/home/zachir/.local/share/qutebrowser-profiles" map gre cd "/home/zachir/.local/src" map grs cd "/etc/runit/sv" map gsc cd "/home/zachir/.local/bin/scripts" map gsh cd "/home/zachir/.config/sh" map gsl cd "/home/zachir/.local/src/slock" map gss cd "/etc/s6/sv" map gst cd "/home/zachir/.local/src/st" map gsx cd "/home/zachir/.config/sxhkd" map gtr cd "/home/zachir/.local/share/Trash/files" map gurs cd "/home/zachir/.runit/sv" map gv3. cd "/home/zachir/.vst3" map gv3n cd "/home/zachir/.vst3/native" map gv3y cd "/home/zachir/.vst3/yabridge" map gv. cd "/home/zachir/var" map gvi cd "/home/zachir/Videos" map gvsn cd "/home/zachir/.vst/native" map gvs. cd "/home/zachir/.vst" map gvsy cd "/home/zachir/.vst/yabridge" map gwdo cd "/home/zachir/.local/share/wineprefixes/default/drive_c/users/zachir/Downloads" map gwa cd "/home/zachir/.local/src/wallpapers" map gwd cd "/home/zachir/.local/share/wineprefixes/default" map gwr cd "/home/zachir/.local/share/wineprefixes" map gwv3 cd "/home/zachir/.winvst3" map gwvs cd "/home/zachir/.winvst" map gww cd "/home/zachir/.local/share/wineprefixes/work" map gx cd "/home/zachir/.config/X11" map gy3 cd "/home/zachir/.vst3/yabridge" map gyb cd "/home/zachir/.cache/yay" map gyc cd "/home/zachir/.config/yay" map gzs cd "/home/zachir/.config/zsh" map gzx cd "/home/zachir/Documents/zachir.xyz"