Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/8dcc/plumber

Run different commands depending on the text format
https://github.com/8dcc/plumber

plan9 plumber regex utility

Last synced: 23 days ago
JSON representation

Run different commands depending on the text format

Awesome Lists containing this project

README

        

#+TITLE: Plumber
#+AUTHOR: 8dcc
#+OPTIONS: toc:2
#+STARTUP: showeverything

*Run different commands depending on the text format.*

This program is inspired by the [[https://st.suckless.org/patches/right_click_to_plumb/][right click to plumb]] patch for the [[https://st.suckless.org/][Simple
Terminal]], and was originally designed to be used with [[https://github.com/8dcc/linux-dotfiles][my build of ST]].

I started using the patch with [[https://surf.suckless.org/][surf]] (lighweight suckless browser) as my plumb
command, but after looking at the [[https://9p.io/wiki/plan9/using_plumbing/index.html][Plan9 plumbing page]], I decided to make my own
personal version.

* Building

To build the program, simply run =make=.

#+begin_src console
$ git clone https://github.com/8dcc/plumber
$ cd plumber
$ make
...
#+end_src

You can also install it with the =install= target.

#+begin_src console
$ sudo make install
...
#+end_src

* Usage

Note that the commands on the right are the default ones but can be changed from
[[https://github.com/8dcc/plumber/blob/main/src/config.h][src/config.h]].

#+begin_src console
$ plumber --help
Usage: plumber [REGEXP]
Examples:
plumber https://example.com - Open in browser (firefox)
plumber file.pdf - Open in PDF viewer (firefox)
plumber cmd(1) - Open man page (man)
plumber image.png - Open in image viewer (nsxiv)
plumber video.mkv - Open in video player (mpv)
plumber file.txt - Open in text editor (nvim)
plumber source.c:13:5 - Open at line and column (nvim)
#+end_src