diff --git a/dotfiles/hypr-session/dot-config/hypr/hyprland.conf b/dotfiles/hypr-session/dot-config/hypr/hyprland.conf index d8d96a7..a45ee2e 100644 --- a/dotfiles/hypr-session/dot-config/hypr/hyprland.conf +++ b/dotfiles/hypr-session/dot-config/hypr/hyprland.conf @@ -41,7 +41,8 @@ exec-once = waybar exec-once = qpwgraph --minimized exec-once = hypridle 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 ############################# diff --git a/dotfiles/my-binaries/dot-bin/cliphist-filter b/dotfiles/my-binaries/dot-bin/cliphist-filter new file mode 100755 index 0000000..c786e51 --- /dev/null +++ b/dotfiles/my-binaries/dot-bin/cliphist-filter @@ -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 diff --git a/dotfiles/my-binaries/dot-bin/fzpass b/dotfiles/my-binaries/dot-bin/fzpass index e79dca3..0861e88 100755 --- a/dotfiles/my-binaries/dot-bin/fzpass +++ b/dotfiles/my-binaries/dot-bin/fzpass @@ -44,6 +44,14 @@ C-u: Update (pull, push); C-r: Remove' ## Exit if nothing was selected 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 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