diff options
author | terminaldweller <devi@terminaldweller.com> | 2023-05-10 13:59:57 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2023-05-10 13:59:57 +0000 |
commit | 9abd509ea355d28734082bb4d25ea90004c12f0a (patch) | |
tree | 0b07e7422ba862e1eb37781977b7143870144b20 /README.md | |
parent | in-memory wip (diff) | |
download | lclip-9abd509ea355d28734082bb4d25ea90004c12f0a.tar.gz lclip-9abd509ea355d28734082bb4d25ea90004c12f0a.zip |
lclipd is now basically non-blocking all the way through, no more zombie childs, the no in-memory yet, WIP
Diffstat (limited to '')
-rw-r--r-- | README.md | 33 |
1 files changed, 21 insertions, 12 deletions
@@ -2,17 +2,13 @@ A minimal clipboard manager in lua.</br> # How it works -lclipd runs the clipboard contents through `detect-secrets` and then puts the content in a sqlite3 database.</br> - -lclipd keeps the clipboard content database in the `tmp` directory.</br> - -Both X11 and wayland are supported.</br> - -lclipd is meant to be run as a user service. It can also be simply run by just running the script directly.</br> - -lclipd puts its logs in the system log.</br> - -lclipd does not require elevated privileges to run.</br> +* 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.</br> +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.</br> +You can use `jq` or `jaq` for further processing of the returned JSON object on the shell.</br> + ## Options ``` Usage: ./lclipd.lua [-h] [-s <hist_size>] [-d <detect_secrets_args>] + [-a <address>] [-p <port>] Options: -h, --help Show this help message and exit. @@ -55,6 +60,10 @@ Options: -d <detect_secrets_args>, --detect_secrets_args <detect_secrets_args> options that will be passed to detect secrets (default: ) + -a <address>, address to bind to (default: 127.0.0.1) + --address <address> + -p <port>, port to bind to + --port <port> ``` ## Supported OSes |