Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detection of free DISPLAYs #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tyilo
Copy link

@tyilo tyilo commented Jul 16, 2019

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
Copy link

J4MMlE commented Jan 31, 2023

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