diff --git a/home/programs/terminal/file-managers/default.nix b/home/programs/terminal/file-managers/default.nix index 342ecf0..da5226a 100644 --- a/home/programs/terminal/file-managers/default.nix +++ b/home/programs/terminal/file-managers/default.nix @@ -6,7 +6,6 @@ _: { imports = [ ./yazi ./xplr - ./vifm ./ranger.nix ]; } diff --git a/home/programs/terminal/file-managers/ranger.nix b/home/programs/terminal/file-managers/ranger.nix index 59a2a73..5013ee7 100644 --- a/home/programs/terminal/file-managers/ranger.nix +++ b/home/programs/terminal/file-managers/ranger.nix @@ -1,25 +1,19 @@ { pkgs, lib, - osConfig, config, ... }: let - device = osConfig.modules.device; - # TODO: maybe not have a TUI file manager on desktops, when GUI does it better - acceptedTypes = ["laptop" "desktop" "hybrid" "server" "lite"]; inherit (lib.strings) optionalString; in { - config = lib.mkIf (builtins.elem device.type acceptedTypes) { - home.packages = with pkgs; [ - ranger - ]; + home.packages = with pkgs; [ + ranger + ]; - # TODO: more file preview methods - xdg.configFile."ranger/rc.conf".text = '' - set preview_images true - ${(optionalString config.programs.kitty.enable "set preview_images_method kitty")} - ''; - }; + # TODO: more file preview methods + xdg.configFile."ranger/rc.conf".text = '' + set preview_images true + ${(optionalString config.programs.kitty.enable "set preview_images_method kitty")} + ''; } diff --git a/home/programs/terminal/file-managers/vifm/config/colors/.gitkeep b/home/programs/terminal/file-managers/vifm/config/colors/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/home/programs/terminal/file-managers/vifm/config/colors/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/home/programs/terminal/file-managers/vifm/config/settings/abbr.vifm b/home/programs/terminal/file-managers/vifm/config/settings/abbr.vifm deleted file mode 100644 index 3949c55..0000000 --- a/home/programs/terminal/file-managers/vifm/config/settings/abbr.vifm +++ /dev/null @@ -1,4 +0,0 @@ -" vim:ft=vim -cabbrev t touch -cabbrev mk mkdir - diff --git a/home/programs/terminal/file-managers/vifm/config/settings/commands.vifm b/home/programs/terminal/file-managers/vifm/config/settings/commands.vifm deleted file mode 100644 index 1704428..0000000 --- a/home/programs/terminal/file-managers/vifm/config/settings/commands.vifm +++ /dev/null @@ -1,26 +0,0 @@ -" vim:ft=vim -" :com[mand][!] command_name action -" The following macros can be used in a command -" %a is replaced with the user arguments. -" %c the current file under the cursor. -" %C the current file under the cursor in the other directory. -" %f the current selected file, or files. -" %F the current selected file, or files in the other directory. -" %b same as %f %F. -" %d the current directory name. -" %D the other window directory name. -" %m run the command in a menu window -" more information: https://vifm.info/vimdoc.shtml#vifm-macros - -command! df df -h %m 2> /dev/null -command! diff nvim -d %f %F -command! run !! ./%f -command! make !!make %a -command! mkcd :mkdir %a | cd %a -command! vgrep vim "+grep %a" -command! reload :write | restart -command! dragon dragon-drop -a -x %f -command! clear vifmimg clear -command! print lp -n 1 -o sides=two-sided-long-edge %f -command! sudoedit sudoedit %c - diff --git a/home/programs/terminal/file-managers/vifm/config/settings/favicons.vifm b/home/programs/terminal/file-managers/vifm/config/settings/favicons.vifm deleted file mode 100644 index 76b4d3b..0000000 --- a/home/programs/terminal/file-managers/vifm/config/settings/favicons.vifm +++ /dev/null @@ -1,70 +0,0 @@ -" vim:ft=vim - -" Filetypes/directories -set classify=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../::' - -" Specific files -set classify+=' ::.Xdefaults,,.Xresources,,.bashprofile,,.bash_profile,,.bashrc,,.dmrc,,.d_store,,.fasd,,.gitconfig,,.gitignore,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.xinitpurc,,.zprofile,,.yarnc,,.snclirc,,.tmux.conf,,.urlview,,.config,,.ini,,.user-dirs.dirs,,.mimeapps.list,,.offlineimaprc,,.msmtprc,,.Xauthority,,config::' -set classify+=' ::dropbox::' -set classify+=' ::favicon.*,,README,,readme::' -set classify+=' ::.vim,,.vimrc,,.gvimrc,,.vifm::' -set classify+=' ::gruntfile.coffee,,gruntfile.js,,gruntfile.ls::' -set classify+=' ::gulpfile.coffee,,gulpfile.js,,gulpfile.ls::' -set classify+=' ::ledger::' -set classify+=' ::license,,copyright,,copying,,LICENSE,,COPYRIGHT,,COPYING::' -set classify+=' ::node_modules::' -set classify+=' ::react.jsx::' - -" File extensions -set classify+='λ ::*.ml,,*.mli::' -set classify+=' ::*.styl::' -set classify+=' ::*.scss::' -set classify+=' ::*.py,,*.pyc,,*.pyd,,*.pyo::' -set classify+=' ::*.php::' -set classify+=' ::*.markdown,,*.md::' -set classify+=' ::*.json::' -set classify+=' ::*.js::' -set classify+=' ::*.bmp,,*.gif,,*.ico,,*.jpeg,,*.jpg,,*.png,,*.svg,,*.svgz,,*.tga,,*.tiff,,*.xmb,,*.xcf,,*.xpm,,*.xspf,,*.xwd,,*.cr2,,*.dng,,*.3fr,,*.ari,,*.arw,,*.bay,,*.crw,,*.cr3,,*.cap,,*.data,,*.dcs,,*.dcr,,*drf,,*.eip,,*.erf,,*.fff,,*.gpr,,*.iiq,,*.k25,,*.kdc,,*.mdc,,.*mef,,*.mos,,.*.mrw,,.*.obm,,*.orf,,*.pef,,*.ptx,,*.pxn,,*.r3d,,*.raf,,*.raw,,*.rwl,,*.rw2,,*.rwz,,*.sr2,,*.srf,,*.srf,,*.srw,,*.tif,,*.x3f::' -set classify+=' ::*.ejs,,*.htm,,*.html,,*.slim,,*.xml::' -set classify+=' ::*.mustasche::' -set classify+=' ::*.css,,*.less,,*.bat,,*.conf,,*.ini,,*.rc,,*.yml,,*.cfg,,*.rc::' -set classify+=' ::*.rss::' -set classify+=' ::*.coffee::' -set classify+=' ::*.twig::' -set classify+=' ::*.c++,,*.cc,,*.cpp,,*.cxx,,*.h::' -set classify+=' ::*.c::' -set classify+=' ::*.hs,,*.lhs::' -set classify+=' ::*.lua::' -set classify+=' ::*.jl::' -set classify+=' ::*.go::' -set classify+=' ::*.ts::' -set classify+=' ::*.db,,*.dump,,*.sql::' -set classify+=' ::*.sln,,*.suo::' -set classify+=' ::*.exe::' -set classify+=' ::*.diff,,*.sum,,*.md5,,*.sha512::' -set classify+=' ::*.scala::' -set classify+=' ::*.java,,*.jar::' -set classify+=' ::*.xul::' -set classify+=' ::*.clj,,*.cljc::' -set classify+=' ::*.pl,,*.pm,,*.t::' -set classify+=' ::*.cljs,,*.edn::' -set classify+=' ::*.rb::' -set classify+=' ::*.fish,,*.sh,,*.bash::' -set classify+=' ::*.dart::' -set classify+=' ::*.f#,,*.fs,,*.fsi,,*.fsscript,,*.fsx::' -set classify+=' ::*.rlib,,*.rs::' -set classify+=' ::*.d::' -set classify+=' ::*.erl,,*.hrl::' -set classify+=' ::*.ai::' -set classify+=' ::*.psb,,*.psd::' -set classify+=' ::*.jsx::' -set classify+=' ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::' -set classify+=' ::*.avi,,*.flv,,*.mkv,,*.mov,,*.mov,,*.mp4,,*.mpeg,,*.mpg,,*.webm::' -set classify+=' ::*.epub,,*.pdf,,*.fb2,,*.djvu::' -set classify+=' ::*.7z,,*.apk,,*.bz2,,*.cab,,*.cpio,,*.deb,,*.gem,,*.gz,,*.gzip,,*.lh,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.tar,,*.tgz,,*.xz,,*.zip::' -set classify+=' ::*.cbr,,*.cbz::' -set classify+=' ::*.log::' -set classify+=' ::*.doc,,*.docx,,*.adoc::' -set classify+=' ::*.xls,,*.xls,,*.xlsmx::' -set classify+=' ::*.pptx,,*.ppt::' - diff --git a/home/programs/terminal/file-managers/vifm/config/settings/ft.vifm b/home/programs/terminal/file-managers/vifm/config/settings/ft.vifm deleted file mode 100644 index 3d2a2d1..0000000 --- a/home/programs/terminal/file-managers/vifm/config/settings/ft.vifm +++ /dev/null @@ -1,136 +0,0 @@ -" vim:ft=vim -" filextype: What should it do (which program should it use), when you want to open it -" fileviewer: What should it do for the prievew? - -filextype *.pdf zathura %c & - -filextype *.ps,*.eps,*.ps.gz - \ {View in sioyek} - \ sioyek %f & - -filextype *.xml,*.ipe ipe %c & - -filextype *.djvu - \ {View in sioyek} - \ sioyek %f & , - \ {View in apvlv} - \ apvlv %f, - -filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus,*.MOD - \ {Play using ffplay} - \ ffplay -nodisp -autoexit %c &, - \ {Play using MPlayer} - \ mplayer %f &, -fileviewer *.mp3 mp3info -fileviewer *.flac soxi - -filextype *.avi,*.mp4,*.wmv,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, - \*.fl[icv],*.m2v,*.mov,*.webm,*.mts,*.m4v,*.r[am],*.qt,*.divx, - \*.as[fx] - \ {View using ffplay} - \ ffplay -fs -autoexit -volume 100 %f &, - -filextype *.html,*.htm - \ firefox %f &, -filetype *.html,*.htm links, lynx -fileviewer *.html - \ w3m %c - -filetype *.o,*.out objdump -d %f | less -fileviewer *.o,*.out objdump -d %f - -filetype *.[1-8] man ./%c -fileviewer *.[1-8] man ./%c | col -b - -filextype *.bmp,*.jpg,*.jpeg,*.png,*.xpm,*.svg,*.ico,*.gif - "\ viewnior %c & - " \ vimiv --log-level info --debug vimico %c & - \ vimiv %c & - -filextype *.ora - \ {Edit in MyPaint} - \ mypaint %f, - -filextype *.vym - \ {Open with VYM} - \ vym %f &, - -filetype *.md5 - \ {Check MD5 hash sum} - \ md5sum -c %f %S, - -filetype *.sha1 - \ {Check SHA1 hash sum} - \ sha1sum -c %f %S, - -filetype *.sha256 - \ {Check SHA256 hash sum} - \ sha256sum -c %f %S, - -filetype *.sha512 - \ {Check SHA512 hash sum} - \ sha512sum -c %f %S, - -filetype *.asc - \ {Check signature} - \ !!gpg --verify %c, - -filetype *.torrent ktorrent %f & -fileviewer *.torrent dumptorrent -v %c - -filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg - \ {Mount with fuse-zip} - \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR, - \ {View contents} - \ zip -sf %c | less, - \ {Extract here} - \ tar -xf %c -filetype *.zip unzip %f -filetype *.tar.gz tar -xvf %f -fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c - -filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz - \ {Mount with archivemount} - \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR, -fileviewer *.tgz,*.tar.gz tar -tzf %c -fileviewer *.tar.bz2,*.tbz2 tar -tjf %c -fileviewer *.tar.txz,*.txz xz --list %c -fileviewer *.tar tar -tf %c - -filetype *.rar - \ {Mount with rar2fs} - \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR, -fileviewer *.rar unrar v %c - -filetype *.iso - \ {Mount with fuseiso} - \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR, - -filetype *.ssh - \ {Mount with sshfs} - \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND, - -filetype *.ftp - \ {Mount with curlftpfs} - \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND, - -filetype *.7z - \ {Mount with fuse-7z} - \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR, -fileviewer *.7z 7z l %c - -filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f & -fileviewer *.odt odt2txt %f -fileviewer *.docx docx2txt %f - - -filetype *.tudu tudu -f %c - -filextype *.pro qtcreator %f & - -filextype */ - \ pacmanfm %f &, - -fileviewer *.md glow %c - -filetype *.xopp xournalpp %f & - diff --git a/home/programs/terminal/file-managers/vifm/config/settings/fv.vifm b/home/programs/terminal/file-managers/vifm/config/settings/fv.vifm deleted file mode 100644 index 969a9ea..0000000 --- a/home/programs/terminal/file-managers/vifm/config/settings/fv.vifm +++ /dev/null @@ -1,3 +0,0 @@ -" vim:ft=vim - -fileviewer *.* bat --color=always --decorations=never %c diff --git a/home/programs/terminal/file-managers/vifm/config/settings/mappings.vifm b/home/programs/terminal/file-managers/vifm/config/settings/mappings.vifm deleted file mode 100644 index 42c1ae9..0000000 --- a/home/programs/terminal/file-managers/vifm/config/settings/mappings.vifm +++ /dev/null @@ -1,38 +0,0 @@ -" vim:ft=vim - -" Editing / Do something with the files -nnoremap cd :cd -nnoremap cD :diff -vnoremap cD :diff - -" start shell -nmap S :shell - -" Display sorting dialog -nnoremap s :sort - -" preview window -" Toggle visibility of preview window -nnoremap w :view -vnoremap w :viewgv - -" panel resize -nnoremap < 5< -nnoremap > 5> - -" tabs -nnoremap :tabnew - -" drag and drop -nmap :dragon -vmap :dragon - -" Yank current directory path into the clipboard -nnoremap yd :!echo -n %d | wl-copy %i:echo expand('%"d') "is yanked to clipboard" -" Yank current file path into the clipboard -nnoremap yf :!echo -n %c:p | wl-copy %i:echo expand('%"c:p') "is yanked to clipboard" - -nnoremap q :q - -"nnoremap ö q - diff --git a/home/programs/terminal/file-managers/vifm/config/vifmrc b/home/programs/terminal/file-managers/vifm/config/vifmrc deleted file mode 100644 index c190ae5..0000000 --- a/home/programs/terminal/file-managers/vifm/config/vifmrc +++ /dev/null @@ -1,114 +0,0 @@ -" vim:ft=vim - -" editor -set vicmd="nvim" - -" This makes vifm perform file operations on its own instead of relying on -" standard utilities like `cp`. While using `cp` and alike is a more universal -" solution, it's also much slower when processing large amounts of files and -" doesn't support progress measuring. -set syscalls - -" miller view -set millerview -set milleroptions="lsize:1,csize:2,rsize:0,rpreview:all" - -set sizefmt=units:si,precision:2,space - -" The display on the bottom left -set rulerformat="%2l/%2S %[MAX: %2L%]" - -set findprg="fd %A" -set grepprg="rg -n -H %i %a %s" - -" set fillchars=vborder:│ - -" execute files -set runexec - -set tuioptions="pu" - -" controls details of file operations -set iooptions=fastfilecloning - -" Trash Directory -" The default is to move files that are deleted with dd or :d to -" the trash directory. If you change this you will not be able to move -" files by deleting them and then using p to put the file in the new location. -" I recommend not changing this until you are familiar with vifm. -" This probably shouldn't be an option. -set trash -set trashdir="~/.local/share/Trash/files" - -" This is how many directories to store in the directory history. -set history=100 - -" number of spaces of a tab" -set tabstop=4 - -" With this option turned on you can run partially entered commands with -" unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te). -set fastrun - -" Natural sort of (version) numbers within text. -set sortnumbers - -" Maximum number of changes that can be undone. -set undolevels=100 - -" If you installed the vim.txt help file set vimhelp. -" If would rather use a plain text help file set novimhelp. -set vimhelp - -" If you would like to run an executable file when you -" press return on the file name set this. -set norunexec - -set rnu -set dotdirs= - -" colorscheme custom - -" Format for displaying time in file list. For example: -" TIME_STAMP_FORMAT=%m/%d-%H:%M -" See man date or man strftime for details. -set timefmt=%d.%m.%Y\ \ %H:%M - -" Show list of matches on tab completion in command-line mode -set wildmenu -" Display completions in a form of popup with descriptions of the matches -set wildstyle=popup - -" Display suggestions in normal, visual and view modes for keys, marks and -" registers (at most 5 files). In other view, when available. -set suggestoptions=normal,visual,view,otherpane,keys,marks,registers,delay:0 - -" Ignore case in search patterns unless it contains at least one uppercase -" letter -set ignorecase -set smartcase - -" Don't highlight search results automatically -set nohlsearch - -" Use increment searching (search while typing) -set incsearch - -" Try to leave some space from cursor to upper/lower border in lists -set scrolloff=4 - -" Don't do too many requests to slow file systems -if !has('win') - set slowfs=curlftpfs -endif - -set statusline=" %A %10u:%-7g %20d Free Space: %a" - -set vifminfo=dhistory,chistory,state,tui,shistory, - \phistory,fhistory,dirstack,registers,bookmarks,bmarks - -" ------------ -" panels -" ------------ -set viewcolumns=-{name},{size} - diff --git a/home/programs/terminal/file-managers/vifm/default.nix b/home/programs/terminal/file-managers/vifm/default.nix deleted file mode 100644 index 24e2468..0000000 --- a/home/programs/terminal/file-managers/vifm/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - self, - pkgs, - ... -}: { - imports = [self.homeManagerModules.vifm]; - config = { - programs.vifm = { - enable = true; - package = pkgs.vifm-full; - config = builtins.readFile "${./config/vifmrc}"; - extraConfigFiles = [ - "${./config/settings/abbr.vifm}" - "${./config/settings/commands.vifm}" - "${./config/settings/favicons.vifm}" - "${./config/settings/ft.vifm}" - "${./config/settings/fv.vifm}" - "${./config/settings/mappings.vifm}" - ]; - }; - }; -} - diff --git a/home/programs/terminal/file-managers/xplr/default.nix b/home/programs/terminal/file-managers/xplr/default.nix index 0b8a69d..271714f 100644 --- a/home/programs/terminal/file-managers/xplr/default.nix +++ b/home/programs/terminal/file-managers/xplr/default.nix @@ -1,58 +1,52 @@ { pkgs, lib, - osConfig, ... -}: let - device = osConfig.modules.device; - acceptedTypes = ["laptop" "desktop" "hybrid" "server" "lite"]; -in { - config = lib.mkIf (builtins.elem device.type acceptedTypes) { - home.packages = with pkgs; [ - xplr - ]; +}: { + home.packages = with pkgs; [ + xplr + ]; - xdg.configFile."xplr/init.lua".text = let - # get plugin derivations from plugins.nix so that this file remains clean - inherit (import ./plugins.nix pkgs) wl-clipboard-plugin nuke-plugin; - in '' - version = '${pkgs.xplr.version}' + xdg.configFile."xplr/init.lua".text = let + # get plugin derivations from plugins.nix so that this file remains clean + inherit (import ./plugins.nix pkgs) wl-clipboard-plugin nuke-plugin; + in '' + version = '${pkgs.xplr.version}' - package.path = - "${wl-clipboard-plugin}/init.lua;" .. - "${nuke-plugin}/init.lua;" .. - package.path + package.path = + "${wl-clipboard-plugin}/init.lua;" .. + "${nuke-plugin}/init.lua;" .. + package.path - require("wl-clipboard").setup{ - copy_command = "wl-copy -t text/uri-list", - paste_command = "wl-paste", - keep_selection = true, - } + require("wl-clipboard").setup{ + copy_command = "wl-copy -t text/uri-list", + paste_command = "wl-paste", + keep_selection = true, + } - require("nuke").setup{ - pager = "less -R", - open = { - run_executables = true, -- default: false - custom = { - {extension = "jpg", command = "imv {}"}, - {extension = "pdf", command = "zathura {}"}, - {mime_regex = "^video/.*", command = "mpv {}"}, - {mime_regex = ".*", command = "xdg-open {}"} - } - }, - - view = { - show_line_numbers = true, -- default: false - }, - - smart_view = { - custom = { - {extension = "so", command = "ldd -r {} | less"}, - }, + require("nuke").setup{ + pager = "less -R", + open = { + run_executables = true, -- default: false + custom = { + {extension = "jpg", command = "imv {}"}, + {extension = "pdf", command = "zathura {}"}, + {mime_regex = "^video/.*", command = "mpv {}"}, + {mime_regex = ".*", command = "xdg-open {}"} } + }, + + view = { + show_line_numbers = true, -- default: false + }, + + smart_view = { + custom = { + {extension = "so", command = "ldd -r {} | less"}, + }, } - ''; - }; + } + ''; }