GithubHelp home page GithubHelp logo

xpytile's Introduction

xpytile

Tiling and simultaneous resizing of side-by-side windows (theoretically not only) for Xfce.

Purpose

A Python script to auto-tile and to simultaneously resize docked windows for Xfce.

Features:

Simultaneous resizing of adjacent windows
5 different tilers

Hotkeys for:

  • Tiling and/or simultaneous resizing can be enabled/disabled
  • Tiling can be triggered manually on demand
  • Changing tiler
  • Storing and re-creating current windows layout
  • Cycling windows
  • Swap windows
  • Set/unset window decoration
  • and more, see below

The tiler can be controlled remotely.
All settings are workspace specific.
So for each workspace you can choose independently, if tiling is enabled and which tiler should be used.
No limit of supported workspaces
Config-file
Pure Python, easily hackable

New features

Configurable which (CSD) applications should not be (un)decorated.
Hotkey to focus previously active window
Can be controlled remotely.
Dragging a window with the mouse slightly over the left or the top or bottom border of the workspace
triggers a re-tiling. So the window positions can be changed / swapped by dragging a window.
Option to set the mouse-cursor in the middle of the new active window, when changed by hotkey.
    This visual feedback is helpful, especially when the window decoration is turned off.
Focus can be set to next adjacent window, in the direction of the pressed arrow-key
Max. number of tiled windows for the currently active tiler can be increased/decreased per hot-key

Hotkeys

Hotkeys can be defined in the config-file.
Most important hotkeys (full set see config-file):
Super_L - 1         tiler - master and stack vertically
Super_L - 2         tiler - vertically
Super_L - 3         tiler - master and stack horizontally
Super_L - 4         tiler - horizontally
Super_L - 0         tiler - maximize
Super_L - c         cycle tiler
Super_L - 5         restore windows layout
Super_L - 6         store windows layout
Super_L - ^         cycle windows
Super_L - ESC     swap current window with top/left-most window
Super_L - q         toggle simultaneous resizing (on/off)
Super_L - w         toggle tiling (on/off)
Super_L - y         toggle window-decoration (on/off) of tiled windows (*)
Super_L - a         shrink width/height of master window
Super_L - s         enlarge width/height of master window
Super_L - m         increment number of max. tiled windows for active tiler
Super_L - n         decrement number of max. tiled windows for active tiler
Super_L - arrow  focus next adjacent window in the given direction
Super_L - b         focus previously active window
Super_L - .         log name & tile of active window in /tmp/xpytile_<USERNAME>.log
Super_L - -         exit
*) Hint: In XFCE one can resize windows with Alt - Right-Click and drag,
         which is useful when windows-decorations are turned off

Configuration

Well, edit the hopefully self-explanatory config-file xpytilerc

Installation

Place xpytilerc in XDG_CONFIG_HOME in ~/.config/ or in /etc/ respectively
ArchLinux - users can install xpytile-git from the AUR

Start

./xpytile.py
or, to let run in background: nohup ./xpytile.py > /dev/null 2>&1 & You may want to assign a hotkey.
In Xfce for example, add a shortcut to xpytile.py with:
Xfce-Menu -> Settings -> Keyboard -> Application Shortcuts

Dependencies

notify-send (package: notifylib for ArchLinux, libnotify-bin for Debian/Ubuntu)
python3, python-xlib

Bugs

I'm currently not aware of a bug.
However, when the program crashes it writes traceback info in /tmp/xpytile_<USERNAME>.log

License

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses/.

Questions

(Q) Are gaps supported?
(A) Nope, but you could use an Xfce theme with gaps.

(Q) Does xpytile support multiple monitor setups?
(A) On workspaces that span multiple monitors, simultaneous resizing works fine, tiling not really.

(Q) How do I get the exact name and title of a window I want xpytile to ignore?
(A) Run xpyile with -v or -vv or use the hotkey to log name and title of the current window.

(Q) What can I do, xptile isn't picking up my hotkeys?
(A) Run ./getModifierCode.py, press Super_L - 1 (or the modifier you'd like to use)
      and check/edit xpytilerc (line: modifier = )

(Q) I'm running out of hotkeys, what can I do?
(A) xpytile can be controlled remotely, consider making a dmenu or rofi script.

xpytile's People

Contributors

jaywilkas avatar tomaszn 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

xpytile's Issues

Add support for client-side-decoration in XFCE 4.18

Hi,

I'm running Arch with XFCE 4.18 on my old laptop and i really like xpytile! Thank you!
But, there is a problem with client side decorated windows (CSD) like GTK 3/4 (e.g. Firefox):
Bildschirmfoto_2023-05-09_23-09-08

As you can see, the window decoration is server side in tiling mode.

Any ideas how to fix this?

How to disable auto resize of the terminal windows?

I would like to create this specific setup:

  • whenever I launch a new terminal, the terminal should be launched in the upper-left size of my screen, and should not be resized.
  • stack a maximum of 3 windows horizontally, and then move to the next column.

I have tried to modify the config file to achieve this but nothing seems to suit my needs. Is there a way I could configure this behaviour?

some keybindings stop the program

I've changed some keybindings but some keybindings stop the script.

For ex : Super_L + [ and Super_L+]

# increase max number of windows to tile
# 58 "m" 
# 35  bracketright
increaseMaxNumWindows = 35

# decrease max number of windows to tile
# 57 "n"
# 34 "bracketleft"
decreaseMaxNumWindows = 34

The other time when the keybinding stops the program is : when i cycle tilers using Super_L + c
The script stop automatically when it reaches horizontal tiler

Can't grab modifier.

xpytile-git r70.279a499-1 here, getModifierCode.py can't grab any key:

X protocol error: <class 'Xlib.error.BadAccess'>: code = 10, resource_id = 1717, sequence_number = 17, major_opcode = 33, minor_opcode = 0

xpytile spams with similiar repeating strings like:

X protocol error: <class 'Xlib.error.BadAccess'>: code = 10, resource_id = 1717, sequence_number = 29, major_opcode = 33, minor_opcode = 0

Right now I use it like this: kill $(pgrep -f "python /usr/bin/xpytile") || $(nohup xpytile > /dev/null 2>&1) &
configured to one workspace doing its auto tilling magic which is great as it is.

Can I send a signal to it somehow (like in bspwm) beacause I am willing to make a functional menu with rofi and myrmidon: https://github.com/moustacheful/myrmidon

tryied shinglify but it is beyond of simply tiling: https://gitlab.com/corthbandt/shinglify-bin/-/tree/latest

Thanks!

No license

Hiya,
This is a very nifty little tool. It works great in conjunction with XFCE. However I have one minor gripe. There's no license in present in the repository. Could you please at one?

Thanks for your great work!!

Strange Spacing

I have a xfce4-bar on the left. It's odd that it reserves space, but not on the left. It's on the right instead. This makes windows go under the bar and having space at the right where nothing is there.

Ascii char for ctrl+alt or shift+alt

I am trying to run ctrl+alt or shift+alt as my hotkey modifier. getModifierCode.py doesn't register these key combos, also when I run getModifierCode.py I gett the following error:
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 477, sequence_number = 14, major_opcode = 33, minor_opcode = 0

I have searched for the ascii codes for this key combination but not having any luck. Do you know what the decimal number is for key combinations? Also code 64 doesn't work for my SuperL according to ascii in terminal code 64=@.

I have the hotkey modifier set to 18, which is Caps Lock. It works, but I have to constantly check that caps lock is off when I type.

Suggestion: ignore Ulauncher

Hi, thanks for the great script!

Would you mind adding name: "Ulauncher" to the default ignoreWindows? Ulauncher is an application launcher, which appears as a temporary overlayed input box: https://ulauncher.io/.

I think this would benefit a lot of keyboard oriented XFCE users.

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.