awmtt icon indicating copy to clipboard operation
awmtt copied to clipboard

Fix detection of free DISPLAYs

Open tyilo opened this issue 6 years ago • 1 comments

The file /tmp/.X0-lock doesn't exist even though I have a display 0. However the file /tmp/.X11-unix/X0 exists instead.

tyilo avatar Jul 16 '19 15:07 tyilo

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.

J4MMlE avatar Jan 31 '23 17:01 J4MMlE