From bf95e02fc17d758dfddb98ff18fa4c793f62a63a Mon Sep 17 00:00:00 2001 From: vibikim Date: Sun, 22 Nov 2020 14:36:39 +0200 Subject: [PATCH] finally an lfrc --- install.sh | 2 +- lf/lfrc | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ sxhkd/sxhkdrc | 8 +++-- 3 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 lf/lfrc diff --git a/install.sh b/install.sh index adbeedf..867887d 100755 --- a/install.sh +++ b/install.sh @@ -18,10 +18,10 @@ gohome .Xresources goconfig bspwm goconfig dunst goconfig polybar -goconfig kitty goconfig sxhkd goconfig picom.conf goconfig nvim +goconfig lf #install fonts cp -r $PWD/polybar/fonts/* ~/.local/share/fonts diff --git a/lf/lfrc b/lf/lfrc new file mode 100644 index 0000000..b5c694d --- /dev/null +++ b/lf/lfrc @@ -0,0 +1,91 @@ +set previewer ~/.config/lf/preview +# Basic Settings +set preview true +set hidden true +set color256 true +set icons true +set ignorecase true + +# Custom Functions +cmd open ${{ + case $(file --mime-type "$f" -bL) in + text/*|application/json) $EDITOR "$f";; + video/*|image/*/application/pdf) xdg-open "$f";; + *) xdg-open "$f" ;; + esac +}} + +# exectue the file (it has to be executable, ofc) +map X !$f + +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 + + lf -remote 'send reload' +}} + +cmd sudomkfile ${{ + printf "File Name: " + read ans + sudo $EDITOR $ans +}} + +# Archive bindings +cmd unarchive ${{ + case "$f" in + *.zip) unzip "$f" ;; + *.tar.gz) tar -xzvf "$f" ;; + *.tar.bz2) tar -xjvf "$f" ;; + *.tar) tar -xvf "$f" ;; + *) echo "Unsupported format" ;; + esac +}} + +### +# Basic Binds +### + +map ua unarchive +map DD delete +map x cut +map x cut +map y copy +map open +map mf mkfile +map mr sudomkfile +map x cut +map y copy +map open +map mf mkfile +map mr sudomkfile +map md mkdirap md mkdir + +### +# Directory shortcuts +### + +map gh :cd ~/ +map gw :cd /run/media/vibikim/WAD +map gc :cd ~/.config +map gd :cd ~/Downloads +map gD :cd ~/Documents +map gr :cd ~/repos +map gf :cd ~/facultate diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc index 4d7d07f..fcd7bad 100644 --- a/sxhkd/sxhkdrc +++ b/sxhkd/sxhkdrc @@ -18,7 +18,7 @@ super + shift + f super + shift + n thunderbird super + shift + Return - $FILEMANAGER + $TERMINAL -e lf super + shift + d discord @@ -137,7 +137,7 @@ super + bracket{left,right} bspc desktop -f {prev,next}.local # focus the older or newer node in the focus history -super + {o,i}sdfsdf +super + {o,i} bspc wm -h off; \ bspc node {older,newer} -f; \ bspc wm -h on @@ -146,6 +146,10 @@ super + {o,i}sdfsdf super + {_,shift + }{1-9,0} bspc {desktop -f,node -d} '^{1-9,10}' +# rotate the tree rooted at the selected node +super + {r,R} + bspc node @parent -R {90,270} + # # preselect #