commit 72e15005e9fdedbdeb53b009965fd33cf8d26ba3
parent 54981486f2e651705e54439d5a601aab64114e0b
Author: Chris Down <chris@chrisdown.name>
Date: Sun, 6 Sep 2015 01:43:38 +0100
Reduce default poll time down to 0.5 seconds
This is configurable via an environment variable rather than a command line
option, as I'm not expecting many people really need to change this thing.
I profiled the change from 1 -> 0.5 seconds on an old P4, and saw pretty much
no difference in CPU usage, whether there were new clipboard entries or not.
Closes #12.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clipmenud b/clipmenud
@@ -5,7 +5,7 @@ mkdir -p -m0700 "$cache_dir"
declare -A last_data
-while sleep 1; do
+while sleep "${CLIPMENUD_SLEEP:-0.5}"; do
for selection in clipboard primary; do
if type -p xsel >/dev/null 2>&1; then
data=$(xsel --"$selection"; printf x)