Skip to content

Fix detection of free DISPLAYs#11

Open
tyilo wants to merge 1 commit into
gmdfalk:masterfrom
tyilo:patch-1
Open

Fix detection of free DISPLAYs#11
tyilo wants to merge 1 commit into
gmdfalk:masterfrom
tyilo:patch-1

Conversation

@tyilo

@tyilo tyilo commented Jul 16, 2019

Copy link
Copy Markdown

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

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

J4MMlE commented Jan 31, 2023

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants