Remove print_debug_info, this was never very useful
This commit is contained in:
parent
8885306970
commit
1daaeda6f3
1
clipmenu
1
clipmenu
|
@ -21,7 +21,6 @@ if ! [[ -f "$file" ]]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
for selection in clipboard primary; do
|
for selection in clipboard primary; do
|
||||||
if type -p xsel >/dev/null 2>&1; then
|
if type -p xsel >/dev/null 2>&1; then
|
||||||
xsel -i --"$selection" < "$file"
|
xsel -i --"$selection" < "$file"
|
||||||
|
|
35
clipmenud
35
clipmenud
|
@ -31,43 +31,12 @@ get_first_line() {
|
||||||
}' <<< "$data"
|
}' <<< "$data"
|
||||||
}
|
}
|
||||||
|
|
||||||
hr_msg() {
|
|
||||||
printf -- '\n--- %s ---\n\n' "$1" >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
debug() {
|
debug() {
|
||||||
if (( DEBUG )); then
|
if (( DEBUG )); then
|
||||||
printf '%s\n' "$@" >&2
|
printf '%s\n' "$@" >&2
|
||||||
fi
|
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_dir=/tmp/clipmenu.$USER/
|
||||||
cache_file=$cache_dir/line_cache
|
cache_file=$cache_dir/line_cache
|
||||||
|
|
||||||
|
@ -79,11 +48,8 @@ declare -A last_data
|
||||||
declare -A last_filename
|
declare -A last_filename
|
||||||
|
|
||||||
while sleep "${CLIPMENUD_SLEEP:-0.5}"; do
|
while sleep "${CLIPMENUD_SLEEP:-0.5}"; do
|
||||||
print_debug_info 'About to run selection'
|
|
||||||
|
|
||||||
for selection in clipboard primary; do
|
for selection in clipboard primary; do
|
||||||
print_debug_info "About to do selection for '$selection'"
|
|
||||||
|
|
||||||
if type -p xsel >/dev/null 2>&1; then
|
if type -p xsel >/dev/null 2>&1; then
|
||||||
debug 'Using xsel'
|
debug 'Using xsel'
|
||||||
data=$(xsel -o --"$selection"; printf x)
|
data=$(xsel -o --"$selection"; printf x)
|
||||||
|
@ -120,7 +86,6 @@ while sleep "${CLIPMENUD_SLEEP:-0.5}"; do
|
||||||
rm -- "${last_filename[$selection]}"
|
rm -- "${last_filename[$selection]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
last_data[$selection]=$data
|
last_data[$selection]=$data
|
||||||
last_filename[$selection]=$filename
|
last_filename[$selection]=$filename
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue