#!/bin/zsh
dmenu=(
	dmenu
	-fn 'Misc Fixed:semicondensed:pixelsize=13:lang=cs'
	-nb darkred
	-nf silver
	-sb '#333333'
	-sf white
)
list=(
	s6-ipcclient
	/run/inbox/pass.ccx/run/pass/list
	s6-ioconnect
)
show=(
	s6-sudo
	/run/inbox/pass.ccx/run/exec/exec
	pass show --
)
wid=$(xdotool getactivewindow) &&
pass=$($list </dev/null | $dmenu -p "$(xdotool getwindowname $wid)") &&
$show $pass |
	awk -v wid=$wid  'NR == 1 { printf("type --window %s %s\n", wid, $0) }' | \
	s6-sudo $x_container_tmpfs/run/exec/exec xdotool -
#powerbox-plumb "pass-input/wid:$wid/$pass"
#pass show $pass | sed 's/.*/type --window '${wid}' "&"/;q' | xdotool -