You are not logged in.

#26 2025-08-13 08:46

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,106
Website

Re: TDE: Keyboard Binding for Window Tiling

theasmitkid wrote:

@q4osteam could you please move unrelated messages from this thread ...

It may be better you would edit and maintain the OP continuously to keep it updated. We will consider moving some posts, but it's difficult without consent of posters.

Offline

#27 2025-08-15 20:18

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

Tiler v3 Released — Pure Python, No External Tools, Even Faster

The next major version of Tiler is here!
This is a full internal overhaul that strips away every external CLI dependency, replacing them with direct X11 protocol calls via `python-xlib`. The result? Even faster tiling, zero flicker, and complete control without relying on helper programs.


What's New in v3
  • Direct Xlib control — Instead of calling `xdotool` or `wmctrl`, Tiler now moves and resizes windows directly by talking to the X server. No process-spawning overhead, no parsing command output.

  • No window state restore step — In v2, `wmctrl` was used to “unmaximize” before resizing, because EWMH-compliant WMs wouldn’t allow size changes on maximized windows. In v3, we bypass that limitation by setting the exact geometry directly via Xlib — the WM simply applies it without toggling states.

  • Fewer moving parts — No `xdotool`, no `wmctrl`, no `xwininfo`, no `xdpyinfo` — the only runtime dependency is `python3-xlib`.

  • Same fast FIFO interface — The daemon still listens on `~/.tiler.sock` for instant commands from `tiler.sh` or any script.

  • Still small & efficient — Minimal memory use, sleeps idle until a command is received, and executes tiling instantly.

---

Compatibility with v2

* The control interface is unchanged — `tiler.sh` from v2 works out of the box.
* Autostart setup is identical.
* All six actions (`center`, `fullscreen`, `left`, `right`, `up`, `down`) behave the same — just faster and smoother.

---

Troubleshooting
  • Nothing happens? Ensure `python3-xlib` is installed and the daemon is running.

  • Socket not found? Run `~/bin/tilerd` manually to start it.

  • Errors? Run the daemon in a terminal to see detailed Python tracebacks.

Feedback

This is the biggest leap forward since Tiler moved from shell to Python in v2. It’s leaner, faster, and has no dependency chain to break. I’m especially interested in feedback from users on niche or less-common WMs to see just how wide v3’s compatibility now runs.

– theasmitkid


Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

#28 2025-08-17 23:58

seb3773
Member
From: France
Registered: 2023-11-01
Posts: 228

Re: TDE: Keyboard Binding for Window Tiling

The v3 version of your tiler daemon is very good indeed ! Great work you made!!

I couldn't resist to code an optimized c version tongue

As we discuss, it doesn't improve performance (well, it does in fact, but it's difficult to measure) but there's one thing that matters to me: it uses much less memory. The cpython compiler use around 20–25 Mo at least, and python-xlib is 100% python, which is a bit heavy too. So, I think the python version needs around 25–40 Mb for the inactive daemon.
This loop: select.select([fifo], [], [], 1) implies a wake every second. (so there's a little cpu "cost")

The c version is 0% CPU measurable at idle, and use around 2Mb. It uses the same loop select() every seconds, but the overhead is nearly =0 (some us seconds maybe).

Of course, it's a bit more difficult to maintain, but it's a simple c code after all, so modifying it is not a problem for me smile

About the tiler.sh script, as we check the argument passed in the program, there is no real need for more code than:

#!/bin/sh
echo "$1" > "$HOME/.tiler.sock"

I'm using it right now, and it works very well !

Thanks again for your work, this is an ingenious piece of code you made smile

(I joined my c code if you're interested, and the binary if you want to test smile   )

Last edited by seb3773 (2025-08-18 00:03)


Attachments:
c tilerd.c, Size: 4.59 KiB, Downloads: 178
tilerd, Size: 5.83 KiB, Downloads: 289
sh tiler.sh, Size: 42 B, Downloads: 279

Debian & Q4OS (TDE!!), low-level C, ASM (z80/68k/x86/ARM64), embedded systems, CPU architectures (RISC-V, binary formats, assembly), retro-computing, metal music, guitar and sci-fi.

Offline

#29 2025-08-18 00:20

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

thanks!

once again, using c right now considering the current feature-set might prove to be lighter~

for me, tilerd (python) is using 9MB ram and 0.0% cpu on idle and 9MB ram and 0.6% cpu when running a command

i am using fifo right now because it is the only way i know right now and i will try and optimize and add more features in future versions

for current versions of tilerd, @seb3773's c version is great so do try it out. Use the original post instructions if you need to setup keyboard binding and stuff

would add automatic keyboard bindings settings in future versions so stay tuned wink


Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

#30 2025-08-18 17:20

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

@seb3773 can you check if tiler is working for qpdfview? i've tester tiler and also xdotool but cant get it working properly for only qpdfview on my machine


Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

#31 2025-08-18 17:53

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

Minor Release v3.1 Out

(i changed the sign while testing and forgot to revert it before releasing tongue)
to improve the tiling logic, changed

if geom["width"] <= half_width and geom["ancestor_x"] == x_new and geom["height"] <= half_height or geom["height"] == full_height:
    y_new = 0
    h_new = full_height

to

if geom["width"] <= half_width and geom["ancestor_x"] == x_new and geom["height"] >= half_height or geom["height"] == full_height:
    y_new = 0
    h_new = full_height

Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

#32 2025-08-19 15:03

seb3773
Member
From: France
Registered: 2023-11-01
Posts: 228

Re: TDE: Keyboard Binding for Window Tiling

theasmitkid wrote:

@seb3773 can you check if tiler is working for qpdfview? i've tester tiler and also xdotool but cant get it working properly for only qpdfview on my machine

Yes working right (I'm using the c version, but if you want I can try the python version too)


theasmitkid wrote:

Minor Release v3.1 Out

I'll update the C code when I get back from work tonight wink


Debian & Q4OS (TDE!!), low-level C, ASM (z80/68k/x86/ARM64), embedded systems, CPU architectures (RISC-V, binary formats, assembly), retro-computing, metal music, guitar and sci-fi.

Offline

#33 2025-08-20 05:25

seb3773
Member
From: France
Registered: 2023-11-01
Posts: 228

Re: TDE: Keyboard Binding for Window Tiling

Here it is wink
+One little bonus: I thought "fullscreen" could be a toggle function, so I made a small change to make it one. It seems to be working, let me know what you think.

We can actually "optimize" the shell script a bit more (:-p) by using printf, which is a built-in command and therefore faster than calling echo. (Again, this is probably completely imperceptible, but it's good to know. ^^)

Last edited by seb3773 (2025-08-20 05:27)


Attachments:
c tilerd.c, Size: 5.63 KiB, Downloads: 180
tilerd, Size: 6.38 KiB, Downloads: 282
sh tiler.sh, Size: 42 B, Downloads: 313

Debian & Q4OS (TDE!!), low-level C, ASM (z80/68k/x86/ARM64), embedded systems, CPU architectures (RISC-V, binary formats, assembly), retro-computing, metal music, guitar and sci-fi.

Offline

#34 2025-08-20 11:07

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

seb3773 wrote:
theasmitkid wrote:

@seb3773 can you check if tiler is working for qpdfview? i've tester tiler and also xdotool but cant get it working properly for only qpdfview on my machine

Yes working right (I'm using the c version, but if you want I can try the python version too)

Please do check out the python version too, i think it's a twin config issue on my machine so I just wanna make sure..

seb3773 wrote:

Here it is wink
+One little bonus: I thought "fullscreen" could be a toggle function, so I made a small change to make it one. It seems to be working, let me know what you think.

We can actually "optimize" the shell script a bit more (:-p) by using printf, which is a built-in command and therefore faster than calling echo. (Again, this is probably completely imperceptible, but it's good to know. ^^)

Looks good! I think I'll move to c++ for this too, and add it as an python extension for gui based features in future


Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

#35 2025-09-03 23:10

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

Xakar v4 Released — Native C++17, Multi-Monitor Smart Tiling

The fourth generation of my tiling daemon is here! 
[v3] was Python, but [v4] is a full rewrite in modern C++17 using direct Xlib and Xinerama
No interpreter overhead, no shell wrappers, no flicker — just raw speed, smarter logic, and seamless multi-monitor awareness. 

---

What's New in v4
  • Pure C++17 implementation — replaces the Python core from v3.x with optimized, compiled C++17 code.

  • Direct Xlib/Xinerama — zero runtime dependencies beyond `libX11` and `libXinerama`.

  • Massive memory savings — ~1.3 MB RSS vs ~15 MB in v3’s Python daemon (over 10× lighter).

  • Instant startup — 0 ms latency vs Python’s interpreter spin-up delay.

  • Multi-monitor smart tiling:

    • Detects which monitor the active window is on.

    • Moves windows across monitors while preserving geometry or size.

    • Neighbor monitor detection — up/down/left/right aware.

  • New commands:

    • preserve_geom <dir> → move window to another monitor, keeping exact size/pos if possible

    • preserve_size <dir> → move window across monitors, preserve size, reapply tiling mode

    • wm_fullscreen → toggle WM-managed fullscreen (_NET_WM_STATE_FULLSCREEN) (thanks @seb3773 fo the idea).

  • No more tiler.sh — direct FIFO control; shell wrapper removed as unneeded (thanks @seb3773).

  • One-step setup — build, install, autostart, and keybinding integration via `config.py` in a single command.

  • Automatic keybinding install — Win+Arrow tiling and monitor moves set up in TDE/KHotKeys automatically.

  • Renamed & moved — project is now Xakar, part of the SetuZuna Project. Source hosted fully on Codeberg.

---

Compatibility with v3

* Core tiling actions (`center`, `fullscreen`, `left`, `right`, `up`, `down`) behave identically. 
* The FIFO socket interface remains the same — existing scripts can still `echo` commands directly. 
* Keybinding setup is now handled automatically by the installer. 

---

Troubleshooting
  • Nothing happens? Ensure `libx11-dev` and `libxinerama-dev` are installed before building.

  • Socket not found? Run `xakard` manually to start the daemon.

  • Errors? Launch from a terminal to see stderr/debug output.

---

Feedback

Xakar v4 is the leanest, fastest release yet — under 1.3 MB memory, instant startup, and multi-monitor logic baked in. 
I’d love to hear from users with unusual setups (ultrawides, rotated monitors, etc) to stress-test the new monitor detection. 

– theasmitkid

Last edited by theasmitkid (2025-09-05 05:01)


Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

#36 2025-09-05 02:07

seb3773
Member
From: France
Registered: 2023-11-01
Posts: 228

Re: TDE: Keyboard Binding for Window Tiling

This looks very very good ! And good move to code it in c++ ! Much lighter, faster and low ressources usage: exactly what I like wink
I see we kind went in same direction^^, as I modified the c coded tiler I've made from your v3 python version -now included in 'qsuperl'- to handle multi monitors too. (I corrected some placement problems too, and added a 10% +/- zoom feature with superl+[+] and superl+[-])
Will try it soon and report problems if any smile


Debian & Q4OS (TDE!!), low-level C, ASM (z80/68k/x86/ARM64), embedded systems, CPU architectures (RISC-V, binary formats, assembly), retro-computing, metal music, guitar and sci-fi.

Offline

#37 2025-09-13 22:38

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

Minor Release v4.1 Out

can now automatically uninstall khotkey bindings


Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

#38 2025-11-11 11:06

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

RC-1 for v5 is out

with a lot n lot of changes, still incomplete but previous stuff working with q4os 6, needs .config file at /home/<user>/.setuzuna/xakar/.config


Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

#39 2025-12-18 15:05

theasmitkid
Member
From: NCT of Delhi
Registered: 2025-01-26
Posts: 345

Re: TDE: Keyboard Binding for Window Tiling

Now mirrors to GitHub! Feel free to open issues here in you don't use codeberg~
Star the project if your like my work wink

https://github.com/TheAsmitKid/Xakar/


Coding & Robotics Enthusiast | Brave & Spck Editor @ Lenovo Tab 4 8 · Android 8.1 · 2GB · 16GB

Offline

Board footer

Powered by FluxBB