{"id":26368264,"url":"https://github.com/felipefacundes/preview","last_synced_at":"2026-02-28T00:11:37.401Z","repository":{"id":282723521,"uuid":"949171713","full_name":"felipefacundes/preview","owner":"felipefacundes","description":"A simple file manager written in bash with file preview capabilities, inspired by \"fff\", \"lesspipe\", and \"ranger\".  It uses \"lf\" as its foundation, enhancing file previews with custom commands for efficient navigation.  It offers configurable shortcuts to streamline file management.","archived":false,"fork":false,"pushed_at":"2025-04-17T01:06:25.000Z","size":94,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T14:22:11.572Z","etag":null,"topics":["bash","console","fff","file-launcher","file-manager","file-preview","files","preview","preview-video","previewer","previews","ranger","shell","shell-script","shellscript","terminal","terminal-app","termux","tui","vim"],"latest_commit_sha":null,"homepage":"https://shellutils.github.io/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felipefacundes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-15T20:51:00.000Z","updated_at":"2025-04-17T01:06:28.000Z","dependencies_parsed_at":"2025-04-17T02:49:58.998Z","dependency_job_id":"5b74056b-3baf-47ea-8349-a0548feef5b1","html_url":"https://github.com/felipefacundes/preview","commit_stats":null,"previous_names":["felipefacundes/preview"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/felipefacundes/preview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipefacundes%2Fpreview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipefacundes%2Fpreview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipefacundes%2Fpreview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipefacundes%2Fpreview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipefacundes","download_url":"https://codeload.github.com/felipefacundes/preview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipefacundes%2Fpreview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29920569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","console","fff","file-launcher","file-manager","file-preview","files","preview","preview-video","previewer","previews","ranger","shell","shell-script","shellscript","terminal","terminal-app","termux","tui","vim"],"created_at":"2025-03-16T22:26:02.434Z","updated_at":"2026-02-28T00:11:37.385Z","avatar_url":"https://github.com/felipefacundes.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PREVIEW - A Bash File Manager with Preview Capabilities\n\n**PREVIEW** is a lightweight, efficient file manager written in `Bash`, designed to provide seamless file navigation and preview functionalities in the terminal. Inspired by tools like `fff`, `lesspipe`, and `ranger`, it builds upon the `lf` foundation, enhancing file previews with customizable commands and configurable shortcuts. This script is part of the **[shell_utils](https://github.com/felipefacundes/shell_utils)** framework, one of the largest collections of scripts and utilities aimed at simplifying and enhancing user experience in the terminal.\n\n## Features\n- **File Previews**: Supports previews for various file types including text, images, archives, PDFs, and more, with configurable tools like `img2sixel`, `viu`, `glow`, and others.\n- **Customizable Shortcuts**: Offers extensive key bindings for navigation, file operations (copy, move, delete, etc.), and toggling preview modes.\n- **Color Support**: Integrates with `LS_COLORS` for visually appealing file listings.\n- **Configuration**: Comes with a detailed configuration file (`preview.conf`) allowing users to tweak settings like preview modes, colors, and key mappings.\n- **Cross-Platform**: Works across different Unix-like systems with adaptive behavior for environments like Termux.\n\n## Installation\nTo install and use PREVIEW, follow these steps:\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/felipefacundes/preview.git\n   cd preview\n\n    Make the Script Executable:\n    bash\n\n    chmod +x preview\n\n    Run the Script:\n    bash\n\n    ./preview\n\n    Optional - Move to a System Path:\n    For easy access, you can move it to a directory in your $PATH (e.g., /usr/bin):\n    bash\n\n    sudo mv preview /usr/bin/\n\n### Distros\n\n- Arch Linux: `yay -S preview`\n\n### Usage\nOnce installed, simply run preview in your terminal to start the file manager. Use the default or customized key bindings to navigate directories, preview files, and perform operations. The script automatically generates a configuration file at ~/.config/preview/preview.conf on first run, which you can edit to tailor the experience to your needs.\nExample Commands\n\n    Start in the current directory: preview\n    Start in a specific directory: preview /path/to/directory\n    Show version: preview -v\n    Show help: preview -h\n\n```bash\n# Usage for Preview File Manager\n# A simple file manager with preview capabilities written in Bash.\n\n# Navigation\nj or Down Arrow:    Scroll down\nk or Up Arrow:      Scroll up\nh or Left Arrow or Backspace:  Go to parent directory\nl or Right Arrow:   Enter child directory or open file\n- :                 Go to previous directory\ng:                  Go to top of file list\nG:                  Go to bottom of file list\nCtrl+G:             Go to a specific directory (type path)\n~ or H:             Go to home directory\nr:                  Refresh current directory\n\n# File and Directory Actions\nF:                  Create new file\nm:                  Create new directory\nR:                  Rename file or directory\nX:                  Toggle executable permission\ne:                  Extract archive to folder\nE:                  Delete file or marked files\nC:                  Copy file or marked files\nM:                  Move file or marked files\nZ:                  Copy file to clipboard (images or text, max 10MB)\n\n# Marking Files\ny:                  Mark/unmark current file\nY:                  Mark/unmark all files in current directory\nc:                  Clear all marked files\n\n# Preview and Display\nP or Ctrl+P:        Toggle preview/normal mode\ni:                  Show file info or full-screen image preview\nx:                  View file attributes (using 'stat')\n.:                  Toggle hidden files visibility\n/:                  Search files in current directory\n' or \":             Exit search mode (preserves selection)\n\n# Miscellaneous\n!:                  Open shell in current directory\nCtrl+D or = or Q or q:  Quit (cd to last directory if enabled)\n0-9:                Go to favorite directory (if set via PREVIEW_FAV_[0-9])\n\n# Notes\n- In preview mode, the screen splits to show file previews below the file list.\n- In normal mode, the full screen shows the file list.\n- Marked files persist within the same directory; changing directories clears marks.\n- Search filters the file list dynamically; use ' or \" to exit and restore the full list.\n- Favorite directories can be set in the config file (e.g., PREVIEW_FAV_0=/path).\n```\n\n### Configuration and Customization\nThe configuration file (preview.conf) is extensively documented within the script. It allows customization of:\n\n    Preview mode (on/off)\n    Maximum items displayed\n    Hidden file visibility\n    Colors for directories, status lines, and highlights\n    Key bindings for all actions\n    Preferred tools for file previews (e.g., markdown, images)\n\nEdit ~/.config/preview/preview.conf to adjust these settings.\n\n```bash\n# Customization for Preview File Manager\n# Configuration file: ${XDG_CONFIG_HOME:-$HOME/.config}/preview/preview.conf\n# Cache directory: ${XDG_CACHE_HOME:-$HOME/.cache}/preview\n\n# Default preview mode\n# 0: Normal mode (full file list), 1: Preview mode (split screen with previews)\n# Default: 1\nexport PREVIEW_MODE=1\n\n# Maximum items to show in preview mode\n# Number of files displayed in the file list in preview mode\n# Default: 9\nexport PREVIEW_MAX_ITEMS=9\n\n# Show hidden files by default\n# 0: Hidden files off, 1: Hidden files on\n# Default: 0\nexport PREVIEW_HIDDEN=0\n\n# Use LS_COLORS for file coloring\n# 0: Disable, 1: Enable (uses LS_COLORS if available)\n# Default: 1\nexport PREVIEW_LS_COLORS=1\n\n# File format string\n# Customize how file names are displayed (%f is the filename)\n# Example: \"\\t%f\" (tab before filename)\n# Default: \"%f\"\nexport PREVIEW_FILE_FORMAT=\"%f\"\n\n# Mark format string\n# Customize how marked files are displayed (%f is the filename)\n# Example: \"\u003e %f\" (prefix with \"\u003e\")\n# Default: \"\" (none)\nexport PREVIEW_MARK_FORMAT=\"\"\n\n# Default file opener\n# Command to open files when no specific handler is found\n# Default: \"xdg-open\"\nexport PREVIEW_OPENER=\"xdg-open\"\n\n# Change directory on exit\n# 0: Disable, 1: Enable (cd to last directory on exit)\n# Default: 1\nexport PREVIEW_CD_ON_EXIT=1\n\n# File to store last directory for CD on exit\n# Default: \"${XDG_CACHE_HOME:-$HOME/.cache}/preview/.preview_d\"\nexport PREVIEW_CD_FILE=\"${XDG_CACHE_HOME:-$HOME/.cache}/preview/.preview_d\"\n\n# Color for directories\n# ANSI color code [0-9]\n# Default: 2 (blue)\nexport PREVIEW_COL_DIRECTORY=2\n\n# Color for marked files\n# ANSI color code [0-9]\n# Default: 1 (red)\nexport PREVIEW_COL_MARKED=1\n\n# Status line background color\n# ANSI background code (e.g., 48;5;128 for purple)\n# Default: \"48;5;128\" (purple)\nexport PREVIEW_STATUS_BACKGROUND=\"48;5;128\"\n\n# Status line foreground color\n# ANSI foreground code (e.g., 1;38;5;16 for black)\n# Default: \"1;38;5;16\" (black)\nexport PREVIEW_STATUS_FOREGROUND=\"1;38;5;16\"\n\n# Selected item highlight color\n# ANSI color code [0-9]\n# Default: 6 (cyan)\nexport PREVIEW_SELECTED_HIGHLIGHT=6\n\n# Previous directory color in status line\n# ANSI foreground code (e.g., 1;38;5;16 for black)\n# Default: \"1;38;5;16\" (black)\nexport PWD_PREVIOUS_DIRECTORY=\"1;38;5;16\"\n\n# Last directory color in status line\n# ANSI foreground code (e.g., 1;33 for yellow)\n# Default: \"1;33\" (yellow)\nexport PWD_LAST_DIR=\"1;33\"\n\n# Directory separator color in status line\n# ANSI foreground code (e.g., 1;96 for cyan)\n# Default: \"1;96\" (cyan)\nexport PWD_BAR=\"1;96\"\n\n# File attributes command\n# Command to display file attributes with 'x' key\n# Default: \"stat\"\nexport PREVIEW_STAT_CMD=\"stat\"\n\n# Scroll behavior\n# 0: No loop (stops at ends), 1: Loop (wraps around)\n# Default: 1\nexport PREVIEW_LOOP_SCROLL=1\n\n# Favorite directories (Bookmarks) (keys 0-9)\n# Set paths for quick access with numeric keys\n# Example: export PREVIEW_FAV_0=~/Documents\nexport PREVIEW_FAV_0=\"\"\nexport PREVIEW_FAV_1=\"\"\nexport PREVIEW_FAV_2=\"\"\nexport PREVIEW_FAV_3=\"\"\nexport PREVIEW_FAV_4=\"\"\nexport PREVIEW_FAV_5=\"\"\nexport PREVIEW_FAV_6=\"\"\nexport PREVIEW_FAV_7=\"\"\nexport PREVIEW_FAV_8=\"\"\nexport PREVIEW_FAV_9=\"\"\n\n# Image preview tool\n# 1: img2sixel, 2: viu, 3: catimg, 4: chafa\n# Default: 1 (img2sixel)\nexport PREVIEW_IMG=1\n\n# Markdown preview tool\n# 1: glow, 2: bat, 3: mdless, 4: mdcat, 5: markdown_reader.sh\n# Default: 5 (markdown_reader.sh)\nexport PREVIEW_MARKDOWN=5\n\n# Image preview sizes (full-size)\n# Width and height for img2sixel (pixels)\nexport PREVIEW_SIXEL_W=540\nexport PREVIEW_SIXEL_H=420\n# Width and height for viu (characters)\nexport PREVIEW_VIU_W=90\nexport PREVIEW_VIU_H=35\n# Width for catimg (characters)\nexport PREVIEW_CATIMG_W=100\n# Size for chafa (characters)\nexport PREVIEW_CHAFA_S=50\n\n# Image preview sizes (thumbnail)\n# Width and height for img2sixel (pixels)\nexport PREVIEW_THUMB_SIXEL_W=300\nexport PREVIEW_THUMB_SIXEL_H=200\n# Width and height for viu (characters)\nexport PREVIEW_THUMB_VIU_W=50\nexport PREVIEW_THUMB_VIU_H=16\n# Width for catimg (characters)\nexport PREVIEW_THUMB_CATIMG_W=60\n# Size for chafa (characters)\nexport PREVIEW_THUMB_CHAFA_S=25\n\n# Text preview settings\n# Maximum lines for file content preview\n# Default: 30 (non-Android), 20 (Android)\nexport sizeline=30\n# Maximum width for text preview (characters)\n# Default: 200 (non-Android), 50 (Android)\nexport width=200\n# Margin for text folding (characters)\n# Default: 5\nexport PREVIEW_MARGIN=5\n\n# Code highlighting settings\n# Tab width for highlighting\n# Default: 8\nexport HIGHLIGHT_TABWIDTH=8\n# Highlight style\n# Default: \"pablo\"\nexport HIGHLIGHT_STYLE=\"pablo\"\n# Additional highlight options\n# Default: \"\"\nexport HIGHLIGHT_OPTIONS=\"\"\n# Pygmentize style\n# Default: \"autumn\"\nexport PYGMENTIZE_STYLE=\"autumn\"\n\n# Video/Image resolution\n# Resolution for resizing previews (WIDTHxHEIGHT)\n# Default: \"854x480\"\nexport RESOLUTION=\"854x480\"\n```\n### Dependencies\nPREVIEW leverages various external tools for enhanced functionality. Install these as needed:\n\n    img2sixel, viu, catimg, chafa (image previews)\n    glow, bat, mdless, mdcat (markdown previews)\n    7z, unzip, tar (archive handling)\n    exiftool, mediainfo (file metadata)\n\n### License\nPREVIEW is licensed under the GPLv3. See the script header for details.\n\n### Credits\nDeveloped by Felipe Facundes.\n\n### Contributing\nContributions are welcome! Feel free to submit a Pull Request. For significant changes, please open an issue first to discuss what you would like to change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipefacundes%2Fpreview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipefacundes%2Fpreview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipefacundes%2Fpreview/lists"}