From 1daaeda6f3aca6f9f8e5b3196314442fb74fae14 Mon Sep 17 00:00:00 2001 From: Chris Down Date: Fri, 6 Jan 2017 16:46:49 +0000 Subject: [PATCH] Remove print_debug_info, this was never very useful --- clipmenu | 1 - clipmenud | 35 ----------------------------------- 2 files changed, 36 deletions(-) diff --git a/clipmenu b/clipmenu index 5105b7b..390d2a5 100755 --- a/clipmenu +++ b/clipmenu @@ -21,7 +21,6 @@ if ! [[ -f "$file" ]]; then exit 2 fi - for selection in clipboard primary; do if type -p xsel >/dev/null 2>&1; then xsel -i --"$selection" < "$file" diff --git a/clipmenud b/clipmenud index b3d0b6b..d66ad98 100755 --- a/clipmenud +++ b/clipmenud @@ -31,43 +31,12 @@ get_first_line() { }' <<< "$data" } -hr_msg() { - printf -- '\n--- %s ---\n\n' "$1" >&2 -} - debug() { if (( DEBUG )); then printf '%s\n' "$@" >&2 fi } -print_debug_info() { - # DEBUG comes from the environment - if ! (( DEBUG )); then - return - fi - - local msg="${1?}" - - hr_msg "$msg" - - hr_msg Environment - env | LC_ALL=C sort >&2 - - cgroup_path=/proc/$$/cgroup - - if [[ -f $cgroup_path ]]; then - hr_msg cgroup - cat "$cgroup_path" >&2 - else - hr_msg 'NO CGROUP' - fi - - hr_msg 'Finished debug info' -} - -print_debug_info 'Initialising' - cache_dir=/tmp/clipmenu.$USER/ cache_file=$cache_dir/line_cache @@ -79,11 +48,8 @@ declare -A last_data declare -A last_filename while sleep "${CLIPMENUD_SLEEP:-0.5}"; do - print_debug_info 'About to run selection' for selection in clipboard primary; do - print_debug_info "About to do selection for '$selection'" - if type -p xsel >/dev/null 2>&1; then debug 'Using xsel' data=$(xsel -o --"$selection"; printf x) @@ -120,7 +86,6 @@ while sleep "${CLIPMENUD_SLEEP:-0.5}"; do rm -- "${last_filename[$selection]}" fi - last_data[$selection]=$data last_filename[$selection]=$filename