The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

Is there a way to read the i3 configuration from stdin?

asked 2013-09-22 22:58:49 +0000

whatevsz gravatar image

As I generate my configuration file for i3 on every startup, it would be very convenient to read it directly from stdin instead of writing into a temporary file and passing it as a parameter to i3.

So far i tried

  • command | i3 ; Reads the default configuration file (as expected).

  • command | i3 - ; Passes the content of the file as additional arguments.

  • command | i3 -c - ; Interprets "-" as a path, which obviously fails.

  • i3 -c <(command) ; Produces error message "i3: Could not lseek: Illegal seek".

I found nothing on google and on this page, so I wonder if there is a way to read the configuration from stdin. Did i overlook anything obvious?

edit retag flag offensive close merge delete

Comments

Did you try `i3 $(yourcommand)`?

uzsolt gravatar imageuzsolt ( 2013-09-25 07:25:42 +0000 )edit

Well, this would just send the output of `yourcommand` as parameters to i3 as far as I know.

whatevsz gravatar imagewhatevsz ( 2013-09-25 20:09:51 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-09-25 16:11:17 +0000

Michael gravatar image

No (as of v4.6), since i3 does a two-pass read of the configuration file to replace variables. That is where the lseek error message is coming from. In case you want to contribute patches to make it work (without making everything overly complex), feel free to submit them at http://cr.i3wm.org/

edit flag offensive delete link more

Comments

Ok, thank you for your answer. I might look into the codebase once I got a bit more time.

whatevsz gravatar imagewhatevsz ( 2013-09-25 20:12:03 +0000 )edit

Question Tools

Stats

Asked: 2013-09-22 22:58:49 +0000

Seen: 111 times

Last updated: Sep 25 '13