2020-03-25 16:49:22 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
if [[ -z $1 ]] || [[ $1 == --help ]] || [[ $1 == -h ]]; then
|
|
|
|
cat << 'EOF'
|
|
|
|
clipctl provides controls for the clipmenud daemon.
|
|
|
|
|
|
|
|
You can temporarily disable clip collection without stopping clipmenud entirely
|
|
|
|
by running "clipctl disable". You can then reenable with "clipctl enable".
|
|
|
|
EOF
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-03-28 15:12:49 +01:00
|
|
|
_CLIPMENUD_PID=$(pgrep -u "$(id -u)" -nf 'clipmenud$')
|
2020-03-25 16:49:22 +01:00
|
|
|
|
|
|
|
if [[ -z "$_CLIPMENUD_PID" ]]; then
|
|
|
|
echo "clipmenud is not running"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
enable) kill -USR2 "$_CLIPMENUD_PID" ;;
|
|
|
|
disable) kill -USR1 "$_CLIPMENUD_PID" ;;
|
|
|
|
*)
|
|
|
|
printf 'Unknown command: %s\n' "$1"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|