Dmenu - Rofi

Dmenu - Rofi

Using suki with Dmenu/Rofi

suki can be used with dmenu or Rofi to create a fast, keyboard-driven bookmark selector. This guide explains how to integrate suki with these tools.


Basic Usage

To list bookmarks in a format suitable for dmenu or Rofi, use the list command:

suki list

This will output bookmarks in the format:

https://example.com
https://another-example.com

Each line contains only the bookmark URL.


Customizing Output Format

You can customize the output format using the --format flag. This flag accepts a custom printf-style format that is internally transformed into a Go template.

Example: Title, Tags, and URL

suki list --format "%T [%t] %u"

Available Format Verbs

  • %T - Bookmark title
  • %t - Bookmark tags (comma-separated)
  • %u - Bookmark URL
  • %d - Bookmark description

Example: Using with Rofi

Rofi Integration
suki list --format "<span lang=\"%u\">%T %t\t%u</span>\n" | rofi -theme-str 'window{ width: 100%; location: north; anchor: north; }' -markup-rows -i -p "Bookmarks:" -no-custom -dmenu | pup 'span attr{lang}'
Rofi Bookmark Launcher: contrib/rofi.sh
#!/usr/bin/env sh

THEME_STR='window{ width: 100%; location: north; anchor: north; }'

selected=$(suki --format "<span lang=\"%u\">%T %t\t%u</span>\n" | rofi -theme-str "$THEME_STR" -markup-rows -i -p "bookmarks" -no-custom -dmenu)

exec xdg-open $(echo "$selected" | pup 'span attr{lang}')

Tips and Tricks

  • Use --format to include additional metadata like tags or descriptions.
  • Combine with shell tools like cut, awk, or sed for advanced formatting.
  • Use Rofi’s -no-custom flag to disable custom window handling for a cleaner look.
  • Ensure xdg-open is installed for proper URL handling.