Skip to content

Instantly share code, notes, and snippets.

@benjamin-thomas
Created January 20, 2018 11:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save benjamin-thomas/dda584158f002091cf884a435379ca22 to your computer and use it in GitHub Desktop.
Save benjamin-thomas/dda584158f002091cf884a435379ca22 to your computer and use it in GitHub Desktop.
WIP : bypass XFCE clipboard manager when using pass/passwordstore.org
#!/bin/bash
# Load the bash completion first
# my_pass.sh needs to be on the load path
# complete -F _pass mypass.sh
pgrep clipman
if [[ $? -ne 0 ]];then
# clipman not running...
echo "XFCE clipboard manager is not running, don't use this wrapper script"
exit 1
fi
xfconf-query --channel xfce4-panel --property=/plugins/clipman/tweaks/inhibit
if [[ $? -ne 0 ]];then
echo "[CREATE] inhibiting..."
xfconf-query --channel xfce4-panel --property=/plugins/clipman/tweaks/inhibit --create --type=bool --set=true
else
echo "[START] inhibiting..."
xfconf-query --channel xfce4-panel --property=/plugins/clipman/tweaks/inhibit --set=true
fi
if [[ $(xfconf-query --channel xfce4-panel --property=/plugins/clipman/tweaks/inhibit) != "true" ]];then
echo "FAILED to set inhibit"
exit 2
fi
pass "$@"
echo "[STOP] inhibiting..."
xfconf-query --channel xfce4-panel --property=/plugins/clipman/tweaks/inhibit --set=false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment