set default preview fmt and hide hidden folders

This commit is contained in:
mintycube 2024-05-16 21:23:57 +05:00
parent 2562c98132
commit 1f382a8c10
2 changed files with 46 additions and 24 deletions

View File

@ -3,7 +3,7 @@ set shellopts '-eu'
set ifs "\n" set ifs "\n"
set scrolloff 8 set scrolloff 8
set icons set icons
set hidden! set nohidden
set period 1 set period 1
set sortby ext set sortby ext
set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
@ -11,7 +11,7 @@ set promptfmt "\033[32m \033[35;1m%d\033[0m\033[1m%f\033[0m"
# set cleaner '~/.config/lf/cleaner' # set cleaner '~/.config/lf/cleaner'
# set previewer '~/.config/lf/scope' # set previewer '~/.config/lf/scope'
set autoquit true set autoquit true
set cursorpreviewfmt "\033[7m" # set cursorpreviewfmt "\033[7m"
set previewer ctpv set previewer ctpv
set cleaner ctpvclear set cleaner ctpvclear
@ -22,7 +22,7 @@ set cleaner ctpvclear
cmd open ${{ cmd open ${{
case $(file --mime-type "$(readlink -f $f)" -b) in case $(file --mime-type "$(readlink -f $f)" -b) in
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;; application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;;
image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; image/vnd.djvu|application/pdf|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;;
text/html) $EDITOR $fx;; text/html) $EDITOR $fx;;
text/*|application/json|inode/x-empty|application/x-subrip|application/javascript) $EDITOR $fx;; text/*|application/json|inode/x-empty|application/x-subrip|application/javascript) $EDITOR $fx;;
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
@ -38,7 +38,13 @@ cmd open ${{
video/*) setsid -f mpv --loop-file $f -quiet >/dev/null 2>&1 ;; video/*) setsid -f mpv --loop-file $f -quiet >/dev/null 2>&1 ;;
application/pdf|application/vnd.djvu|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; application/pdf|application/vnd.djvu|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
application/pgp-encrypted) $EDITOR $fx ;; application/pgp-encrypted) $EDITOR $fx ;;
application/vnd.openxmlformats-officedocument.wordprocessingml.document|application/vnd.oasis.opendocument.text|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|application/octet-stream|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f libreoffice $fx >/dev/null 2>&1 ;; application/vnd.openxmlformats-officedocument.wordprocessingml.document|application/vnd.oasis.opendocument.text|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f libreoffice $fx >/dev/null 2>&1 ;;
application/octet-stream) case ${f##*.} in
doc|docx|xls|xlsx|odt|ppt|pptx) setsid -f libreoffice $fx >/dev/null 2>&1 ;;
ghw) setsid -f gtkwave $f >/dev/null 2>&1 ;;
ts) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
*) setsid -f zathura $fx >/dev/null 2>&1 ;;
esac ;;
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
esac esac
}} }}
@ -203,7 +209,12 @@ map V push :!nvim<space>
map W $setsid -f $TERMINAL >/dev/null 2>&1 map W $setsid -f $TERMINAL >/dev/null 2>&1
map Y $printf "%s" "$fx" | xclip -selection clipboard map U $printf "%s" "$fx" | xclip -selection clipboard
map u $printf "%s" "$fx" | sed 's/.*\///' | xclip -selection clipboard
map . $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
map <gt> $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/piped.video\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
map T $sxiv -t "$(pwd)" # opens thumbnail mode
map <c-l> unselect
# Source Bookmarks # Source Bookmarks
source "~/.config/lf/shortcutrc" source "~/.config/lf/shortcutrc"

View File

@ -165,13 +165,14 @@ static const Rule rules[] = {
RULE(.wintype = WTYPE "UTILITY", .isfloating = 1) RULE(.wintype = WTYPE "UTILITY", .isfloating = 1)
RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1) RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1)
RULE(.wintype = WTYPE "SPLASH", .isfloating = 1) RULE(.wintype = WTYPE "SPLASH", .isfloating = 1)
// RULE(.class = "Gimp", .tags = 1 << 4) RULE(.class = "st-terminal", .tags = 1 << 0, .switchtag = 1)
RULE(.instance = "st",.class = "St", .title = "~", .tags = 1, .switchtag = 3) RULE(.class = "firefox", .tags = 1 << 1, .switchtag = 1)
RULE(.class = "firefox", .tags = 1 << 1, .switchtag = 3) RULE(.title = "nvim", .tags = 1 << 2, .switchtag = 1)
RULE(.title = "nvim", .tags = 1 << 2, .switchtag = 3) RULE(.title = "lf", .tags = 1 << 3, .switchtag = 1)
RULE(.title = "lf", .tags = 1 << 3, .switchtag = 3)
RULE(.class = "mpv", .tags = 1 << 4, .switchtag = 3) RULE(.class = "mpv", .tags = 1 << 4, .switchtag = 3)
RULE(.title = "newsboat", .tags = 1 << 5, .switchtag = 3) RULE(.title = "newsboat", .tags = 1 << 5, .switchtag = 3)
RULE(.class = "Zathura", .tags = 1 << 6, .switchtag = 3)
RULE(.title = "nsxiv", .tags = 1 << 7, .switchtag = 3)
RULE(.class = "Gimp", .tags = 1 << 8, .switchtag = 3) RULE(.class = "Gimp", .tags = 1 << 8, .switchtag = 3)
RULE(.instance = "spterm", .tags = SPTAG(0), .isfloating = 1) RULE(.instance = "spterm", .tags = SPTAG(0), .isfloating = 1)
RULE(.instance = "spcalc", .tags = SPTAG(1), .isfloating = 1) RULE(.instance = "spcalc", .tags = SPTAG(1), .isfloating = 1)
@ -253,12 +254,14 @@ static const char* volume_ui_cmd[] = { "st", "-c", "volume-ui", "-g=80x15+353+20
static const Key on_empty_keys[] = { static const Key on_empty_keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{0, XK_w, spawn, {.v = (const char*[]){"firefox", NULL } } }, {0, XK_w, spawn, {.v = (const char*[]){"firefox", NULL } } },
{0, XK_e, spawn, {.v = (const char*[]){"st","bash","-c", "fuz", "-lf", NULL } } },
{0, XK_grave, spawn, {.v = (const char*[]){"dmenunerdsymbols", NULL } } }, {0, XK_grave, spawn, {.v = (const char*[]){"dmenunerdsymbols", NULL } } },
{0, XK_BackSpace, spawn, {.v = (const char*[]){"sysact", NULL } } }, {0, XK_BackSpace, spawn, {.v = (const char*[]){"sysact", NULL } } },
{0, XK_r, spawn, {.v = (const char*[]){"st", "-e", "lf", NULL } } }, {0, XK_r, spawn, {.v = (const char*[]){"st", "-e", "lf", NULL } } },
{0, XK_Return, spawn, {.v = (const char *[]){"st", NULL}}}, {0, XK_Return, spawn, {.v = (const char*[]){"st", "-c", "st-terminal", NULL } } },
{0, XK_d, spawn, {.v = dmenu_run_cmd } }, {0, XK_d, spawn, {.v = dmenu_run_cmd } },
{0, XK_a, spawn, {.v = (const char*[]){"dmenu_hub", NULL } } }, {0, XK_a, spawn, {.v = (const char*[]){"dmenu_hub", NULL } } },
{0, XK_f, spawn, {.v = (const char*[]){"st","bash","-c", "fuz", NULL } } },
{0, XK_space, spawn, {.v = (const char*[]){"dmenu_web", NULL } } }, {0, XK_space, spawn, {.v = (const char*[]){"dmenu_web", NULL } } },
{0, XK_n, spawn, {.v = (const char*[]){"st", "-e", "nvim", NULL } } }, {0, XK_n, spawn, {.v = (const char*[]){"st", "-e", "nvim", NULL } } },
}; };
@ -301,7 +304,8 @@ static const Key keys[] = {
{ MODKEY, XK_q, killclient, {0} }, { MODKEY, XK_q, killclient, {0} },
{ MODKEY|ShiftMask, XK_q, killunsel, {0} }, { MODKEY|ShiftMask, XK_q, killunsel, {0} },
{ MODKEY, XK_w, spawn, {.v = (const char*[]){ "firefox", NULL } } }, { MODKEY, XK_w, spawn, {.v = (const char*[]){ "firefox", NULL } } },
{ MODKEY, XK_e, spawn, {.v = (const char*[]){ "networkmanager_dmenu", NULL } } }, { MODKEY, XK_e, spawn, {.v = (const char*[]){ "st","bash","-c", "fuz", "-lf", NULL } } },
{ ALTKEY, XK_e, spawn, {.v = (const char*[]){ "networkmanager_dmenu", NULL } } },
{ MODKEY, XK_r, spawn, {.v = (const char*[]){ "st", "-e", "lf", NULL } } }, { MODKEY, XK_r, spawn, {.v = (const char*[]){ "st", "-e", "lf", NULL } } },
{ MODKEY|ShiftMask, XK_r, spawn, {.v = (const char*[]){ "thunar", NULL } } }, { MODKEY|ShiftMask, XK_r, spawn, {.v = (const char*[]){ "thunar", NULL } } },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
@ -312,7 +316,8 @@ static const Key keys[] = {
{ MODKEY|ShiftMask, XK_o, incnmaster, {.i = -1 } }, { MODKEY|ShiftMask, XK_o, incnmaster, {.i = -1 } },
{ MODKEY, XK_a, spawn, {.v = (const char*[]){ "dmenu_hub", NULL } } }, { MODKEY, XK_a, spawn, {.v = (const char*[]){ "dmenu_hub", NULL } } },
{ MODKEY, XK_d, spawn, {.v = dmenu_run_cmd } }, { MODKEY, XK_d, spawn, {.v = dmenu_run_cmd } },
{ MODKEY, XK_f, togglefakefullscreen, {0} }, { MODKEY, XK_f, spawn, {.v = (const char*[]){ "st","bash","-c", "fuz", NULL } } },
{ ALTKEY, XK_f, togglefakefullscreen, {0} },
{ MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } },
@ -320,8 +325,8 @@ static const Key keys[] = {
{ ALTKEY, XK_l, spawn, {.v = (const char*[]){"dictionary", NULL } } }, { ALTKEY, XK_l, spawn, {.v = (const char*[]){"dictionary", NULL } } },
{ MODKEY|ShiftMask, XK_apostrophe, togglescratch, {.ui = 2 } }, { MODKEY|ShiftMask, XK_apostrophe, togglescratch, {.ui = 2 } },
{ MODKEY, XK_apostrophe, togglescratch, {.ui = 1 } }, { MODKEY, XK_apostrophe, togglescratch, {.ui = 1 } },
{ MODKEY, XK_Return, spawn, {.v = (const char *[]){"st", NULL}}}, { MODKEY, XK_Return, spawn, {.v = (const char *[]){"st", "-c", "st-terminal", NULL}}},
{ ALTKEY, XK_Return, spawn, {.v = (const char *[]){"st", "-c", "st", NULL}}}, { ALTKEY, XK_Return, spawn, {.v = (const char *[]){"st", NULL}}},
{ MODKEY|ShiftMask, XK_Return, togglescratch, {.ui = 0 } }, { MODKEY|ShiftMask, XK_Return, togglescratch, {.ui = 0 } },
{ MODKEY, XK_x, transfer, {0} }, { MODKEY, XK_x, transfer, {0} },
{ MODKEY, XK_b, togglebar, {0} }, { MODKEY, XK_b, togglebar, {0} },
@ -368,6 +373,12 @@ static const Button buttons[] = {
{ ClkStatusText, 0, Button4, sigstatusbar, {.i = 4} }, { ClkStatusText, 0, Button4, sigstatusbar, {.i = 4} },
{ ClkStatusText, 0, Button5, sigstatusbar, {.i = 5} }, { ClkStatusText, 0, Button5, sigstatusbar, {.i = 5} },
{ ClkStatusText, ShiftMask, Button1, sigstatusbar, {.i = 6} }, { ClkStatusText, ShiftMask, Button1, sigstatusbar, {.i = 6} },
{ ClkStatusText, MODKEY, Button1, sigstatusbar, {.i = 1 } },
{ ClkStatusText, MODKEY, Button2, sigstatusbar, {.i = 2 } },
{ ClkStatusText, MODKEY, Button3, sigstatusbar, {.i = 3 } },
{ ClkStatusText, MODKEY, Button4, sigstatusbar, {.i = 4} },
{ ClkStatusText, MODKEY, Button5, sigstatusbar, {.i = 5} },
{ ClkStatusText, MODKEY|ShiftMask, Button1, sigstatusbar, {.i = 6} },
{ ClkClientWin, 0, Button2, spawn, {.v = (const char*[]){ "dictionary", NULL } } }, { ClkClientWin, 0, Button2, spawn, {.v = (const char*[]){ "dictionary", NULL } } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} }, { ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} }, { ClkClientWin, MODKEY, Button2, togglefloating, {0} },