Giter VIP home page Giter VIP logo

autotiling's Introduction

Hi, I’m Piotr - a middle-aged clerk and after-hours FOSS developer. I’m interested in Linux, Wayland & GTK.

  • I use sway and Hyprland on Arch Linux;
  • I have been working on the GTK shell for sway and Hyprland called nwg-shell;
  • I prefer python to shell scripting and golang to C.

How to reach me:

  • Join the nwg-shell Discussions, or
  • submit an issue on GitHub on the appropriate project page, or
  • find me in the nwg-shell Matrix space, or
  • drop me a line by email.

Do not invite me to a live chat, unless you have diction like sir John Vincent Hurt. I'm quite useless at listening to English.

If you'd like to buy me a coffee, you may use GitHub Sponsors (link in the left column) or Liberapay:

Donate using Liberapay

autotiling's People

Contributors

0-kala-0 avatar alpheratz0 avatar ammgws avatar dpgraham4401 avatar erikreider avatar josch avatar joseconseco avatar lqp1 avatar morten-b avatar mtshrmn avatar nschloe avatar nwg-piotr avatar syphdias avatar tmpecho avatar travankor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autotiling's Issues

expose width/height factor

It would be great to have parameter for width/height ratio like so:
new_layout = "splitv" if con.rect.height > **fac***con.rect.width else "splith"
With this set to, for example, 1.5 - auto-tile we would have wider windows, before they would be split in top/down. When coding, I prefer my windows to be slightly wider than tall.

Moving containers become stuck

Testing autotile on the latest sway+wlroots git, I noticed that moving containers with the keyboard sometimes will be broken (moving containers with mouse still works). The only way to be able to move containers again is to kill the autotile script when this happens. Not sure how this happens exactly, but wanted to ask if anyone knows.

Running the manual version in case that's relevant.

Python Error when starting the script with Python 3.11

This error is shown when I run autotiling on Manjaro Linux (up to date) with Python 3.11.3:

Traceback (most recent call last):
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 563, in from_name
    return next(cls.discover(name=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/autotiling", line 33, in <module>
    sys.exit(load_entry_point('autotiling==1.8', 'console_scripts', 'autotiling')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/autotiling", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 981, in distribution
    return Distribution.from_name(distribution_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 565, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for autotiling

Autotiling does not start with sway but starting from terminal

Hi
Just installed autotiling. Added it to config and it does not start with session.
When I'm starting it from terminal, it works properly.
openSUSE Tumbleweed here.
Autotiling installed via pip but it also does not start installed manually.

#edit
Nevermind... It just started, ehh...

Can no longer move containers laterally between halves of screen

If I have my splits like so and try to move the bottom right container leftward,

|     |     |
|     |_____|
|     |\\\\\|
|     |\\\\\|

I get this and the container becomes stuck and can't be moved leftward any further

|   |\\\|   |
|   |\\\|   |         (Actual)
|   |\\\|   |
|   |\\\|   |


|     |     |
|_____|     |         (Desired)
|\\\\\|     |
|\\\\\|     |

I'm using sway 1.6, wlroots 0.13, and the autotiling script manually copied from repo

Please update the version on PyPI

I am the maintainer of the FreeBSD port of this package.

On FreeBSD, we prefer to draw Python packages from PyPI. Unfortunately, the autotiling package is still on 1.8 over there. Please check if you can upload the newest version of the package to PyPI.

Script not working properly on ultrawide monitors?

hello,

i'm using 2 ultrawide monitors and tried to use autotiling with sway, but the container never starts vertical splitting until a third column is opened, even when i run it with --limit 2. i'm assuming this has something to do with how the script determines when to split based on width/height, and the extra width of an ultrawide monitor probably messes that up. is there anything that can be done to solve that? i do use dynamic tilers to solve this, but i still love i3/sway as well, but the manual tiling is killing me lol.

The license_file parameter is deprecated, use license_files instead.

Hi,

I'm currently packaging autotiling for Debian and I saw this in my build log:

I: pybuild base:311: python3.11 -m build --skip-dependency-check --no-isolation --wheel --outdir /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11  
* Building wheel...
/usr/lib/python3/dist-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
!!

        ********************************************************************************
        The license_file parameter is deprecated, use license_files instead.

        This deprecation is overdue, please update your project and remove deprecated
        calls to avoid build errors in the future.

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

!!
  parsed = self.parsers.get(option_name, lambda x: x)(value)

Wrong manual install instructions and AUR package

Manual install is not possible according to instructions because of #14

==> Checking for dependencies
==> Making package: autotiling-git r64.126c07d-1 (Ne 23. srpna 2020, 00:15:53)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating autotiling git repo...
Fetching origin
==> Validating source files with md5sums...
    autotiling ... Skipped
==> Extracting sources...
  -> Creating working copy of autotiling git repo...
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
install: cannot stat 'autotiling.py': No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...

Problem moving windows after opened (using i3-gaps, 4.18)

Thanks for your work!

I have one little problem that all the others auto tiling scripts have: if I open a window, I have to press twice to move the window horizontally.

I'm using i3-gaps, 4.18.

Example in a clean workspace:

  • Open window 1
  • Open window 2
  • They both open aside each other
|----------------| 
|        |       |
|   1    |  2    |
|        |       |
|----------------|
  • Now, try to move window 2 to the left
  • It doesnt move
  • Try again and it moves

Could you try to reproduce this? Maybe it has to do with some of my configuration.

First three containers opened are vertical

I made some themes for sway with a script: https://github.com/indicozy/sway-dotfiles-script

And only on a MacOSBigSur theme, there is an issue with managing containers, image explains itself:

screenshot-2021-05-10-00-51-57

I checked it with every other theme and it worked fine. This issue is created only in this specific config. I will test that on my Linux Virtual Machine and will report any issue later.

How to replicate: Just download my script (or MacOSBigSur config) and try it yourself

Can't make a manual install of autotiling anymore

Hello!

I'm not sure since when, but I noticed my autotiling setup was not starting anymore. Here's how I setup it:

  • clone the repo
  • start main.py using python3 interpreter.

I manually tried to run it, and here's what it says:

python main.py       
Traceback (most recent call last):
  File "main.py", line 21, in <module>
    from .__about__ import __version__
ImportError: attempted relative import with no known parent package

Could it be related to #14? I'm not sure how to workaround it?

If it's not possible anymore, can you update the README for future users please?

Thanks in advance for you inputs.

Br

(sway) Incorrectly determines container as fullscreen

Lately I've found that autotiling isn't working in some situations. For example right now I have two monitors, with Firefox open on one workspace and a terminal open in the other. Opening some terminals on the Firefox workspace results in autotiling working correctly. However on the other workspace, autotiling does not work at all.

I added some extra debug output code to further investigate and found that non-fullscreen containers are being incorrectly flagged as being fullscreen. The screenshot shows 3 vertical containers side by side, and autotiling is reporting each of them as fullscreen:
image

I will look into it a bit further and possibly submit a patch.

importlib.metadata.PackageNotFoundError: autotiling

autotiling fails to execute after updating. autotiling-git-r97.dbdbfa1-1 version works.


 ~  autotiling
Traceback (most recent call last):
  File "/usr/bin/autotiling", line 33, in <module>
    sys.exit(load_entry_point('autotiling==1.6', 'console_scripts', 'autotiling')())
  File "/usr/bin/autotiling", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: autotiling
yay -Qi autotiling
Name            : autotiling
Version         : 1.6-2
Description     : Script for sway and i3 to
                  automatically switch the horizontal /
                  vertical window split orientation
Architecture    : x86_64
URL             : https://github.com/nwg-piotr/autotiling
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : python-i3ipc
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 18.50 KiB
Packager        : Chaotic-AUR Wild Bear Node
                  <[email protected]>
Build Date      : Mon 13 Dec 2021 06:39:28 IST
Install Date    : Mon 13 Dec 2021 11:33:05 IST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Feature-request: Flip existing layout when moving workspace to output in different orientation

When spawning new containers, this project accounts for the output dimensions which are present at that given time.

What I miss is autotiling 'reorienting' or rather flipping the configuration when moving a workspace from a workspace that is wide to one that is tall.

I'm not sure if this is a known bug or just behaviour that I experience, but the default binding for i3wm; bindsym $mod+e layout toggle split, does not flip the current container orientation when pressed after installing autotiling.

Interestingly, in0ni mentioned this recently: #20 (comment)

Breaks stacking and tabbed layouts on Sway 1.5.1

First of all, I have been looking for this solution and it works great! Thank you.

Though I've noticed that while this script is running, I am unable to switch layouts using my key bindings. Even after killing the script I can't get it to work. I have to comment exec autotiling and restart sway in order for these layouts to work.

I've tested both versions 1.1, and autotiling-git (aur). I am running sway 1.5.1. Any additional information I could provide, or help please let me know.

Thanks again :)

autotiling executable: permission denied

Linux noob here, running Mint 20.3.

I moved the main.py into my /usr/bin directory and renamed it 'autotiling.' i set my i3 config file to exec_always --no-startup-id autotiling, but my windows still load the old way. When I type in 'autotiling' into my terminal, it tells me "Permission denied." I have the i3ip-python dependency already installed. Not sure what I'm doing wrong here.

autotiling from i3 config

Am using autotiling under i3 in Arch I run it as per README but I am wondering if I need '&' at end of command to background it?

Have noticed that it was not working correctly recently until I added '&'

Is this correct or am I running command incorrectly?

Keybinding to cycle through all windows of a workspace

New to sway, used i3 briefly in the past but prefer dynamic tiling. This script gives me almost everything I need, except I can't figure out a way to get a key binding that just cycles focus through all windows of the current workspace. The focus prev|next [sibling] doesn't work like I want, I don't care about containers or stacks or whatever. I just want to cycle focus, in the forward and backward direction, through ALL windows of the workspace. If this isn't possible by default in sway (as I suspect), would it be something you'd be willing to implement here?

Thanks for making sway usable ;)

Cant Chnage Layout To Tabbed Or Stacking

im using i3, and i dont know if this is an intended feature, but after installing autotiling, i cant execute the layout command at all, this may be another issue tho.

Override autotiling

Looks great! I think 90% of the time this is what I would want it to do.

But when I sometimes to want e.g. 6 vertical terminals below each other visibly... how could I achieve it?

Resizing window doesn't update autotiling

Steps to reproduce:
(lets assume we have a regular monitor of 16x9 resolution)

  1. open new window A
  2. open new window B (we now have two windows side by side with the width of 8 and a height of 9)
  3. resize window B to be of width 10 (and a height of 9)
  4. open new window C

Current behavior - window C opens in a horizontal configuration
Expected behavior - window C should open in a vertical configuration

This is happening because when resizing a window the event Event.WINDOW_FOCUS doesn't fire. There's no resize event in the API for a simple solution. Therefore I was able to "hack" it by adding another listener for the Event.TICK event and firing this event each time I resize a window.

NOTE: This was tested on i3-gaps, but I assume it's no different in i3 or sway.

i3 config snippet:

bindsym $mod+r resize set width 927 px; exec --no-startup-id i3-msg -t send_tick

source code manipulation:

diff --git a/autotiling/main.py b/autotiling/main.py
index 896034b..fae9164 100644
--- a/autotiling/main.py
+++ b/autotiling/main.py
@@ -114,6 +114,7 @@ def main():
     handler = partial(switch_splitting, debug=args.debug, workspaces=args.workspaces)
     i3 = Connection()
     i3.on(Event.WINDOW_FOCUS, handler)
+    i3.on(Event.TICK, handler)
     i3.main()

I'm submitting this issue because my solution is bad and hopefuly someone can find a better one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.