[bug#56717,v2,2/2] gnu: Add i3-autotiling.
Commit Message
* gnu/packages/python-xyz.scm (i3-autotiling): New variable.
Signed-off-by: Hilton Chain <hako@ultrarare.space>
---
gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
--
2.36.1
Comments
On Sat Jul 23, 2022 at 11:31 AM BST, Hilton Chain wrote:
> + (synopsis
> + "Automatically switch the horizontal/vertical window split orientation in
> + i3 and sway")
I think a synopsis that spills onto multiple lines is probably too long.
How about simply:
(synopsis "Automatically tile windows in i3 and Sway")
> + (description "This script uses the i3ipc-python library to switch the layout
> +splith/splitv depending on the currently focused window dimensions. It works on
> +both sway and i3 window managers.")
Maybe something like:
(description
"This package provides a script that automatically switches the layout
of an i3 or Sway desktop based on the dimensions of the focused window.")
(By the way, that's the standard formatting for a description: the
string is on a new line.)
-- (
On 23-07-2022 12:31, Hilton Chain via Guix-patches via wrote:
> + (arguments (list #:tests? #f)) ;a working X environment is needed to run the tests
You can make a working X environment with "xvfb-run -- the-test-command"
or with (IIRC) "Xvfb :1&" + (sleep 1) (preferably the former, as the
latter is racy) -- search with "git grep -F xvfb-run" or "git grep -F
Xvfb" for examples.
Greetings,
Maxime.
Thanks!
xvfb-run works well, however some "Fontconfig error: No writable cache directories"
occurs. I don't know what to do with this, do you have any ideas?
* Below attaching part of the build log:
---
/gnu/store/65i3nhcwmz0p8rqbg48gaavyky4g4hwk-python-3.9.9/lib/python3.9/selectors.py:469: Failed
---------------------------- Captured stderr setup -----------------------------
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
----------------------------- Captured stderr call -----------------------------
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
------------------------------ Captured log call -------------------------------
ERROR asyncio:base_events.py:1738 Task exception was never retrieved
future: <Task finished name='Task-82' coro=<Connection.command() done, defined at /gnu/store/gwsda4lb70rzazfh0kzx9z3wx5i4z43b-python-i3ipc-2.2.1/lib/python3.9/site-packages/i3ipc/aio/connection.py:503> exception=OSError(107, 'Transport endpoint is not connected')>
Traceback (most recent call last):
File "/gnu/store/gwsda4lb70rzazfh0kzx9z3wx5i4z43b-python-i3ipc-2.2.1/lib/python3.9/site-packages/i3ipc/aio/connection.py", line 514, in command
data = await self._message(MessageType.COMMAND, cmd)
File "/gnu/store/gwsda4lb70rzazfh0kzx9z3wx5i4z43b-python-i3ipc-2.2.1/lib/python3.9/site-packages/i3ipc/aio/connection.py", line 407, in _message
await self._loop.sock_sendall(self._cmd_socket, _pack(message_type, payload))
File "/gnu/store/65i3nhcwmz0p8rqbg48gaavyky4g4hwk-python-3.9.9/lib/python3.9/asyncio/selector_events.py", line 446, in sock_sendall
n = sock.send(data)
OSError: [Errno 107] Transport endpoint is not connected
ERROR asyncio:base_events.py:1738 Future exception was never retrieved
future: <Future finished exception=FileNotFoundError(2, 'No such file or directory')>
Traceback (most recent call last):
File "/gnu/store/gwsda4lb70rzazfh0kzx9z3wx5i4z43b-python-i3ipc-2.2.1/lib/python3.9/site-packages/i3ipc/aio/connection.py", line 383, in do_reconnect
await self.connect()
File "/gnu/store/gwsda4lb70rzazfh0kzx9z3wx5i4z43b-python-i3ipc-2.2.1/lib/python3.9/site-packages/i3ipc/aio/connection.py", line 359, in connect
self._cmd_socket.connect(self.socket_path)
FileNotFoundError: [Errno 2] No such file or directory
On 23-07-2022 13:38, Hilton Chain wrote:
> xvfb-run works well, however some "Fontconfig error: No writable cache directories"
> occurs. I don't know what to do with this, do you have any ideas?
For these kind of things, creating the relevant directory and setting an
environment variable tends to work. Maybe try (setenv "HOME"
(getcwd)))? However, IIUC, these fontconfig errors can usually be
ignored (probably because it's just a cache?), likely the "Transport
endpoint is not connected" test failure is independent.
My guess is that it tries to connect to the WM i3, but that WM is not
running in the build environment fails.
You could give starting the WM before running the test a try, but maybe
it's not worth the effort.
Greetings,
Maxime.
On Sat Jul 23, 2022 at 1:17 PM BST, Maxime Devos wrote:
> For these kind of things, creating the relevant directory and setting an
> environment variable tends to work. Maybe try (setenv "HOME"
> (getcwd)))? However, IIUC, these fontconfig errors can usually be
> ignored (probably because it's just a cache?), likely the "Transport
> endpoint is not connected" test failure is independent.
We got this working on IRC :)
> My guess is that it tries to connect to the WM i3, but that WM is not
> running in the build environment fails.
>
> You could give starting the WM before running the test a try, but maybe
> it's not worth the effort.
Looks like the tests do a popen on i3 themselves:
<https://github.com/altdesktop/i3ipc-python/blob/master/test/ipctest.py#L16>
-- (
v2 -> v3: synopsis and description changes suggested by (
Hilton Chain (2):
gnu: Add python-i3ipc.
gnu: Add i3-autotiling.
gnu/packages/python-xyz.scm | 49 +++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
base-commit: 32a00363435ac8c1bc93ef1281b2c2afc28a8877
--
2.36.1
@@ -30225,3 +30225,29 @@ (define-public python-i3ipc
(synopsis "Python library for controlling i3wm and sway")
(description "An improved Python library to control i3wm and sway.")
(license license:bsd-3)))
+
+(define-public i3-autotiling
+ (package
+ (name "i3-autotiling")
+ (version "1.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/nwg-piotr/autotiling")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1hjlvg7095s322gb43r9g7mqlsy3pj13l827jpnbn5x0918rq9rr"))))
+ (build-system python-build-system)
+ (arguments (list #:tests? #f)) ;a working X environment is needed to run the tests
+ (native-inputs (list python-wheel))
+ (propagated-inputs (list python-i3ipc))
+ (home-page "https://github.com/nwg-piotr/autotiling")
+ (synopsis
+ "Automatically switch the horizontal/vertical window split orientation in
+ i3 and sway")
+ (description "This script uses the i3ipc-python library to switch the layout
+splith/splitv depending on the currently focused window dimensions. It works on
+both sway and i3 window managers.")
+ (license license:gpl3)))