add kde password manager thingy

This commit is contained in:
yosh 2023-12-19 11:23:39 -06:00
parent 9c0dcef048
commit 82c934123d
2 changed files with 13 additions and 0 deletions

6
config
View File

@ -23,6 +23,12 @@ SHCLIP_FILTER_ENABLED=""
# default: yes
SHCLIP_SYNC_CLIPBOARD="1"
# enable caching password manager clips, currently only KDE's password
# manager is affected by this. idk any other ones with custom mime types
# blank for no, anything for yes
# default: no
SHCLIP_CACHE_PASSWORDS=""
### SHCLIP-MENU OPTIONS ###
# text editor for editing clips

View File

@ -16,6 +16,7 @@ SHCLIP_MEMORY_LIMIT="${SHCLIP_MEMORY_LIMIT:-4100}" # memory limit in kb
SHCLIP_ENABLED="${SHCLIP_ENABLED-1}"
SHCLIP_FILTER_ENABLED="${SHCLIP_FILTER_ENABLED-}"
SHCLIP_SYNC_CLIPBOARD="${SHCLIP_SYNC_CLIPBOARD-1}"
SHCLIP_CACHE_PASSWORDS="${SHCLIP_CACHE_PASSWORDS-}"
SHCLIP_TEMP_DIR="${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}}/shclip-$USER-$DISPLAY"
@ -111,6 +112,12 @@ updateclip() {
case "$targets" in
*gnome-copied-files*) return 0 ;;
*image/png*) xclip -sel clipboard -t image/png -o > "$BUFFER" ;;
*x-kde-passwordManagerHint*)
if [ -n "$SHCLIP_CACHE_PASSWORDS" ]; then
xclip -sel clipboard -t x-kde-passwordManagerHint -o > "$BUFFER"
else return 0
fi
;;
*) xclip -sel clipboard -o > "$BUFFER" ;;
esac