Skip to content

revathskumar/bender

Repository files navigation

Bender

Bending Text

Demo

demo

Usage

greenclip print |  gjs -m "dist/main.js"

or

echo -e 'hello \n 123' |  gjs -m "dist/main.js"

Configuration

Copy config.yaml to ~/.config/bender/config.yaml ($XDG_CONFIG_HOME/bender/config.yaml)

Available actions:

  • replace "<search_val>" "<replace_val>"
  • uppercase
  • lowercase
  • snakecase
  • onlyAlphanum
  • toHex
  • reverse
  • removeDiacritics
  • extract "" NOTES:
    • '\' in \d, \s extra should escaped like \\s or \\d
    • Regexp flags are not supported

Add new entry for actions

  - label: remove space
    action: replace " " ""

use pipe(|) to use mulitple actions

  - label: enum
    action: snakecase | uppercase

Key bindings

  • ESC - close the window
  • ENTER - Apply the focused action (print the output to stdout & close the window)
  • RIGHT ARROW - Open the actions sidebar
  • LEFT ARROW - Close the actions sidebar
  • any alphanumeric - search & filter the list
  • UP/DOWN ARROWS -
    • navigate through the list (when the actions sidebar is closed)
    • navigate through available actions (when actions sidebar is open with RIGHT ARROW)
  • CTRL+<1-9> : On list view
    • print the item (based on position 1-9) to stdout

Dev setup

Install dependencies

  • libgtk4
  • libadwaita
  • gjs - 1.74.2
  • meson - 1.0.1
sudo apt install libgtk-4-1 libgtk-4-dev libadwaita-1-dev
npm i
npm run build
echo -e "Hello\nBender" | G_MESSAGES_DEBUG=all ./bin/bender

Build & Install

Dev build

npm run build
meson setup --prefix=***/path/to/bender/run/ builddir/
meson compile -C builddir/
meson install -C builddir/
echo -e "Hello\nBender" | ./run/bin/com.revathskumar.bender
npm run build
meson setup builddir
meson compile -C builddir
sudo meson install -C builddir

and run it by echo -e "Hello\nBender" | com.revathskumar.bender

Using flatpak

flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir com.revathskumar.bender.yaml
echo -e "Hello\nBender" | flatpak run com.revathskumar.bender

Credits

Inspired by Rofi Based on gjsify/example-gtk4 by Pascal Garber

License

MIT