xwaitforwindow: init
This commit is contained in:
parent
1feb294a75
commit
7603f9e568
15
krebs/5pkgs/simple/xwaitforwindow.nix
Normal file
15
krebs/5pkgs/simple/xwaitforwindow.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ writeDashBin, xdotool, xorg }:
|
||||
writeDashBin "xwaitforwindow" ''
|
||||
# usage: xwaitforwindow ARGS
|
||||
# see xdotool search for possible ARGS
|
||||
# example: xwaitforwindow -name WINDOWNAME
|
||||
set -efu
|
||||
|
||||
if id=$(${xdotool}/bin/xdotool search "$@"); then
|
||||
printf 'waiting for window %#x\n' "$id" >&2
|
||||
exec ${xorg.xprop}/bin/xprop -spy -id "$id" >/dev/null
|
||||
else
|
||||
printf 'no window found with xdotool search %s\n' "$*" >&2
|
||||
exit 1
|
||||
fi
|
||||
''
|
Loading…
Reference in a new issue