I would like to create a small bash program that would
monitor my keystroke activity and if no keystrokes are noted
within a fixed small time, then any currently active
internet connection would be disconnected.

I currently use a Knoppix LiveUSB and wifi via a broadband router
with network connections handled by NetworkManager.

If there's 'an app for this' already, then that might also serve.

Thanks in advance.