From 9abd509ea355d28734082bb4d25ea90004c12f0a Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Wed, 10 May 2023 17:29:57 +0330 Subject: lclipd is now basically non-blocking all the way through, no more zombie childs, the no in-memory yet, WIP --- README.md | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 3d55847..ef5b957 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,13 @@ A minimal clipboard manager in lua.
# How it works -lclipd runs the clipboard contents through `detect-secrets` and then puts the content in a sqlite3 database.
- -lclipd keeps the clipboard content database in the `tmp` directory.
- -Both X11 and wayland are supported.
- -lclipd is meant to be run as a user service. It can also be simply run by just running the script directly.
- -lclipd puts its logs in the system log.
- -lclipd does not require elevated privileges to run.
+* lclipd runs the clipboard contents through `detect-secrets` and then puts the content in a sqlite3 database +* lclipd keeps the clipboard content database in the `tmp` directory +* Both X11 and wayland are supported +* it is meant to be run as a user service. It can also be simply run by just running the script directly +* the logs are put in the system log +* lclipd does not require elevated privileges to run nor does it need to have extra capabilities +* exposes a TCP server which you can use to query the db(on localhost:9999 by default) ## Requirements * lua5.3 @@ -37,15 +33,24 @@ lclipd is technically just the "backend". One way to have a frontend is to use d #!/usr/bin/env sh SQL_DB="$(cat /tmp/lclipd/lclipd_db_name)" -content=$(sqlite3 "${SQL_DB}" "select replace(content,char(10),' '),id from lclipd;" | dmenu -fn "DejaVuSansMono Nerd Font Mono-11.3;antialias=true;autohint=true" -D "|" -l 20 -p "lclipd:") +content=$(sqlite3 "${SQL_DB}" "select replace(content,char(10),' '),id from lclipd;" | dmenu -D "|" -l 20 -p "lclipd:") sqlite3 "${SQL_DB}" "select content from lclipd where id = ${content}" | xsel -ib ``` For the above to work you have to have added the dynamic patch to dmenu.
+One way to query the db through the TCP socket is like this: +```sh +echo 'select * from lclipd;' > ./cmd.sql +nc -v 127.0.0.1:9999 < ./cmd.sql +``` +The TCP server will return a JSON array as a response.
+You can use `jq` or `jaq` for further processing of the returned JSON object on the shell.
+ ## Options ``` Usage: ./lclipd.lua [-h] [-s ] [-d ] + [-a
] [-p ] Options: -h, --help Show this help message and exit. @@ -55,6 +60,10 @@ Options: -d , --detect_secrets_args options that will be passed to detect secrets (default: ) + -a
, address to bind to (default: 127.0.0.1) + --address
+ -p , port to bind to + --port ``` ## Supported OSes -- cgit v1.2.3