From 021c919294d83e8610d1d2f99914a0b92523740c Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Tue, 9 Jul 2024 22:50:57 +0500 Subject: Toggle clipman on clipboard stream --- clipboard-stream | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'clipboard-stream') diff --git a/clipboard-stream b/clipboard-stream index a1f0cdc..a1defc6 100755 --- a/clipboard-stream +++ b/clipboard-stream @@ -13,7 +13,21 @@ find_clipboard_command() { fi } +clipman_settings() { + xfconf-query -c xfce4-panel -p /plugins/clipman/settings/enable-actions "$@" 2>/dev/null +} + +restore_clipman_actions() { + if [ -n "$1" ]; then + clipman_settings -s "$1" + fi +} + main() { + CLIPMAN_ACTION_STATE=$(clipman_settings || echo) + trap 'restore_clipman_actions "$CLIPMAN_ACTION_STATE"' EXIT + clipman_settings -s 'false' >/dev/null || true + CLIPBOARD_COMMAND=$(find_clipboard_command) recent_value=$(eval "$CLIPBOARD_COMMAND") while true; do -- cgit v1.2.3