1
0
Fork 0

Filter fzpass passwords from cliphist

This commit is contained in:
J. Elfring 2024-11-03 19:14:05 +01:00
parent 728edae79e
commit 390c5b2802
3 changed files with 30 additions and 2 deletions

View file

@ -41,7 +41,8 @@ exec-once = waybar
exec-once = qpwgraph --minimized exec-once = qpwgraph --minimized
exec-once = hypridle exec-once = hypridle
exec-once = hyprpaper exec-once = hyprpaper
exec-once = wl-paste --watch cliphist store exec-once = wl-paste --watch ~/.bin/cliphist-filter
exec-once = wl-paste --primary --watch ~/.bin/cliphist-filter
############################# #############################

View file

@ -0,0 +1,19 @@
#!/bin/bash
#########################################################
##
# A filter for cliphist monitoring the clipboards
# in wayland / hyprland.
# When the file ~/.local/cliphist-filter.block is
# present, watched clipboard contents will not be
# pasted into cliphist.
# Start with:
# exec-once = wl-paste --watch ~/.bin/cliphist-filter
# exec-once = wl-paste --primary --watch ~/.bin/cliphist-filter
# from hyprland.conf
#
# / elfrinjo, 2024
#
test -e ~/.local/cliphist-filter.block && exit 0
cat | cliphist store

View file

@ -44,6 +44,14 @@ C-u: Update (pull, push); C-r: Remove'
## Exit if nothing was selected ## Exit if nothing was selected
test "_$password" = "_" && exit test "_$password" = "_" && exit
## Disable Clipboard Managers
touch ~/.local/cliphist-filter.block
pgrep --full /usr/bin/clipmenud >/dev/null && clipctl disable
## Copy pass and show otp, exit silently if anything fails ## Copy pass and show otp, exit silently if anything fails
pass show -c "$password" pass show -c "$password"
pass otp "$password" 2>/dev/null || exit 0 pass otp "$password" 2>/dev/null
## Re-Enable Clipboard Managers
rm -f ~/.local/cliphist-filter.block
pgrep --full /usr/bin/clipmenud >/dev/null && clipctl disable