Minor code cleanup
Remove unnecessary progress callback
Handle command-line arguments with getopt
Check if XCB connection is valid

Avoids segfaulting if the DISPLAY env var points to an invalid X display.
Improve data injection and error reporting