# Midnight Commander file associations (public baseline). # # mc reads a SINGLE mc.ext.ini; this user copy fully replaces the system one # (they are not merged), so it must also carry the archive entries we keep. # # Policy: Enter (Open) on an archive mounts it as a virtual filesystem (mc # built-in, no external helper). Every other file falls through to [Default], # which runs `xdg-open` -- so the app is whatever the XDG mimeapps default # resolves to (set those in the private inventory's xdg.mimeApps). One source of # truth, shared with every other launcher; nothing app-specific baked in here. # # Note: office documents (.docx/.odt/.xlsx/...) are ZIP containers, so they are # deliberately absent from the [zip] entry below -- otherwise Enter would mount # them as archives instead of handing them to LibreOffice via xdg-open. # # Override contract (this is a types.lines option shipped as mkBefore): append a # same-named section to override one key -- mc merges same-named sections and # the last key wins -- e.g. add a [Default] with a different Open to change the # fallback, or add [pdf] Type=^PDF / Open=mupdf %f & to force one type to a # specific app. lib.mkForce "..." replaces this baseline wholesale. [mc.ext.ini] Version=4.0 ### Archives: Enter mounts them as a virtual filesystem (F3/F4 unaffected) ### [tar] Regex=\\.(tar(\\.(gz|bz2|xz|zst|lz|lz4|lzo|Z))?|t(gz|az|bz2?|xz|zst|lz))$ Open=%cd %p/utar:// [zip] Regex=\\.(zip|jar|xpi|whl|egg|apk|war|ear)$ Open=%cd %p/uzip:// [7z] Shell=.7z Open=%cd %p/u7z:// [rar] Regex=\\.r(ar|[0-9][0-9])$ Open=%cd %p/urar:// [arj] Regex=\\.a(rj|[0-9][0-9])$ Open=%cd %p/uarj:// [cab] Shell=.cab Open=%cd %p/ucab:// [cpio] Regex=\\.cpio(\\.(gz|xz|bz2|zst|lz|lz4|lzo|Z))?$ Open=%cd %p/ucpio:// [deb] Regex=\\.u?deb$ Open=%cd %p/deb:// [rpm] Regex=\\.(rpm|src\\.rpm|spm)$ Open=%cd %p/rpm:// [iso] Shell=.iso Open=%cd %p/iso9660:// [patch] Regex=\\.(diff|patch)(\\.(gz|bz2|xz|zst|Z))?$ Open=%cd %p/patchfs:// ### Everything else: hand off to the desktop's configured default app ### # `&` backgrounds xdg-open so mc's shell returns and the launched GUI is orphaned # to init. Hyprland only swallows the terminal when the new window's parent-PID # chain still has a foot ancestor (getSwallower in Hyprland's Window.cpp), so an # orphaned app opens as its own tile instead of swallowing mc (zathura, imv, ...). # %f MUST stay unquoted: mc already backslash-escapes the path, so quoting turns # those backslashes literal and breaks filenames with spaces. # Redirect stdout/stderr to /dev/null: `&` backgrounds but leaves the app's fds on # mc's terminal, so a chatty app paints over the mc pane and looks like a broken # swallow. Tradeoff: this also discards any real diagnostics when an app fails to # open a file. To keep a breadcrumb, swap /dev/null for a log file, e.g. # `>>$XDG_STATE_HOME/mc-open.log 2>&1`. [Default] Open=xdg-open %f >/dev/null 2>&1 &