From 0a03fc5b1931eca4cd8f2ec3f9f80b3d21def5b8 Mon Sep 17 00:00:00 2001 From: xyz Date: Thu, 13 Oct 2022 01:18:25 -0700 Subject: clear clipboard before alt-o copy duolibre pass otp --- config.def.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 76eac6e..c4d286b 100644 --- a/config.def.h +++ b/config.def.h @@ -116,7 +116,8 @@ static const Key keys[] = { { MODKEY, XF86XK_AudioMute, spawn, SHCMD("amixer set Capture toggle; kill -RTMIN $(pidof -x sbar)") }, { MODKEY, XK_Print, spawn, SHCMD("xrectsel '%w %h %x %y' | xargs sh -c 'ffmpeg -f x11grab -s \"$1x$2\" -i \"$DISPLAY+$3,$4\" -vframes 1 \"$XDG_PICTURES_DIR/screenshots/$(time.uuid).png\"' shell && notify-send 'Screenshot Finished'") }, { MODKEY, XK_n, spawn, SHCMD("dunstctl close") }, - { MODKEY, XK_o, spawn, SHCMD("pass otp duolibre | tail -n1 | xsel -ibt 3000") }, + // `xsel -cb` because there's a small delay before reading password into clipboard, so clear it beforehand to prevent pasting old clipboard + { MODKEY, XK_o, spawn, SHCMD("xsel -cb; pass otp duolibre | tail -n1 | xsel -ibt 3000") }, { MODKEY, XK_q, spawn, SHCMD("qbittorrent & alacritty -t monerod -e monerod") }, { MODKEY, XK_r, spawn, SHCMD("xsel -ob | rev | xsel -ib") }, // Use "$(xsel -op)" instead of "xsel -op | sdcv" (with sh -c?) because: the latter won't quit if found items similar and require user input. Not sure why. -- cgit v1.2.3-70-g09d2