From f832b43c1562c8c542cb01c10506e3293e671cd5 Mon Sep 17 00:00:00 2001 From: luravoid Date: Sun, 1 Dec 2024 18:24:25 +0100 Subject: [PATCH] add rofi script to tips --- docs/tips.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/tips.md b/docs/tips.md index fe505e12..8e31358e 100644 --- a/docs/tips.md +++ b/docs/tips.md @@ -501,6 +501,44 @@ run = ''' ''' ``` +## Preview directory with Rofi + +**This tip currently requires Yazi nightly version.** + +This script lets you preview the current directory's thumbnails using Rofi. Selecting an item reveals it in Yazi. + +Save the script in your preferred location, for example, ~/.config/rofi/rofi-gridview.sh. + +```bash +#!/bin/bash + +rofi \ + -theme fullscreen-preview \ + -show filebrowser \ + -filebrowser-command "ya emit reveal" \ + -filebrowser-directory "$(pwd)" +``` + +Make it executable: + +``` +chmod +x ~/.config/rofi/rofi-gridview.sh +``` + +Then add the script as a keybinding. + +```toml +# ~/.config/yazi/keymap.toml +[[manager.prepend_keymap]] +on = "" +run = ''' + shell --confirm '~/.config/rofi/rofi-gridview.sh' +''' +''' +``` + +Rofi themes: https://davatorium.github.io/rofi/themes/themes + ## Make Yazi even faster than fast {#make-yazi-even-faster} While Yazi is already fast, there is still plenty of room for optimization for specific users or under certain conditions: