awmtt
awmtt copied to clipboard
Fix detection of free DISPLAYs
The file /tmp/.X0-lock doesn't exist even though I have a display 0.
However the file /tmp/.X11-unix/X0 exists instead.
Because /tmp/.X11-unix/X_ is a socket file, testing for its existence with the -f flag (which tests for regular files) does not work. Either -S (true if file exists and is a socket) or the more generic -e (which tests only for file existence regardless of its type) should be used. Check Bash Conditional Expressions for more information.