From ff33b4f04b6f9932bb75f775bf87ae0e95f76c89 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 6 Apr 2024 23:33:29 -0700 Subject: pass otp no need tail because the other lines are stderr instead of stdout; also use carriage return for auto enter --- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 01a46a9..c726957 100644 --- a/config.def.h +++ b/config.def.h @@ -139,7 +139,7 @@ static const Key keys[] = { { MODKEY, XK_e, spawn, SHCMD("firefox --search \"$(xsel -op)\"") }, { MODKEY, XK_g, 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).jxl\"' shell && notify-send 'Screenshot Finished'") }, { MODKEY, XK_n, spawn, SHCMD("dunstctl close") }, - { MODKEY, XK_o, spawn, SHCMD("pass otp sjsu.okta.com | tail -n1 | xdotool type --clearmodifiers --file -") }, + { MODKEY, XK_o, spawn, SHCMD("pass otp sjsu.okta.com | tr '\n' '\r' | xdotool type --clearmodifiers --file -") }, // https://unix.stackexchange.com/a/568679/459013 // https://stackoverflow.com/q/8696751/9008720 // alternative: `sed 's/./& /g'` or sed 's/./& /g;s/ $//'` -- cgit v1.2.3-70-g09d2