Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide the contents of clipboard from the systemd service logs #49

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions clipmenud
Expand Up @@ -2,6 +2,7 @@

: "${CM_ONESHOT=0}"
: "${CM_OWN_CLIPBOARD=1}"
: "${CM_PRIVACY=1}"
: "${CM_DEBUG=0}"
: "${TMPDIR=/tmp}"

Expand Down Expand Up @@ -61,6 +62,7 @@ Environment variables:

- $CM_ONESHOT: run once immediately, do not loop (default: 0)
- $CM_DEBUG: turn on debugging output (default: 0)
- $CM_PRIVACY: do not print clipboard content to standard out (default: 1)
- $CM_OWN_CLIPBOARD: take ownership of the clipboard (default: 1)
- $TMPDIR: specify the base directory to store the cache dir in (default: /tmp)
EOF
Expand Down Expand Up @@ -114,8 +116,13 @@ while (( CM_ONESHOT )) || sleep "${CM_SLEEP:-0.5}"; do

first_line=$(get_first_line "$data")

printf 'New clipboard entry on %s selection: "%s"\n' \
"$selection" "$first_line"
if (( CM_PRIVACY )); then
printf 'New clipboard entry on %s selection.\n' \
"$selection"
else
printf 'New clipboard entry on %s selection: "%s"\n' \
"$selection" "$first_line"
fi

filename="$cache_dir/$(cksum <<< "$first_line")"
debug "Writing $data to $filename"
Expand Down
1 change: 1 addition & 0 deletions init/clipmenud.service
Expand Up @@ -6,6 +6,7 @@ ExecStart=/usr/bin/clipmenud
Restart=always
RestartSec=0
Environment=DISPLAY=:0
Environment=CM_PRIVACY=1

MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
Expand Down