Nwg-autotiling questions

Hi!
A little while ago I saw a mention of autotiling (nwg) for i3 and sway and I thought that was a great idea! I am now trying it out in i3-gaps and itś working as it should most of the time.
It stops working now and then and I am trying to find out when and if there is anything to do about it. I am not sure but guessing that after an edit in config and restarting config and/or restarting i3 it stops working. Is there anything I can do to stop that from happening. Its just a minor obstacle, no biggie.

womp

I use i3 hardly ever, as it sucks on my triple-headed setup, so I don’t really know how the script behaves there. To learn what’s happening, you could start autotiling from terminal with the --debug flag, and see the output.

autotiling -d

Thanks for answer!
Found out that it’s when I restart i3-gaps that it stops working. I just restart it from terminal. No biggie. I will now go further and set up sway with autotiling.

womp

It would be also possible to run it as a systemd service to keep it alive. If you want, I could dig into it.

2 Likes

Yeah!
If you can find the time and spirit for it!?
Or “daemonize”?

womp

I’m not an expert, but it may probably look similar to this:

2 Likes

Great! I will try it out later on today! Holiday’s coming up!

womp

2 Likes

@womp This may be your solution:

  1. remove autotiling from your i3 config
  2. save the lines below as /usr/lib/systemd/user/autotiling.service
[Unit]
Description=Automatically switch window split orientation in sway/i3
PartOf=graphical-session.target
After=graphical-session.target

[Service]
Type=simple
ExecStart=/usr/bin/autotiling
Restart=always

[Install]
WantedBy=graphical-session.target

Enable and start the service:

systemctl --user enable autotiling.service
systemctl --user start autotiling.service

This should restart autotiling whenever it dies.

3 Likes

Of course, if it isn’t set in your config to reload when i3 does then it will never restart.

2 Likes