Author Topic: i3 - automatic tiling?  (Read 6131 times)

0 Members and 1 Guest are viewing this topic.

Offline Chrysostomus

  • Maintainer
  • ***
  • Posts: 1634
  • Neckbeards are cool
    • Git
  • Branch: unstable
  • Desktop: Gnome, bspwm
  • GPU Card: Intel HD4000
  • GPU driver: free
  • Kernel: linux44-x64
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #15 on: 09. January 2016, 15:35:08 »
I second the motion, unless split toggle function is released before the next release of i3 edition.

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: i3 - automatic tiling?
« Reply #16 on: 09. January 2016, 16:10:38 »
No, split toggle doesn't do exactly the same, but for all intents and purposes it should be similar enough.

The Python script decides how to split based on width versus height. This means in theory it could open two containers in a row in the same direction, not alternating.

The split toggle command always alternates the current split direction, no matter what.

Which is better depends on preference, I'd assume, but I'd also think that on normal monitors it should be similar enough.

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #17 on: 09. January 2016, 17:08:52 »
I like it! :)
I'll make a manjaro-package and add it to autostart in the edition :)
Thank yall, tinkerers ;D! 8)
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline torvic9

  • Sr. Mitglied
  • ****
  • Posts: 253
  • Hello world!
  • Branch: stable
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #18 on: 09. January 2016, 18:13:30 »
Be aware though that the python script needs the package python-pip, and you have to install the i3 pip with "sudo pip install i3-py".
I think it's a good stop-gap until the toggle split is released.
i3: i7-5820K | 32 GB | GeForce GTX 960, nvidia | linux44-custom
KDE: i7-920 | 12 GB | GeForce GTS 450, nouveau | linux44
Gnome: Thinkpad X200s | linux41

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #19 on: 09. January 2016, 18:45:19 »
I have added python-i3 to the repo aswell which will be pulled in as a dependency by the alternating-layouts package.
Nothing else is required. I am running it fine here now with no python-pip or the likes installed :)
It's available in unstable already!
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline torvic9

  • Sr. Mitglied
  • ****
  • Posts: 253
  • Hello world!
  • Branch: stable
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #20 on: 09. January 2016, 19:24:25 »
Some bad news unfortunately...

Under some circumstances python eats up a whopping 5% of my 6(12)-core CPU, alongside 4% for i3. Normally, both together use only 1% maximum.

It seems that this happens only on empty desktops (workspaces). As soon as a window (container) is opened, the usage falls back to normal.
Maybe a bug in the python script? I don't know much about debugging but more knowledgeable people could have look at it:
Code: [Select]
def main():
    """
        Main function - listen for window focus
        changes and call set_layout when focus
        changes
    """
    process = subprocess.Popen(
        ['xprop', '-root', '-spy'],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
    )
    regex = re.compile(b'^_NET_CLIENT_LIST_STACKING|^_NET_ACTIVE_WINDOW')
    while True:
        line = process.stdout.readline()
        if regex.match(line):
            set_layout()
« Last Edit: 09. January 2016, 19:46:04 by torvic9 »
i3: i7-5820K | 32 GB | GeForce GTX 960, nvidia | linux44-custom
KDE: i7-920 | 12 GB | GeForce GTS 450, nouveau | linux44
Gnome: Thinkpad X200s | linux41

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #21 on: 09. January 2016, 20:15:16 »
Hm. That's bad... And you are right. Here python was up to 25% CPU alone already until I killed the script once. Now it's behaving normally ???
Would you mind filing a bug, torvic9? https://github.com/olemartinorg/i3-alternating-layout/issues
Anyway... Who likes can install it from here now:
Code: [Select]
sudo pacman -U http://repo.manjaro.org.uk/pool/overlay/alternating-layouts-0.0.r20.179edd6-2-any.pkg.tar.xz
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #22 on: 09. January 2016, 20:17:08 »
Btw I am using just
Code: [Select]
exec --no-startup-id alternating_layouts.pywithout the preceeding 'python'
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #23 on: 09. January 2016, 20:40:12 »
I can confirm that the issue only occurs when you are on an empty workspace. As soon as you open a container the script seems to be happy again. ... One could say that it's a limited problem, because normally you are not using an empty workspace... ;) But of course it is possible ... and definitely a bug. :p
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline Airblader

  • Jr. Mitglied
  • **
  • Posts: 93
  • I'm new. Be nice!
  • Desktop: i3-gaps
  • Skill: Advanced
Re: i3 - automatic tiling?
« Reply #25 on: 09. January 2016, 21:44:27 »
I'd assume there's a busy loop. Just throw some debug prints in the script and execute it to see which debug statement is spit out thousands of times when switching to an empty workspace. Might be quicker that way.

Offline torvic9

  • Sr. Mitglied
  • ****
  • Posts: 253
  • Hello world!
  • Branch: stable
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #26 on: 09. January 2016, 21:49:24 »
I sent an email to the dev, as I don't have a github account.
But I see that oberon has already taken care of that ;)
i3: i7-5820K | 32 GB | GeForce GTX 960, nvidia | linux44-custom
KDE: i7-920 | 12 GB | GeForce GTS 450, nouveau | linux44
Gnome: Thinkpad X200s | linux41

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #27 on: 09. January 2016, 21:51:00 »
Can you help with that? How do you do that? I'd like to learn that for the future! :)
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline twodogsdave

  • Jr. Mitglied
  • **
  • Posts: 89
  • Desktop: i3
  • GPU Card: Radeon HD Graphics
  • GPU driver: free
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #28 on: 09. January 2016, 22:49:23 »
Hm. That's bad... And you are right. Here python was up to 25% CPU alone already until I killed the script once. Now it's behaving normally ???
Would you mind filing a bug, torvic9? https://github.com/olemartinorg/i3-alternating-layout/issues
Anyway... Who likes can install it from here now:
Code: [Select]
sudo pacman -U http://repo.manjaro.org.uk/pool/overlay/alternating-layouts-0.0.r20.179edd6-2-any.pkg.tar.xz

I followed the above procedure and got an error..

Code: [Select]
dave  ~  >  sudo pacman -U http://repo.manjaro.org.uk/pool/overlay/alternating-layouts-0.0.r20.179edd6-2-any.pkg.tar.xz
[sudo] password for dave:
 alternating-layouts-0.0...  1912.0   B   133K/s 00:00 [############################] 100%
 alternating-layouts-0.0...   287.0   B  0.00B/s 00:00 [############################] 100%
loading packages...
resolving dependencies...
warning: cannot resolve "python-i3", a dependency of "alternating-layouts"
:: The following package cannot be upgraded due to unresolvable dependencies:
      alternating-layouts

:: Do you want to skip the above package for this upgrade? [y/N]
error: failed to prepare transaction (could not satisfy dependencies)
:: alternating-layouts: requires python-i3


So, I thought I'll manually install python-i3, so I did..

Code: [Select]
yaourt python-i3

and got..

Code: [Select]
1 aur/python-i3-git r156.27f88a6-3 (15)
    Tools for i3 users and Python developers
==> Enter n° of packages to be installed (ex: 1 2 3 or 1-3)
==> -------------------------------------------------------

python-i3-git is not the same as python-i3, correct?

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: i3 - automatic tiling?
« Reply #29 on: 09. January 2016, 23:18:56 »
Ah, sorry, sure! ::)
First you need
Code: [Select]
sudo pacman -U http://repo.manjaro.org.uk/pool/overlay/python-i3-0.0.r156.27f88a6-1-any.pkg.tar.xz
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin