lf: improve opener, change icons

This commit is contained in:
krolxon 2025-09-20 17:52:23 +05:30
parent 92e2da70f0
commit b13ae738e9
3 changed files with 643 additions and 168 deletions

View File

@ -1,4 +0,0 @@
#!/bin/sh
if [ -n "$FIFO_UEBERZUG" ]; then
printf '{"action": "remove", "identifier": "PREVIEW"}\n' > "$FIFO_UEBERZUG"
fi

View File

@ -2,159 +2,633 @@ di 
fi  fi 
ln  ln 
or  or 
ex  ex
*.vimrc  *kritadisplayrc 
*.viminfo  *.gtkrc-2.0 
*.gitignore  *bspwmrc 
*.c  *webpack 󰜫
*.cc  *tsconfig.json 
*.clj  *.vimrc 
*.coffee  *gemfile$ 
*.cpp  *xmobarrc 
*.css  *avif 
*.d  *fp-info-cache 
*.dart  *.zshrc 
*.erl  *robots.txt 󰚩
*.exs  *dockerfile 󰡨
*.fs  *.git-blame-ignore-revs 
*.go  *.nvmrc 
*.h  *hyprpaper.conf 
*.hh  *.prettierignore 
*.hpp  *rakefile 
*.hs  *code_of_conduct 
*.html  *cmakelists.txt 
*.java  *.env 
*.jl  *copying.lesser 
*.js  *readme 󰂺
*.json  *settings.gradle 
*.lua  *gruntfile.coffee 
*.md  *.eslintignore 
*.php  *kalgebrarc 
*.pl  *kdenliverc 
*.pro  *.prettierrc.cjs 
*.py  *cantorrc 
*.rb  *rmd 
*.rs  *vagrantfile$ 
*.scala  *.Xauthority 
*.ts  *prettier.config.ts 
*.vim  *node_modules 
*.cmd  *.prettierrc.toml 
*.ps1  *build.zig.zon 
*.sh  *.ds_store 
*.bash  *PKGBUILD 
*.zsh  *.prettierrc 
*.fish  *.bash_profile 
*.tar  *.npmignore 
*.tgz  *.mailmap 󰊢
*.arc  *.codespellrc 󰓆
*.arj  *svelte.config.js 
*.taz  *eslint.config.ts 
*.lha  *config 
*.lz4  *.gitlab-ci.yml 
*.lzh  *.gitconfig 
*.lzma  *_gvimrc 
*.tlz  *.xinitrc 
*.txz  *checkhealth 󰓙
*.tzo  *sxhkdrc 
*.t7z  *.bashrc 
*.zip  *tailwind.config.mjs 󱏿
*.z  *ext_typoscript_setup.txt 
*.dz  *commitlint.config.ts 󰜘
*.gz  *py.typed 
*.cz  *.nanorc 
*.lrz  *commit_editmsg 
*.lz  *.luaurc 
*.lzo  *fp-lib-table 
*.xz  *.editorconfig 
*.zst  *justfile 
*.tzst  *kdeglobals 
*.bz2  *license.md 
*.bz  *.clang-format 
*.tbz  *docker-compose.yaml 󰡨
*.tbz2  *copying 
*.tz  *go.mod 
*.deb  *lxqt.conf 
*.rpm  *brewfile 
*.jar  *gulpfile.coffee 
*.war  *.dockerignore 󰡨
*.ear  *.settings.json 
*.sar  *tailwind.config.js 󱏿
*.rar  *.clang-tidy 
*.alz  *.gvimrc 
*.ace  *nuxt.config.cjs 󱄆
*.zoo  *xsettingsd.conf 
*.cpio  *nuxt.config.js 󱄆
*.7z  *eslint.config.cjs 
*.rz  *sym-lib-table 
*.cab  *.condarc 
*.wim  *xmonad.hs 
*.swm  *tmux.conf 
*.dwm  *xmobarrc.hs 
*.esd  *.prettierrc.yaml 
*.jpg  *.pre-commit-config.yaml 󰛢
*.jpeg  *i3blocks.conf 
*.mjpg  *xorg.conf 
*.mjpeg  *.zshenv 
*.gif  *vlcrc 󰕼
*.bmp  *license 
*.pbm  *unlicense 
*.pgm  *tmux.conf.local 
*.ppm  *.SRCINFO 󰣇
*.tga  *tailwind.config.ts 󱏿
*.xbm  *security.md 󰒃
*.xpm  *security 󰒃
*.tif  *.eslintrc 
*.tiff  *gradle.properties 
*.png  *code_of_conduct.md 
*.svg  *PrusaSlicerGcodeViewer.ini 
*.svgz  *PrusaSlicer.ini 
*.mng  *procfile 
*.pcx  *mpv.conf 
*.mov  *.prettierrc.json5 
*.mpg  *i3status.conf 
*.mpeg  *prettier.config.mjs 
*.m2v  *.pylintrc 
*.mkv  *prettier.config.cjs 
*.webm  *.luacheckrc 
*.ogm  *containerfile 󰡨
*.mp4  *eslint.config.mjs 
*.m4v  *gruntfile.js 
*.mp4v  *bun.lockb 
*.vob  *.gitattributes 
*.qt  *gruntfile.ts 
*.nuv  *pom.xml 
*.wmv  *favicon.ico 
*.asf  *package-lock.json 
*.rm  *build 
*.rmvb  *package.json 
*.flc  *nuxt.config.ts 󱄆
*.avi  *nuxt.config.mjs 󱄆
*.fli  *mix.lock 
*.flv  *makefile 
*.gl  *gulpfile.js 
*.dl  *lxde-rc.xml 
*.xcf  *kritarc 
*.xwd  *gtkrc 
*.yuv  *ionic.config.json 
*.cgm  *.prettierrc.mjs 
*.emf  *.prettierrc.yml 
*.ogv  *.npmrc 
*.ogx  *weston.ini 
*.aac  *gulpfile.babel.js 
*.au  *i18n.config.ts 󰗊
*.flac  *commitlint.config.js 󰜘
*.m4a  *.gitmodules 
*.mid  *gradle-wrapper.properties 
*.midi  *hypridle.conf 
*.mka  *vercel.json ▲
*.mp3  *hyprlock.conf 
*.mpc  *go.sum 
*.ogg  *kdenlive-layoutsrc 
*.ra  *gruntfile.babel.js 
*.wav  *compose.yml 󰡨
*.oga  *i18n.config.js 󰗊
*.opus  *readme.md 󰂺
*.spx  *gradlew 
*.xspf  *go.work 
*.pdf  *gulpfile.ts 
*.nix  *gnumakefile 
*FreeCAD.conf 
*compose.yaml 󰡨
*eslint.config.js 
*hyprland.conf 
*docker-compose.yml 󰡨
*groovy 
*QtProject.conf 
*platformio.ini 
*build.gradle 
*.nuxtrc 󱄆
*_vimrc 
*.zprofile 
*.xsession 
*prettier.config.js 
*.babelrc 
*workspace 
*.prettierrc.json 
*.prettierrc.js 
*.Xresources 
*.gitignore 
*.justfile 
*.otf 
*.import 
*.krz 
*.adb 
*.ttf 
*.webpack 󰜫
*.dart 
*.vsh 
*.doc 󰈬
*.zsh 
*.ex 
*.hx 
*.fodt 
*.mojo 
*.templ 
*.nix 
*.cshtml 󱦗
*.fish 
*.ply 󰆧
*.sldprt 󰻫
*.gemspec 
*.mjs 
*.csh 
*.cmake 
*.fodp 
*.vi 
*.msf 
*.blp 󰺾
*.less 
*.sh 
*.odg 
*.mint 󰌪
*.dll 
*.odf 
*.sqlite3 
*.Dockerfile 󰡨
*.ksh 
*.rmd 
*.wv 
*.xml 󰗀
*.markdown 
*.qml 
*.3gp 
*.pxi 
*.flac 
*.gpr 
*.huff 󰡘
*.json 
*.gv 󱁉
*.bmp 
*.lock 
*.sha384 󰕥
*.cobol ⚙
*.cob ⚙
*.java 
*.cjs 
*.qm 
*.ebuild 
*.mustache 
*.terminal 
*.ejs 
*.brep 󰻫
*.rar 
*.gradle 
*.gnumakefile 
*.applescript 
*.elm 
*.ebook 
*.kra 
*.tf 
*.xls 󰈛
*.fnl 
*.kdbx 
*.kicad_pcb 
*.cfg 
*.ape 
*.org 
*.yml 
*.swift 
*.eln 
*.sol 
*.awk 
*.7z 
*.apl ⍝
*.epp 
*.app 
*.dot 󱁉
*.kpp 
*.eot 
*.hpp 
*.spec.tsx 
*.hurl 
*.cxxm 
*.c 
*.fcmacro 
*.sass 
*.yaml 
*.xz 
*.material 󰔉
*.json5 
*.signature λ
*.3mf 󰆧
*.jpg 
*.xpi 
*.fcmat 
*.pot 
*.bin 
*.xlsx 󰈛
*.aac 
*.kicad_sym 
*.xcstrings 
*.lff 
*.xcf 
*.azcli 
*.license 
*.jsonc 
*.xaml 󰙳
*.md5 󰕥
*.xm 
*.sln 
*.jl 
*.ml 
*.http 
*.x 
*.wvc 
*.wrz 󰆧
*.csproj 󰪮
*.wrl 󰆧
*.wma 
*.woff2 
*.woff 
*.tscn 
*.webmanifest 
*.webm 
*.fcbak 
*.log 󰌱
*.wav 
*.wasm 
*.styl 
*.gif 
*.resi 
*.aiff 
*.sha256 󰕥
*.igs 󰻫
*.vsix 
*.vim 
*.diff 
*.drl 
*.erl 
*.vhdl 󰍛
*.🔥 
*.hrl 
*.fsi 
*.mm 
*.bz 
*.vh 󰍛
*.kdb 
*.gz 
*.cpp 
*.ui 
*.txt 󰈙
*.spec.ts 
*.ccm 
*.typoscript 
*.typ 
*.txz 
*.test.ts 
*.tsx 
*.mk 
*.webp 
*.opus 
*.bicep 
*.ts 
*.tres 
*.torrent 
*.cxx 
*.iso 
*.ixx 
*.hxx 
*.gql 
*.tmux 
*.ini 
*.m3u8 󰲹
*.image 
*.tfvars 
*.tex 
*.cbl ⚙
*.flc 
*.elc 
*.test.tsx 
*.twig 
*.sql 
*.test.jsx 
*.htm 
*.gcode 󰐫
*.test.js 
*.ino 
*.tcl 󰛓
*.cljs 
*.tsconfig 
*.img 
*.t 
*.fcstd1 
*.out 
*.jsx 
*.bash 
*.edn 
*.rss 
*.flf 
*.cache 
*.sbt 
*.cppm 
*.svelte 
*.mo ∞
*.sv 󰍛
*.ko 
*.suo 
*.sldasm 󰻫
*.icalendar 
*.go 
*.sublime 
*.stl 󰆧
*.mobi 
*.graphql 
*.m3u 󰲹
*.cpy ⚙
*.kdenlive 
*.pyo 
*.po 
*.scala 
*.exs 
*.odp 
*.dump 
*.stp 󰻫
*.step 󰻫
*.ste 󰻫
*.aif 
*.strings 
*.cp 
*.fsscript 
*.mli 
*.bak 󰁯
*.ssa 󰨖
*.toml 
*.makefile 
*.php 
*.zst 
*.spec.jsx 
*.kbx 󰯄
*.fbx 󰆧
*.blend 󰂫
*.ifc 󰻫
*.spec.js 
*.so 
*.desktop 
*.sml λ
*.slvs 󰻫
*.pp 
*.ps1 󰨊
*.dropbox 
*.kicad_mod 
*.bat 
*.slim 
*.skp 󰻫
*.css 
*.xul 
*.ige 󰻫
*.glb 
*.ppt 󰈧
*.sha512 󰕥
*.ics 
*.mdx 
*.sha1 󰕥
*.f3d 󰻫
*.ass 󰨖
*.godot 
*.ifb 
*.cson 
*.lib 
*.luac 
*.heex 
*.scm 󰘧
*.psd1 󰨊
*.sc 
*.scad 
*.kts 
*.svh 󰍛
*.mts 
*.nfo 
*.pck 
*.rproj 󰗆
*.rlib 
*.cljd 
*.ods 
*.res 
*.apk 
*.haml 
*.d.ts 
*.razor 󱦘
*.rake 
*.patch 
*.cuh 
*.d 
*.query 
*.psb 
*.nu >
*.mov 
*.lrc 󰨖
*.pyx 
*.pyw 
*.cu 
*.bazel 
*.obj 󰆧
*.pyi 
*.pyd 
*.exe 
*.pyc 
*.fctb 
*.part 
*.blade.php 
*.git 
*.psd 
*.qss 
*.csv 
*.psm1 󰨊
*.dconf 
*.config.ru 
*.prisma 
*.conf 
*.clj 
*.o 
*.mp4 
*.cc 
*.kicad_prl 
*.bz3 
*.asc 󰦝
*.png 
*.android 
*.pm 
*.h 
*.pls 󰲹
*.ipynb 
*.pl 
*.ads 
*.sqlite 
*.pdf 
*.pcm 
*.ico 
*.a 
*.R 󰟔
*.ogg 
*.pxd 
*.kdenlivetitle 
*.jxl 
*.nswag 
*.nim 
*.bqn ⎉
*.cts 
*.fcparam 
*.rs 
*.mpp 
*.fdmdownload 
*.pptx 󰈧
*.jpeg 
*.bib 󱉟
*.vhd 󰍛
*.m 
*.js 
*.eex 
*.tbc 󰛓
*.astro 
*.sha224 󰕥
*.xcplayground 
*.el 
*.m4v 
*.m4a 
*.cs 󰌛
*.hs 
*.tgz 
*.fs 
*.luau 
*.dxf 󰻫
*.download 
*.cast 
*.qrc 
*.lua 
*.lhs 
*.md 
*.leex 
*.ai 
*.lck 
*.kt 
*.bicepparam 
*.hex 
*.zig 
*.bzl 
*.cljc 
*.kicad_dru 
*.fctl 
*.f# 
*.odt 
*.conda 
*.vala 
*.erb 
*.mp3 
*.bz2 
*.coffee 
*.cr 
*.f90 󱈚
*.jwmrc 
*.c++ 
*.fcscript 
*.fods 
*.cue 󰲹
*.srt 󰨖
*.info 
*.hh 
*.sig λ
*.html 
*.iges 󰻫
*.kicad_wks 
*.hbs 
*.fcstd 
*.gresource 
*.sub 󰨖
*.ical 
*.crdownload 
*.pub 󰷖
*.vue 
*.gd 
*.fsx 
*.mkv 
*.py 
*.kicad_sch 
*.epub 
*.env 
*.magnet 
*.elf 
*.fodg 
*.svg 󰜡
*.dwg 󰻫
*.docx 󰈬
*.pro 
*.db 
*.rb 
*.r 󰟔
*.scss 
*.cow 󰆚
*.gleam 
*.v 󰍛
*.kicad_pro 
*.liquid 
*.zip 

View File

@ -14,26 +14,31 @@ set autoquit true
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/*|application/json|inode/x-empty) $EDITOR $fx;; text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;;
text/*|application/x-subrip) $EDITOR $fx;;
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
image/svg+xml) display -- $f ;; image/svg+xml) display -- $f ;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jxl\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" | image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" |
setsid -f nsxiv -aio 2>/dev/null | while read -r file; do setsid -f nsxiv -aio 2>/dev/null | while read -r file; do
[ -z "$file" ] && continue [ -z "$file" ] && continue
lf -remote "send select \"$file\"" lf -remote "send select \"$file\""
lf -remote "send toggle" lf -remote "send toggle"
done & done &
;; ;;
audio/*) mpv --audio-display=no $f ;; audio/*|video/x-ms-asf) mpv --audio-display=no $f ;;
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
application/pdf|application/vnd*|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 ;;
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; 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;;
esac esac
}} }}
cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')" cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
cmd extract ${{ cmd extract ${{