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

i3-msg socket path should follow i3 default socket path #1579

Closed
jirib opened this issue Mar 24, 2015 · 5 comments
Closed

i3-msg socket path should follow i3 default socket path #1579

jirib opened this issue Mar 24, 2015 · 5 comments
Labels
missing-log Read the CONTRIBUTING.md file for instructions missing-version

Comments

@jirib
Copy link

jirib commented Mar 24, 2015

Hello,
I use i3-msg from outside of X11 env, thus i3-msg doesn't find socket path info from X11 root window, IIUC.

i3-msg: Could not connect to i3 on socket "/tmp/i3-ipc.sock": No such file or directory

Thus it would be nice if i3-msg would use i3 default socket path by default, so I do not need to to explicitly define it.
(i3-msg runs OK when executed from X11 env, but I talk for example about scripts running from cron etc. using i3-msg).
Thanks!

Version: i3-4.8p3 / OpenBSD 5.7 snapshot 2015-03-18
Reproduce steps: log into console (not X11 env) and for example do i3-msg "exec /usr/bin/touch /tmp/test"

@i3bot
Copy link

i3bot commented Mar 24, 2015

I don’t see a link to logs.i3wm.org. Did you follow http://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@i3bot i3bot added missing-log Read the CONTRIBUTING.md file for instructions missing-version labels Mar 24, 2015
@i3bot
Copy link

i3bot commented Mar 24, 2015

I don’t see a version number. Could you please copy & paste the output of i3 --version into this issue?

@jirib jirib changed the title i3-msg socket path should follow i3 defaults i3-msg socket path should follow i3 default socket path Mar 24, 2015
@acrisci
Copy link
Member

acrisci commented Mar 24, 2015

I would be weary of this change because it seems like too much guessing. If i3 is not running on the display, or if there is no display, I think an error is appropriate. Keep in mind that there could be any number of i3 processes running at one time.

The best way to do this is to find your display env variable:

echo $DISPLAY

It's probably something like :0. Then in your script:

DISPLAY=:0 i3-msg focus left

and that should work fine.

@jirib
Copy link
Author

jirib commented Mar 24, 2015

Sorry but the purpose of socket communication is just that - use the socket. Why would I need to know DISPLAY if I want to use socket? That doesn't make much sense.
From man i3:

/tmp/i3-%u.XXXXXX/ipc-socket.%p by default

OK, valid point is there could be more i3 instance of the one user. Thus I'm closing this bug as I overlooked that "external" i3-msg cannot know which instance it wants to talk, that's why there's XXXXXX in the socket path.
Sorry for the noise.

@jirib jirib closed this as completed Mar 24, 2015
@jirib
Copy link
Author

jirib commented Mar 24, 2015

Ah, got it about DISPLAY :) One discovers everyday some new things, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing-log Read the CONTRIBUTING.md file for instructions missing-version
Projects
None yet
Development

No branches or pull requests

3 participants