From 4124a5ae231a585b945c9547a3ab0c37a4eba7e3 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sat, 18 Jul 2026 12:15:20 +0530 Subject: refactor: replace zsh deps with runtimeShell, migrate scripts from symlinkJoin to runCommand, add missing assertions and deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scripts: Migrated from symlinkJoin to runCommand; replaced zsh dependency with pkgs.runtimeShell across polybar, scripts, and fzf-launcher Assertions: Added gopass/gpg checks for neomutt, signing checks for git, git dependency for lazygit, file-preview deps for lf, desktop/kitten checks for scripts Lazygit: Fixed mkIf placement, imported assertions Neomutt: Removed verbose keybinding descriptions Nixvim: Removed notification-clear mapping File preview: Replaced libreoffice document preview with pandoc/antiword (terminal-based) Fzf launcher: Fixed bash compatibility (setopt → shopt -s) Deps: Added coreutils, fontconfig, antiword, pandoc, util-linux, bash, findutils, grep, sed, gawk, ncurses to various scripts --- modules/scripts/file-preview.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'modules/scripts/file-preview.sh') diff --git a/modules/scripts/file-preview.sh b/modules/scripts/file-preview.sh index fc07fe1..047252d 100644 --- a/modules/scripts/file-preview.sh +++ b/modules/scripts/file-preview.sh @@ -99,17 +99,16 @@ case "$MIMETYPE" in [ -s "$TMP_IMG" ] && render_image "$TMP_IMG" ;; - # --- OFFICE --- - application/vnd.openxmlformats-officedocument.*|application/msword|application/vnd.oasis.opendocument.*) - TMP_IMG="$TMP_DIR/doc-${INODE}.png" - if [ ! -f "$TMP_IMG" ]; then - libreoffice --headless --convert-to pdf --outdir "$TMP_DIR" "$FILE_PATH" >/dev/null 2>&1 - PDF_VER="${TMP_DIR}/$(basename "${FILE_PATH%.*}").pdf" - if [ -f "$PDF_VER" ]; then - pdftoppm -f 1 -l 1 -png -singlefile "$PDF_VER" "${TMP_IMG%.png}" >/dev/null 2>&1 - fi - fi - render_image "$TMP_IMG" + # --- OFFICE DOCUMENTS --- + # Extract text in the terminal instead of pulling in a graphical office suite. + application/vnd.openxmlformats-officedocument.wordprocessingml.document|application/vnd.oasis.opendocument.text) + pandoc --to plain "$FILE_PATH" 2>/dev/null + exit 0 + ;; + + application/msword) + antiword "$FILE_PATH" 2>/dev/null + exit 0 ;; # --- ARCHIVES --- -- cgit v1.2.3