#!/bin/bash # omarchy:summary=zathura document viewer keyboard cheat sheet (fuzzy-search popup). # # omarchy-menu-zathura — a searchable popup, the same Quickshell widget used by # SUPER+K (keybindings), SUPER+ALT+K (tmux), SUPER+CTRL+ALT+K (R65) and the # other cheat sheets, listing every default zathura key binding plus the # commands and the wrappers on this box. It is a pure reference: rows are # inert, but Enter copies the highlighted key to the clipboard (wl-copy) so you # can paste it into notes. Section headers and notes are inert. # # Bound to SUPER + ALT + Z. # # omarchy-menu-zathura open the popup # omarchy-menu-zathura --print dump rows to stdout (no GUI) # # Source: zathura(1) and zathurarc(5) for the installed build, zathura # 2026.07.18 (poppler / djvu / ps plugins), plus this machine's # ~/.config/zathura/zathurarc and the zimg / zbook wrappers in ~/.local/bin. # That zathurarc sets no map lines of its own, so every key below is a stock default. set -uo pipefail # --- records: "DISPLAYKEY" -------------------------------------------- # DISPLAY (field 1) is " → ", shown in the menu. # KEY (field 2) is the bare key combo, copied to the clipboard on select. # Header and note rows carry an empty KEY field, so selecting one is a no-op. emit() { printf '%-30s → %s\t%s\n' "$1" "$2" "$1"; } head() { printf '%s\t\n' "$1"; } note() { printf ' %s\t\n' "$1"; } records() { head "── Start here ──" note "Every key below is a zathura DEFAULT: your zathurarc sets no map lines of its own" note "zathura is the default PDF app here, so anything you open lands in it" note "A capital letter means Shift + that key, so G is Shift+g" emit "q" "quit — the position is remembered for next time" emit ":" "start a command; Tab completes, Esc cancels" emit "Tab" "table of contents; Tab again to leave it" emit "Esc / Ctrl+c" "abort whatever is half-typed or in flight" note "Your zathurarc hides the statusbar and scrollbars (guioptions \"\"):" note "Ctrl+n brings the statusbar back for as long as you need it" head "── Turning pages ──" emit "J / K" "next / previous page" emit "PgDn / PgUp" "next / previous page" emit "gg" "first page" emit "G" "last page" emit "5G" "jump to page 5 — any number then G" emit "P" "snap the view to the top of the current page" emit "H / L" "top / bottom of the current page" note "Pages scroll continuously, so J/K land on a page rather than stepping" note "a fixed distance; P straightens the view after free scrolling" head "── Scrolling inside a page ──" emit "h / j / k / l" "scroll left / down / up / right" emit "Left / Down / Up / Right" "scroll left / down / up / right" emit "Ctrl+d / Ctrl+u" "scroll half a screen down / up" emit "Ctrl+t / Ctrl+y" "scroll half a screen left / right" emit "Ctrl+f / Ctrl+b" "scroll a full screen down / up" emit "Space / Shift+Space" "scroll a full screen down / up" emit "t / y" "scroll a full screen left / right" note "One h/j/k/l tick moves 80px here (scroll-step 80 in your zathurarc)" head "── Zoom and fit ──" emit "a" "fit the whole page in the window (best-fit)" emit "s" "fit the page width — the reading default" emit "+ / -" "zoom in / out" emit "=" "back to 100%" emit "zI / zO" "zoom in / out" emit "z0" "back to 100%" emit "150=" "zoom to exactly 150% — any number then =" emit "Ctrl+Scroll" "zoom with the wheel" note "Documents open in best-fit here (adjust-open best-fit), which is what" note "makes zbook's one-panel-per-page comics fill the window" head "── Page layout ──" emit "d" "two pages side by side / back to one" emit "D" "in dual view, shift which page starts a row" emit "w" "single-page mode: show one page, no neighbours" emit "r" "rotate 90 degrees clockwise" emit "R" "reload the file from disk" emit "Ctrl+r" "recolor: invert to a dark page, and back" note "Recolor is OFF in your zathurarc so scans and comics keep true colour;" note "Ctrl+r is the per-document escape hatch for a blinding white paper" head "── Searching ──" emit "/" "search forward — type, then Enter" emit "?" "search backward" emit "n / N" "next / previous match" emit ":nohl" "clear the highlight without losing the search" emit ":hlsearch" "highlight the current matches again" note "Matches highlight gold, the one you are on lilac (set in your zathurarc)" note "Aborting a search clears it (abort-clear-search is on by default)" head "── Marks, jumps and bookmarks ──" note "Quickmarks live for this session; bookmarks are saved in the database" emit "ma" "set quickmark a here — m then any letter or digit" emit "'a" "jump back to quickmark a" emit "Ctrl+o / Ctrl+i" "back / forward through the jump list" emit "Ctrl+j / Ctrl+k" "bisect forward / back between the last two jumps" emit ":jumplist" "list the recent jumps (add a number for more)" emit ":mark a" "set quickmark a from the command line" emit ":delmarks a" "delete quickmark a (short: :delm)" emit ":bmark chapter3" "save a named bookmark at this page" emit ":blist" "list this document's bookmarks" emit ":bjump chapter3" "jump to a named bookmark — Tab completes" emit ":bdelete chapter3" "delete a named bookmark" note "zathura reopens a file where you left it (open-first-page is off), so" note "bookmarks are for places you want to come back to on purpose" head "── Links ──" emit "f" "label every link, then type its number to follow" emit "F" "label every link and show where it points" emit "c" "label every link and copy its target to the clipboard" emit "Click" "follow a link directly" note "f is how you use a PDF's table of contents without touching the mouse" head "── Text, images and printing ──" emit "Drag Left button" "select text — it goes straight to the clipboard" emit "Shift + drag Left" "select a rectangular region instead of lines" emit "Right click on an image" "menu to copy or save that image" emit ":print" "open the print dialog" emit ":write out.pdf" "save a copy of the document (alias: :save)" emit ":write! out.pdf" "save a copy, overwriting an existing file" emit ":export" "pull an embedded attachment out — Tab lists them" note "selection-clipboard is set to clipboard in your zathurarc, so a drag" note "is pasteable with Ctrl+V anywhere — no middle-click needed" head "── Fullscreen, presentation and index ──" emit "F11" "fullscreen on / off" emit "F5" "presentation mode on / off — one page, no chrome" emit "Tab" "index mode: the document's table of contents" emit "Ctrl+n" "show / hide the statusbar" emit "Ctrl+m" "show / hide the input bar" note "In fullscreen: J/K page, Space/Shift+Space screen, gg/G/nG jump, +/-/= zoom" note "In presentation: only Space and Shift+Space page; F5 or q leaves" head "── Index mode (press Tab to enter) ──" emit "j / k" "move down / up the list" emit "Down / Up" "move down / up the list" emit "Ctrl+d / Ctrl+u" "move half a screen down / up" emit "l / Right / zo" "open this section" emit "h / Left / zc" "close this section" emit "zO / zC" "open / close this section and everything under it" emit "L / zR" "open every section" emit "H / zM" "close every section" emit "gg / G" "first / last entry" emit "Enter / Space" "go to that section" emit "Tab / Esc" "leave the index without moving" note "A file with no table of contents just shows nothing here" head "── Commands (press : first) ──" emit ":open ~/doc.pdf" "open another file in this window (short: :o)" emit ":close" "close the document, keep zathura open" emit ":quit" "quit (short: :q)" emit ":info" "title, author, page count, producer" emit ":offset 2" "the cover is page 0: renumber so labels match" emit ":exec mpv \$FILE" "run a shell command (alias: ! — the space matters)" emit ":source" "re-read zathurarc without restarting" emit ":dump settings.txt" "write every current setting to a file" emit ":version" "which zathura and which plugins are loaded" note "In :exec, \$FILE is this document's path and \$PAGE the page you are on" note "Offset is for scanned books whose printed page 1 is the PDF's page 3" head "── Settings you can flip while reading ──" note ":set NAME VALUE changes it now; the same line in zathurarc makes it stick" emit ":set recolor true" "dark mode for this session" emit ":set pages-per-row 2" "two-up, like d but you pick the number" emit ":set page-right-to-left true" "right-to-left column order, for manga" emit ":set scroll-step 200" "how far one j or k moves" emit ":set zoom-step 5" "how much one + or - changes" emit ":set incremental-search false" "stop jumping around as you type a search" emit ":set statusbar-page-percent true" "show how far through you are" emit ":set guioptions v" "bring the scrollbar back (yours is off)" emit ":set adjust-open width" "open at page width instead of whole page" note "Names complete with Tab. Full list: man 5 zathurarc" head "── Mouse ──" emit "Scroll" "scroll the document" emit "Ctrl+Scroll" "zoom in / out" emit "Middle-button drag" "grab the page and pan it" emit "Left click" "follow a link" emit "Left drag" "select text" emit "Shift + left drag" "select a rectangular region" emit "Right click" "on an image: menu to copy or save it" head "── From the terminal ──" note "Launching from a terminal hides that terminal until zathura closes" note "(window swallowing is on in your looknfeel.lua)" emit "zathura FILE" "open a PDF, PS or DjVu" emit "zathura -P 42 FILE" "open at page 42 (-1 is the last page)" emit "zathura -f WORD FILE" "open and jump to the first match for WORD" emit "zathura -w PASS FILE" "open an encrypted PDF without the prompt" emit "zathura --fork FILE" "detach, giving the shell straight back" emit "zathura -c DIR FILE" "use a different config directory" emit "zathura --mode fullscreen" "start fullscreen (or presentation)" emit "zathura-sandbox FILE" "read an untrusted file under seccomp/landlock" emit "zathura --version" "version and which plugins are installed" note "zathura-sandbox gives up saving, printing, bookmarks and D-Bus in trade" head "── Formats: what opens what on this box ──" note "This build loads three plugins: poppler (PDF), djvu and ps — no EPUB," note "no comics. The two wrappers below fill the gaps; both live in ~/.local/bin" emit "zathura FILE" "PDF, PS, EPS, DjVu — straight in" emit "zimg" "every image in this directory, as one document" emit "zimg IMG IMG" "just those images, in natural number order" emit "zimg -r DIR" "a directory tree of images" emit "zbook book.epub" "EPUB, FB2, XPS, MOBI — side-loads MuPDF" emit "zbook book.azw3" "anything else: calibre converts it first" emit "zbook comic.cbz" "a comic, ONE PANEL PER PAGE — Space walks panels" emit "zbook --pages comic.cbz" "the comic as whole pages instead" emit "zbook --rtl manga.cbz" "right-to-left panel order" emit "zbook --overview c.cbz" "the full page first, then its panels" emit "zbook --setup" "install or refresh the MuPDF plugin" emit "zbook --clean" "empty the conversion cache" note "zbook never changes the PDF backend: MuPDF is side-loaded only for the" note "book it was asked to open, so your PDFs still render through poppler" note "Config: ~/.config/zathura/zathurarc · man 5 zathurarc for every option" } case "${1:-}" in --print | -p) records | cut -f1 exit 0 ;; -h | --help) printf 'usage: omarchy-menu-zathura [--print]\n' exit 0 ;; "") ;; *) printf 'omarchy-menu-zathura: unknown option: %s\n' "$1" >&2; exit 2 ;; esac data=$(records) # Height: ~70% of the focused monitor, clamped; fall back to 1080 if unknown. mon_h=$(hyprctl monitors -j 2>/dev/null | jq -r '.[] | select(.focused==true) | .height' 2>/dev/null) [[ $mon_h =~ ^[0-9]+$ ]] && (( mon_h > 0 )) || mon_h=1080 menu_h=$(( mon_h * 70 / 100 )) (( menu_h < 440 )) && menu_h=440 selection=$(cut -f1 <<<"$data" | omarchy-menu-select 'zathura cheat sheet' -- --width 1080 --height "$menu_h") || exit 0 [[ -n $selection ]] || exit 0 # Pass the selection through ENVIRON, not -v, so awk does not mangle backslash # escapes in keys. key=$(SEL="$selection" awk -F '\t' '$1==ENVIRON["SEL"] { print $2; exit }' <<<"$data") key="${key%"${key##*[![:space:]]}"}" # trim trailing whitespace if [[ -n $key ]]; then printf '%s' "$key" | wl-copy notify-send -a 'zathura cheat sheet' 'Key copied' "$key" 2>/dev/null || true printf '%s\n' "$key" fi