Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-06-09 17:01:23

jaywilkas
Member
Registered: 2021-06-05
Posts: 13

xpytile - auto. tiling & simultaneous resizing of adjacent windows

Hi all,

I have been working on a little project, a tiling helper for Xfce
and could imagine perhaps it might be helpful to others as well.

https://github.com/jaywilkas/xpytile/


xpytile
Tiling and simultaneous resizing of side-by-side windows for Xfce.


Features:
Simultaneous resizing of adjacent windows
Automatic tiling and tiling on demand
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

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

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 - 5   restore windows layout
Super_L - 6   store windows layout
Super_L - ^   cycle windows
Super_L - q   toggle simultaneous resizing (on/off)
Super_L - w   toggle tiling (on/off)
Super_L - a   shrink width/height of master window and (re-)tile
Super_L - s   enlarge width/height of master window and (re-)tile
Super_L - .   log name & title of active window in /tmp/xpytile_<USERNAME>.log
Super_L - -   exit

Questions, comments and other feedback are welcome.

Offline

#2 2022-07-15 17:51:28

Aprendiz2040
Member
Registered: 2022-07-15
Posts: 2

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

hello! is it only for arch and derivatives? In Mx linux 21.1 xfce (debien 11 stable) I can't install it, I can't find some dependencies indicated in the README. If you can guide me I would really appreciate it! It is a super necessary and productive function! Thank you

Offline

#3 2022-07-15 20:02:57

jaywilkas
Member
Registered: 2021-06-05
Posts: 13

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

It shouldn't be a problem, the script is not specifically for Arch or Arch based distros.

Dependencies:
  You need Python3 and all the imported libraries (argparse, configparser, datetime, functools,
                                                                        os, re, shutil, socket, subprocess, sys, time)
                                                                        and python-xlib
                       plus  notify-send   (package: notifylib for ArchLinux,  libnotify-bin for Debian/Ubuntu)

Last edited by jaywilkas (2022-07-17 07:28:55)

Offline

#4 2022-07-16 15:06:31

jaywilkas
Member
Registered: 2021-06-05
Posts: 13

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

@Aprendiz2040  see PM

Offline

#5 2022-07-16 21:42:56

Aprendiz2040
Member
Registered: 2022-07-15
Posts: 2

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

Hello again! Thank you very much for taking the time to respond! My English is from google translator. I'm trying to install the dependencies, now on Linux mint 20.3 (ubuntu 20.04) for compatibility I think:
"sudo apt install notify-send notifylib-bin python-xlib", but I get this message:
view?usp=sharing
https://drive.google.com/file/d/1CUcYfX … sp=sharing

I download and extract xpytile-main, and place it in "~/.config/xpytile-main". Then I go into the "xpytile-main" folder:
view?usp=sharing
https://drive.google.com/file/d/18teCiD … sp=sharing

Then I open the terminal there, and run "./xpytile.py" and get this message:
view?usp=sharing
https://drive.google.com/file/d/1fe7M_X … sp=sharing

I'm doing something wrong, that's clear, I already installed python3, python3.9, which installs many things. And "notifylib-bin" is not in debian packages nor in ubuntu packages, will it have another name?

Thanks again for answering! I hope you see the images, I don't know if I use "[img]and[/img]" correctly.

Thank you very much!

Offline

#6 2022-07-17 03:12:07

KBar
Moderator
Registered: 2021-11-05
Posts: 612

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

Aprendiz2040 wrote:

Thanks again for answering! I hope you see the images, I don't know if I use "[img]and[/img]" correctly.

You did but please use code tags in the future. They 1) allow you to share terminal output and code right in the reply box; 2) are built in and do not send to third-party sites; 3) contain only text that can be indexed for searching. For instructions, click on BBCode below your reply box.

And "notifylib-bin" is not in debian packages nor in ubuntu packages, will it have another name?

On Debian-based systems, It should be libnotify-bin.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#7 2022-07-17 10:17:23

jaywilkas
Member
Registered: 2021-06-05
Posts: 13

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

According to your last link / picture, it seems that you don't have installed python.
If so, first install python3 and python3-pip.
Then install the imported libraries (argparse, configparser, datetime, functools, os, re, shutil, socket, subprocess, sys, time).

Also install the Debian package libnotify-bin (which includes notifiy-send).

Offline

#8 2022-08-13 16:25:29

Takeshikari
Member
Registered: 2022-08-13
Posts: 2

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

I tried to install xpytile.

I installed libnotify-bin (Debian) but I have trouble to install the imported libraries (argparse, configparser, datetime, functools, os, re, shutil, socket, subprocess, sys, time).

With

pip install functools

I got a long error message

Defaulting to user installation because normal site-packages is not writeable
Collecting functools
  Using cached functools-0.5.tar.gz (4.9 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: functools
  Building wheel for functools (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [87 lines of output]

....

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for functools
  Running setup.py clean for functools
Failed to build functools
Installing collected packages: functools
  Running setup.py install for functools ... error
  error: subprocess-exited-with-error

....

  × Running setup.py install for functools did not run successfully.
  │ exit code: 1
  ╰─> [89 lines of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> functools

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Additional I got errors with os, re shutil socket, subprocess, sys, time.

pip install re
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement re (from versions: none)
ERROR: No matching distribution found for re

The error messages are identical for all other mentioned libraries.

I use Python 3.10

$ python --version
Python 3.10.6

Last edited by Takeshikari (2022-08-13 16:26:13)

Offline

#9 2022-08-13 22:21:12

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 746

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

@jaywilkas those modules are included with Python.  pip does not provide them.

Offline

#10 2022-08-13 23:39:17

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 746

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

can you provide screenshots, and maybe also a video of usage, for xpytile?  is there anything more a Python programmer do with xpytile?

Offline

#11 2022-08-14 19:58:47

Takeshikari
Member
Registered: 2022-08-13
Posts: 2

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

~/.config/XDG_CONFIG_HOME]
$ bash xpytile.py 
xpytile.py: Zeile 23: 
X-tiling helper
with simultaneous resizing of docked (side-by-side) windows


Copyright (C) 2021  jaywilkas  <just4 [period] gmail [at] web [period] de>

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/>.
: Datei oder Verzeichnis nicht gefunden
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
xpytile.py: Zeile 28: from: Kommando nicht gefunden.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: unable to open image `time': Keine Berechtigung @ error/blob.c/OpenBlob/2924.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
xpytile.py: Zeile 40: Syntaxfehler beim unerwarteten Symbol »(«
xpytile.py: Zeile 40: `class _list(object):'

Here is a screenshot:
  h6A6hYZ.png

Offline

#12 2022-08-20 18:41:10

jaywilkas
Member
Registered: 2021-06-05
Posts: 13

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

Don't call a python script via bash like you did

bash scriptname.py # the wrong way

A python script must be called like so: 

scriptname.py

or

python scriptname.py

Besides, it doesn't make sense to create an XDG_CONFIG_HOME sub-directory.
XDG_CONFIG_HOME is an envirionment variable.
Perhaps read this article: https://specifications.freedesktop.org/ … atest.html

Last edited by jaywilkas (2022-08-20 19:06:27)

Offline

#13 2022-08-21 00:23:19

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 746

Re: xpytile - auto. tiling & simultaneous resizing of adjacent windows

but if you really really Really REALLY do want to use bash to run a Python script, at least use the correct syntax:

bash -c "python3 scriptname.py"

Offline

Board footer

Powered by FluxBB