diff options
author | lassulus <lassulus@lassul.us> | 2020-05-25 16:08:23 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2020-05-25 16:08:23 +0200 |
commit | bf77db83651898c9e94f84ea5919d8acc15f185a (patch) | |
tree | c2b800c5a746fd2021b3621b9c1f83b310e253be /krebs/5pkgs/simple/xwaitforwindow.nix | |
parent | 6c8210f93ae6715cbf5aa2adfef8bfd6bfc908b2 (diff) | |
parent | a406f014ea148fe11eb2303a4d631678e41bcd6f (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/5pkgs/simple/xwaitforwindow.nix')
-rw-r--r-- | krebs/5pkgs/simple/xwaitforwindow.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/xwaitforwindow.nix b/krebs/5pkgs/simple/xwaitforwindow.nix new file mode 100644 index 000000000..41ce65022 --- /dev/null +++ b/krebs/5pkgs/simple/xwaitforwindow.nix @@ -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 +'' |