https://github.com/sayanarijit/preview-tabbed.xplr
Previewer implementation for xplr using suckless tabbed and nnn preview-tabbed
https://github.com/sayanarijit/preview-tabbed.xplr
Last synced: 7 months ago
JSON representation
Previewer implementation for xplr using suckless tabbed and nnn preview-tabbed
- Host: GitHub
- URL: https://github.com/sayanarijit/preview-tabbed.xplr
- Owner: sayanarijit
- License: mit
- Created: 2021-07-01T14:04:35.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-14T03:08:15.000Z (over 2 years ago)
- Last Synced: 2025-03-19T06:04:51.836Z (7 months ago)
- Language: Lua
- Homepage: https://xplr.dev
- Size: 12.7 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Preview paths using suckless [tabbed](https://tools.suckless.org/tabbed/) and
[nnn preview-tabbed](https://github.com/jarun/nnn/blob/master/plugins/preview-tabbed).## Requirements
- [nnn](https://github.com/jarun/nnn) with
[plugins](https://github.com/jarun/nnn/tree/master/plugins#nnn-plugins)
(specifically [preview-tabbed](https://github.com/jarun/nnn/blob/master/plugins/preview-tabbed)
and
[nuke](https://github.com/jarun/nnn/blob/master/plugins/nuke))
- [tabbed](https://tools.suckless.org/tabbed) (xembed host)
- [xterm](https://invisible-island.net/xterm/) (or [urxvt](https://software.schmorp.de/pkg/rxvt-unicode.html) or [st](https://st.suckless.org/))
- [mpv](https://mpv.io) (xembed client for video/audio)
- [sxiv](https://github.com/muennich/sxiv) (xembed client for images)
- [zathura](https://pwmt.org/projects/zathura) (xembed client for PDF)
- [vim](https://www.vim.org) (or any editor/pager really)
- file
- mktemp
- [xdotool](https://github.com/jordansissel/xdotool) (optional, to keep main window focused)TODO: Reduce dependencies as much as possible. ([WIP](https://github.com/sayanarijit/previuwu))
## Installation
### Install manually
- Add the following line in `~/.config/xplr/init.lua`
```lua
local home = os.getenv("HOME")
package.path = home
.. "/.config/xplr/plugins/?/init.lua;"
.. home
.. "/.config/xplr/plugins/?.lua;"
.. package.path
```- Clone the plugin
```bash
mkdir -p ~/.config/xplr/pluginsgit clone https://github.com/sayanarijit/preview-tabbed.xplr ~/.config/xplr/plugins/preview-tabbed
```- Require the module in `~/.config/xplr/init.lua`
```lua
require("preview-tabbed").setup()-- Or
require("preview-tabbed").setup{
mode = "action",
key = "P",
fifo_path = "/tmp/xplr.fifo",
previewer = os.getenv("HOME") .. "/.config/nnn/plugins/preview-tabbed",
}-- Type `:p` to toggle preview mode.
```## Troubleshooting
1. **Getting `Permission denied`**
Make sure `~/.config/nnn/plugins/*` scripts have execute permission.
```
chmod +x ~/.config/nnn/plugins/*
```2. **xplr gets stuck and it's difficult to debug**
This is the FIFO doing its job.
Run `cat /tmp/xplr.fifo` in another window while xplr is stuck/running. Keep
both running. This will keep clearing the FIFO buffer as you debug.3. **Window focus gets lost in XMonad**
As [@mrdgo pointed out](https://github.com/sayanarijit/xplr/issues/258#issuecomment-860037317), this should do the trick:
```haskell
import XMonad.Hooks.EwmhDesktops (ewmh)
-- xmonad config
main = do
xmonad $ ewmh $ def {...}
```