1
1
Fork
You've already forked waitwinch
0
No description
  • C 83.3%
  • Makefile 16.7%
Find a file
2026年03月12日 11:19:03 +00:00
.clang-tidy Add make check target and fix 1 warning and 1 comment typo 2026年03月12日 11:19:03 +00:00
.gitignore Add simple client program that demonstrates the problem and the solution 2024年05月26日 06:26:44 +01:00
GNUmakefile Add make check target and fix 1 warning and 1 comment typo 2026年03月12日 11:19:03 +00:00
irclog.md Remove uninteresting/unrelated line from irclog.md 2025年01月19日 17:21:39 +00:00
README.md Add a comment about the wwdemo delay argument in README.md 2025年03月05日 12:33:39 +00:00
UNLICENSE Add UNLICENSE file to repo and fix dead link in README.md 2023年11月04日 05:02:40 +00:00
waitwinch.c Update and improve usage/help string 2025年03月19日 05:45:42 +00:00
wwdemo.c Add make check target and fix 1 warning and 1 comment typo 2026年03月12日 11:19:03 +00:00

waitwinch

This utility waits for the arrival of 2 SIGWINCH signals and then executes the specified command.

Rather than trying to explain the intended use case here, I'll simply link to foot issues #904 and #453 and this IRC log.

Like the sleep 0.1 workaround suggested in the issues above, this is somewhat of a hack. However, the benefit of using this method instead of a fixed delay is that it should keep the startup latency to a minimum.

Usage Examples

# Run an app in foot, after first waiting for the arrival of 2 SIGWINCH
# signals (should work in Sway and River)
foot waitwinch tui-app args...
# Run demonstration program in foot, both with and without waitwinch
# (5 is the default number of milliseconds between printing each line)
foot --hold ./waitwinch ./wwdemo 5
foot --hold ./wwdemo 5
# As above, but also printing timing info (-v)
foot --hold ./waitwinch -v ./wwdemo 5

Note: if SIGWINCH doesn't arrive within 150ms, a timeout will expire and the command will be executed anyway. This is to avoid deadlocks in case something unexpected happens.

Usage in foot.ini

# $(command -v ...) is used here so that $SHELL is executed directly
# if waitwinch isn't available in $PATH for whatever reason
shell = sh -c 'exec $(command -v waitwinch) ${SHELL:-sh}'

Installing

First ensure you have a C99 compiler and GNU Make installed, then run the following commands:

git clone https://codeberg.org/craigbarnes/waitwinch.git
cd waitwinch
make && sudo make install

License

Unlicense