Code Monkey home page Code Monkey logo

leukipp / cortile Goto Github PK

View Code? Open in Web Editor NEW
119.0 4.0 11.0 7.76 MB

Linux auto tiling manager with hot corner support for Openbox, Fluxbox, IceWM, Xfwm, KWin, Marco, Muffin, Mutter and other EWMH compliant window managers using the X11 window system. Therefore, this project provides dynamic tiling for XFCE, LXDE, LXQt, KDE and GNOME (Mate, Deepin, Cinnamon, Budgie) based desktop environments.

License: MIT License

Go 96.03% Shell 3.97%
golang tiling-window-manager ewmh hot-corners window-manager x11 xfce openbox fluxbox gnome

cortile's Introduction

Cortile

build date downloads os platform

Linux auto tiling manager with hot corner support for Openbox, Fluxbox, IceWM, Xfwm, KWin, Marco, Muffin, Mutter and other EWMH compliant window managers using the X11 window system. Therefore, this project provides dynamic tiling for XFCE, LXDE, LXQt, KDE and GNOME (Mate, Deepin, Cinnamon, Budgie) based desktop environments.

Simply keep your current window manager and install cortile on top of it. Once enabled, the tiling manager will handle resizing and positioning of existing and new windows.

Features features

  • Workspace based tiling.
  • Auto detection of panels.
  • User interface for tiling mode.
  • Systray icon indicator and menu.
  • Keyboard, hot corner and systray bindings.
  • Vertical, horizontal and fullscreen mode.
  • Socket communication commands.
  • Remember layout proportions.
  • Floating and sticky windows.
  • Drag & drop window swap.
  • Workplace aware layouts.
  • Multi monitor support.

Support for keyboard and mouse events sets cortile apart from other tiling solutions. The go implementation ensures a fast and responsive system, where multiple layouts, keyboard shortcuts, drag & drop and hot corner events simplify and speed up your daily work.

demo

Installation installation

Manually download/extract the latest binary file from releases or use wget/tar:

wget -qO- $(wget -qO- https://api.github.com/repos/leukipp/cortile/releases/latest | \
jq -r '.assets[] | select(.name | contains ("linux_amd64.tar.gz")) | .browser_download_url') | \
tar -xvz

Run the binary file and cortile will automatically tile until you stop it:

./cortile

Another installation method can be found in the development section. The latest official release is published on GitHub. Versions distributed via package managers are community supported and may be outdated.

Service

To enable auto tiling on startup, you can run cortile as a service after the graphical user interface has been loaded. A template to run cortile as a systemd service is provided in the services folder. You may have to adjust the filepath/symlink under ExecStart and enable the user service:

# copy systemd service file
cp cortile.service ~/.config/systemd/user/

# reload systemd configuration
systemctl --user daemon-reload

# enable systemd service
systemctl --user enable cortile.service

# start systemd service
systemctl --user start cortile.service

Usage

The layouts are based on the master-slave concept, where one side of the screen is considered to be the master area and the other side is considered to be the slave area:

  • vertical-right: split the screen vertically, master area on the right.
  • vertical-left: split the screen vertically, master area on the left.
  • horizontal-top: split the screen horizontally, master area on the top.
  • horizontal-bottom: split the screen horizontally, master area on the bottom.
  • fullscreen: single window that fills the entire tiling area.

The number of windows per side and the occupied space can be changed dynamically. Adjustments to window sizes are considered to be proportion changes of the underlying layout.

Windows placed on the master side are static and the layout will only change as long the space is not fully occupied. Once the master area is full, the slave area is used, where the layout changes dynamically based on available space and configuration settings.

Configuration configuration

The configuration file is located at ~/.config/cortile/config.toml (or XDG_CONFIG_HOME) and is created with default values during the first startup. Additional information about individual entries can be found in the comments section of the config.toml file.

config

Shortcuts

The default keyboard shortcuts are assigned as shown below. If some of them are already in use by your system, update the default values in the [keys] section of the configuration file:

Keys Description
Ctrl+Shift+Home Enable tiling on the current screen
Ctrl+Shift+End Disable tiling on the current screen
Ctrl+Shift+R Disable tiling and restore windows
Ctrl+Shift+T Toggle between enable and disable
Ctrl+Shift+BackSpace Reset layouts to default proportions
Ctrl+Shift+Next Cycle through next layouts
Ctrl+Shift+Prior Cycle through previous layouts
Ctrl+Shift+Space Activate fullscreen layout
Ctrl+Shift+Left Activate vertical-left layout
Ctrl+Shift+Right Activate vertical-right layout
Ctrl+Shift+Up Activate horizontal-top layout
Ctrl+Shift+Down Activate horizontal-bottom layout
Ctrl+Shift+KP_5 Make the active window master
Ctrl+Shift+KP_6 Make the next window master
Ctrl+Shift+KP_4 Make the previous window master
Ctrl+Shift+KP_Add Increase number of master windows
Ctrl+Shift+KP_Subtract Decrease number of master windows
Ctrl+Shift+Plus Increase number of maximum slave windows
Ctrl+Shift+Minus Decrease number of maximum slave windows
Ctrl+Shift+KP_3 Increase proportion of master-slave area
Ctrl+Shift+KP_1 Decrease proportion of master-slave area
Ctrl+Shift+KP_2 Focus next window
Ctrl+Shift+KP_8 Focus previous window

Hot corner events are defined under the [corners] section and are triggered when the pointer enters one of the target areas:

Corners Description
Top-Left Focus previous window
Top-Right Make the active window master
Bottom-Right Increase proportion of master-slave area
Bottom-Left Decrease proportion of master-slave area

Systray events are defined under the [systray] section and are triggered when the pointer keys are pressed while hovering the icon:

Pointer Description
Middle-Click Toggle between enable and disable
Scroll-Up Cycle through previous layouts
Scroll-Down Cycle through next layouts
Scroll-Right Increase proportion of master-slave area
Scroll-Left Decrease proportion of master-slave area

Common pointer shortcuts used in some environments:

  • Move window: Alt+Left-Click.
  • Resize window: Alt+Right-Click.
  • Maximize window: Alt+Double-Click.

Communication communication

External processes may communicate directly with cortile using unix domain sockets. The sock parameter (-sock /tmp/cortile.sock) defines a path for a socket file that can be used to exchange data between processes. Internally however, two socket files are used. One is for incoming (/tmp/cortile.sock.in) and one for outgoing (/tmp/cortile.sock.out) communication.

Outgoing - Events

Outgoing events and states

User triggered events (e.g. tile workspace) are broadcasted to the outgoing socket as json string. One can listen to them by using netcat or similar alternatives:

# Netcat
nc -Ulk /tmp/cortile.sock.out

# Socat
socat UNIX-LISTEN:/tmp/cortile.sock.out,reuseaddr,fork STDOUT

For debugging purposes, you can also dump the json messages into a file:

# Netcat
nc -Ulk /tmp/cortile.sock.out 2>&1 | tee /tmp/cortile.json

# Socat
socat -v UNIX-LISTEN:/tmp/cortile.sock.out,reuseaddr,fork OPEN:/tmp/cortile.json,create,truncate
Incoming - Commands

Incoming commands and requests

Similarly, requests about the internal state of cortile can be sent to the incoming socket:

# Netcat
echo '{"State":"workspaces"}' | nc -U /tmp/cortile.sock.in

# Socat
echo '{"State":"workspaces"}' | socat STDIN UNIX-CONNECT:/tmp/cortile.sock.in

Since the communication is asynchronous, it is necessary to listen to the outgoing socket at the same time in order to receive the response.

Example files for sending commands and receiving states can be found in the scripts folder.

Development development

You need go >= 1.20 to compile cortile.

Install - go

Option 1: Install go via package manager

Use a package manager supported on your system:

# apt
sudo apt install golang

# yum
sudo yum install golang

# dnf
sudo dnf install golang

# pacman
sudo pacman -S go

Option 2: Install go via archive download

Download a binary release suitable for your system:

cd /tmp/ && wget https://dl.google.com/go/go1.20.linux-amd64.tar.gz
sudo tar -xvf go1.20.linux-amd64.tar.gz
sudo mv -fi go /usr/local

Set required environment variables:

echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
echo "export GOPATH=~/.go" >> ~/.profile
source ~/.profile

Verify the installed go version:

go env | grep "GOPATH\|GOVERSION"
Install - cortile

Option 1: Install cortile via remote source

Install directly from develop branch:

go install github.com/leukipp/cortile@develop

Option 2: Install cortile via local source

Clone source code from develop branch:

git clone https://github.com/leukipp/cortile.git -b develop
cd cortile

If necessary you can make local changes, then execute:

go install -ldflags="-X 'main.date=$(date --iso-8601=seconds)'"

Start cortile in verbose mode:

$GOPATH/bin/cortile -v

Additional additional

Special settings:

  • Use the edge_margin property to account for additional spaces.
    • e.g. for deskbar panels or conky infographics.
  • Use the window_slaves_max property to limit the number of windows.
    • e.g. with one active master and window_slaves_max = 2, all windows following the third window are stacked behind the two slaves.

Hot corners:

  • Use tiling_enabled = false if you prefer to utilize only the hot corner functionalities.
  • Use the hot [corners] properties to execute any external command available on your system.
    • e.g. use bottom_center = "firefox" to open a web browser window.

Systray:

  • Use the tiling_icon property to add any external command to the systray menu.
    • e.g. use tiling_icon = [...,['firefox', 'Open Browser'],...] to add a web browser entry.

Issues issues

Cortile works best with Xfwm and Openbox window systems. However, it`s still possible that you may encounter problems during usage.

Windows:

  • It's recommended to disable all build-in window snapping features (snap to other windows, snap to screen borders).
  • Automatic panel detection may not work under some window managers, use the edge_margin property to adjust for additional margins.
  • Particularly in GNOME based desktop environments, window displacements or resizing issues may occur.
  • Sticky windows may cause unwanted layout modifications during workspace changes.

Systray:

  • Adjust the bindings in the [systray] section, as some pointer events may not fire across different desktop environments.
  • Window managers not supporting StatusNotifierItem for displaying systray icons will need to install snixembed.

Debugging:

  • If you encounter problems start the process with cortile -vv, which provides additional debug outputs.
  • A log file is created by default under /tmp/cortile.log.

Credits credits

Based on zentile (Berin Larson) and pytyle3 (Andrew Gallant).
The main libraries used in this project are xgbutil, toml, systray, dbus, fsnotify and logrus.

License license

MIT

cortile's People

Contributors

blrsn avatar leonardvertighel avatar leukipp avatar r8s6 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

cortile's Issues

GNOME: Incorrect sizes and multi monitor support behavior

Problems

  • On the primary screen, windows are not properly sized due to the top bar being present. Cortile is not considering this, hence windows are being pushed out the bottom.
  • Automatic window placement looks jagged, probably due to the multiple monitors present on my setup.
  • Windows are never automatically placed on my primary monitor and moving them around monitors is incredibly annoying and unstable.
  • Systray never starts and is not present.

Thoughts

Accounting for the GNOME top bar is probably possible through the config, but I'm reporting it since it could be caused by a bigger issue.

Proper multimonitor support could probably be achieved, but a quick workaround (that would add as a nice feature) would be to disable cortile completely on monitors of your choice.

For example, I myself wouldn't want to tile windows on my secondary monitor, floating there is alright.

Video

2024-01-11.11-42-10.mp4

Check available versions online

Starting with cortile v2.3.0 there will be a build-in version checker.
This allows to show hints (on terminal, systray icon, systray menu) to indicate that a new version is available.

Cortile will make a single request to https://github.com/leukipp/cortile/releases to check the current running version with the latest published version. However, there will be a way to disable this server request in case someone doesn't want to use this feature.

How to disable mod_* keys?

When I set mod_screens and mod_workspaces to either empty string or a string that does not represent a valid keycode (e.g. mod_screens = "INVALID"), then all 3 modes (current, screens, workspaces) for an action execute simultaneously:

WARN[2024-04-07T17:37:11+02:00] Error on action for layout_horizontal_bottom: Could not find a valid keycode in the string 'INVALID-'. Key binding failed.
...
INFO[2024-04-07T17:37:18+02:00] Execute action [cycle_previous-current]      
INFO[2024-04-07T17:37:18+02:00] Tile 4 windows with vertical-left layout [workspace-1-1] 
INFO[2024-04-07T17:37:18+02:00] Execute event cycle_previous                 
INFO[2024-04-07T17:37:18+02:00] Execute action [cycle_previous-screens]      
INFO[2024-04-07T17:37:18+02:00] Tile 4 windows with fullscreen layout [workspace-1-1] 
INFO[2024-04-07T17:37:19+02:00] Tile 1 windows with vertical-left layout [workspace-1-0] 
INFO[2024-04-07T17:37:19+02:00] Execute event cycle_previous                 
INFO[2024-04-07T17:37:19+02:00] Execute action [cycle_previous-workspaces]   
INFO[2024-04-07T17:37:19+02:00] Tile 1 windows with fullscreen layout [workspace-1-0] 
INFO[2024-04-07T17:37:19+02:00] Tile 0 windows with vertical-left layout

How do I completely disable those modifiers properly?

Restore windows position when disabling the tiling

Hi there!
First of all I want to say thank you for this great application.
I was looking for this a long time to use it in xfce.
Would it be possible to implement the feature of restoring the position after disabling the tiling ?

P.S. I see the app has multi-screen support but when I enable the tiling it affects only one screen. Is it supposed to be like that ? And if yes will there be an option to apply the tiling for all screens at once ?

[Bug] Moving window between monitors using mouse doesn't always work

Hello,

When dragging a window from a monitor, one of the following often happens when dropping it into another one :

  • the window goes back to its previous position, and I have to try again ;
  • the window stays where the cursor is instead of being repositioned, and I have to drag it back to its previous monitor before trying again.

Thanks

Option to disable window decorations only in fullscreen layout

Hello, i just found out about your window tiling project and i couldn't be more happy and amazed.
You 've done an amazing job and it's exactly what i was looking for.

The only thing missing, as the titles says, is the option to disable window decorations only in fullscreen layout.

I am aware of the option to completely disable window decorations, but i'd like to keep it just for fullscreen windows.
I would not ask for this, just to satisfy my personal needs, but since you have a similar option already coded, i guess and i hope that it is not hard to include one more option for fullscreen only.

Thanks again for your great work!!

Incorrect window placement/scaling in QT apps

My window manager is Openbox and Cortile does not recognize the Openbox decoration specifically with QT-App. In GTK apps it recognizes the decoration without any problems. I noticed a hint in the log file as to what might be the problem. The (Tint2) panel is taken out by Cortile, which means I no longer have a 1920x1080 desktop resolution, but 1920 x 1052. My panel is 28px high, so that's fine. In the case of placing QT apps, Cortile probably uses a different resolution than GTK apps, which could explain the upward shift. Could you correct that?
2023-11-21_17-52

cortile release v2.3.2 crashes on start with GLIBC not found

i'm using the develop version and it's working good with me, i tried the last release 2.3.2 amd64.tar.gz, but i get that:

./cortile
./cortile: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./cortile)
./cortile: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./cortile)

xfce4-terminal is ignored

window_ignore = [
['xf.*', ''],

This is matching a bit too much. I was not able to fix the regexp myself but here's the xprop output

WM_CLASS(STRING) = "xfce4-terminal", "Xfce4-terminal"

EDIT:
I can make this work now with ['xf.*','xfce4-terminal'] . It didn't work before becausae my xfce4-terminal was set to not display the title (General/Title/Initial title and Dynamically-set title settings). I also did some looking around and the go regexp library does not seem to support the various look ahead/around etc functionality to exclude a regexp. That would have to be implemented in code if necessary.

lock error

Hello.
Thank you for the project!

Can you tell me why I get this output when I run the program?

lock error (open /run/lock/cortile.lock: permission denied)

flameshot_014

restart cortile may take random few seconds

with two monitors ,I replace zentile with cortile, its a good choice.
tiling after drag window between two monitors may not work, need to place window back and drag again which is mentioned as another issue.I use systemd service to auto restart , but restart may take few seconds, same as killall cortile and run cortile.
I rebuild cortile ,get rid of socket. but it did not work. sometimes tiling windows as soon as cortile run, but not always.
`[Unit]
Description=autotile window manager
Wants=cortile.timer

[Service]
Restart=always
RestartSec=0
RemainAfterExit=yes
ExecStart=/usr/local/bin/cortile
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=default.target`

i don't know why these shortcut-keys not work for me

Tile the current workspace.

tile = "Control-Shift-T"

Untile the current workspace.

untile = "Control-Shift-U"

Cycles through the available layouts.

layout_cycle = "Control-Shift-C"

Make the active window as master.

master_make = "Control-Shift-M"

readme vs reality minor discrepencies

I do not know much about go but I thought I would let you know that on my system your docs have an error.

I built from remote source as specified in readme and it seemed to be successful but I couldn't go on with the instructions. It turned out that instead of ~/.go/bin/cortile, the correct location was ~/go/bin/cortile which I found by looking at the results of go env. IDK why.

Also I wasn't clear from the docs if the file ~/.config/cortile/config.toml was supposed to have been created during the set up? I think it was not created at all, or it was created empty.

Any way I did get past both and then it looks like it runs as expected.

go version go1.18.3 linux/amd64 - can't offer much insight regarding causes of the above.

Remember tiling state and layout proportions

Starting with version v2.4.0 the following tiling properties will be saved and automatically applied on restart:

  • current tiling state (enabled/disabled)
  • current maximum number of windows (masters/slaves)
  • current layout (vertical-right, horizontal-top, fullscreen, etc..)
  • current layout proportions (between master-slave/master-master/slave-slave)

The config setting for master-slave proportion

# Initial division of master-slave area (0.0 - 1.0).
proportion = 0.6

was removed (defaults to 0.5) and will be ignored in v2.4.0. Latest layout proportions may be reset with

# Reset layouts to default proportions (BackSpace = Delete_Left)
reset = "Control-Shift-BackSpace"

In addition to the already saved window properties (#22), cortile will create a cache folder (defaults to /home/USER/.cache/cortile/2.x.x) to store the latest window/tiling properties per workplace, workspace and monitor. A physical workplace is defined by the combination of connected monitors and their properties (arrangement, resolution, etc...).

Therefore the last applied window/tiling properties are workplace aware and may differ intentionally (e.g. between office, home, single monitor, multi monitor, etc...).

In cases where the caching function is not desired, you can deactivate it via cortile -cache 0.

[Feature request] Support `Super-Shift-Arrow`

Hello,

When moving a window across from one monitor to another using this shortcut, the window preserves its position, instead of being repositioned relatively to existing windows, like when moving it via mouse.

It would be nice to support that use case.

Thanks

[keys] command executing after only half the combination

Hi!
I just installed the application through go install github.com/leukipp/cortile@main for my XFCE installation and the default behavior works fine. I just tried to change the keyboard commands in the config file and I am having issues.

I have tried both layout_cycle = "Super_L-period" and layout_cycle = "Super_L-Shift_L-period" but the command seems to execute already when I only press Super_L.

Thanks for any help.

runtime error: invalid memory address or nil pointer dereference goroutine 1

FATA[2023-06-15T07:37:16+03:30] runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.18.10/x64/src/runtime/debug/stack.go:24 +0x65
main.run.func1()
	/home/runner/work/cortile/cortile/main.go:49 +0x3d
panic({0x5f0720, 0x7e54e0})
	/opt/hostedtoolcache/go/1.18.10/x64/src/runtime/panic.go:838 +0x207
github.com/leukipp/cortile/desktop.(*Workspace).IsEnabled(...)
	/home/runner/work/cortile/cortile/desktop/workspace.go:109
github.com/leukipp/cortile/desktop.(*Tracker).Update(0xc00014a8e0)
	/home/runner/work/cortile/cortile/desktop/tracker.go:61 +0x68
github.com/leukipp/cortile/desktop.(*Tracker).onStateUpdate(0xc00014a8e0, {0xc0003be9a8, 0x13})
	/home/runner/work/cortile/cortile/desktop/tracker.go:357 +0x253
github.com/leukipp/cortile/common.stateCallbacks(...)
	/home/runner/work/cortile/cortile/common/root.go:200
github.com/leukipp/cortile/common.stateUpdate(0x411736?, {0x7f80bc568778?})
	/home/runner/work/cortile/cortile/common/root.go:184 +0x552
github.com/BurntSushi/xgbutil/xevent.PropertyNotifyFun.Run(0x5eec80?, 0xc0000a3230?, {0x606040?, 0xc0003be978?})
	/home/runner/go/pkg/mod/github.com/!burnt!sushi/[email protected]/xevent/callback.go:311 +0x38
github.com/BurntSushi/xgbutil/xevent.runCallbacks(0xc00022c000, {0x606040, 0xc0003be978}, 0xc00022c000?, 0x67cbc8?)
	/home/runner/go/pkg/mod/github.com/!burnt!sushi/[email protected]/xevent/xevent.go:203 +0x11c
github.com/BurntSushi/xgbutil/xevent.processEventQueue(0xc00022c000, 0x0, 0x0)
	/home/runner/go/pkg/mod/github.com/!burnt!sushi/[email protected]/xevent/eventloop.go:253 +0x1065
github.com/BurntSushi/xgbutil/xevent.mainEventLoop(0xc00022c000, 0xc0001b0050?, 0x1?, 0x0)
	/home/runner/go/pkg/mod/github.com/!burnt!sushi/[email protected]/xevent/eventloop.go:108 +0x48
github.com/BurntSushi/xgbutil/xevent.Main(...)
	/home/runner/go/pkg/mod/github.com/!burnt!sushi/[email protected]/xevent/eventloop.go:52
main.run()
	/home/runner/work/cortile/cortile/main.go:64 +0x85
main.main()
	/home/runner/work/cortile/cortile/main.go:43 +0xaf

When I suspend xfce and then try to resume, I encounter an error message saying "invalid memory address or nil pointer dereference" and cortile is killed. I have already turned off the screensaver and lock screen, but this did not solve the problem. Could someone please help me resolve this issue? Thank you.

By the way, my Linux distribution is Void Linux.

[Bug] Crash : "invalid memory address or nil pointer dereference"

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x5e9403]

goroutine 3212 [running]:
github.com/leukipp/cortile/store.(*Client).UnLock(...)
        /home/runner/work/cortile/cortile/store/client.go:78
github.com/leukipp/cortile/desktop.(*Tracker).onPointerUpdate.func1()
        /home/runner/work/cortile/cortile/desktop/tracker.go:439 +0xc3
created by time.goFunc
        /opt/hostedtoolcache/go/1.18.10/x64/src/time/sleep.go:176 +0x32

Thanks

Save personalized window properties

I am working on another application that saves personalized window/monitor properties and reloads these properties when the window is re-opened at a later time.

The new application is to be used either stand-alone or as a complement to cortile. The reason for this is that I do not want to bloat the cortile source code and the associated configuration file too much.

Switching workspaces via Openbox keybindings leads to missed X events

First of all, thank you for your work on cortile! This is an excellent addition to classic WMs like Openbox and Xfwm.

Unfortunately, I'm experiencing frequent hiccups on my setup that can mostly be attributed to cortile not receiving all events from the X connection occasionally. I'm running LXQt with Openbox on NixOS using a multi-monitor setup with 2 monitors.

The issue happens when switching workspaces via Openbox's keybindings. Sometimes (roughly every 5~10 switches), cortile does not register the workspace change. This leads to all kinds of glitches because cortile doesn't update its internal state properly, so cycling the tiling mode applies to the wrong workspace, windows not snapping back into position etc.

While trying to identify the problem I added more log output to cortile at places where X events are initially received and processed. I noticed that occasionally some events are never received by cortile at all, for example the _NET_CURRENT_DESKTOP property change from the root window when changing the workspace.

At first I thought it was about my picom config and all the stuff going on (fade animation, blur) that choked the X connection and event queue somehow but then I noticed it doesn't happen when changing the workspace via external means (wmctrl or the workspace switcher of the LXQt panel) instead of Openbox's keybindings. See the reproduction steps below.

For the time being I can resort to wmctrl and other external means for workspace switching but it would be great to get to the bottom of this and fully support Openbox's native behavior.

Unfortunately, I have no clue yet why this is happening at all. Since the workspace indicator of LXQt's panel keeps updating correctly everytime (it also listens to the same X events afaik) it does not seem like the X events are not emitted in general, just that cortile doesn't receive them occasionally when they originate from Openbox keybinding actions.

How to reproduce

Consider the following Openbox keybindings:

<keybind key="A-1">
  <action name="GoToDesktop">
    <to>1</to>
  </action>
</keybind>
<keybind key="A-2">
  <action name="GoToDesktop">
    <to>2</to>
  </action>
</keybind>
<keybind key="A-Escape">
  <action name="GoToDesktop">
    <to>last</to>
  </action>
</keybind>

To reproduce:

  1. Switch to the second workspace and change the tiling layout in cortile so that the tray icon displays a different layout than on workspace 1.
  2. Continuously switch between workspace 1 and 2 by either alternating between Alt+1 and Alt+2 keypresses or repeatedly press Alt+Escape to switch back and forth.

Eventually, cortile will miss events which is visible by the tray icon not updating the layout indicator after changing the workspace. For example, if workspace 2 was set to maximized and the keypress switched to workspace 1, the icon will keep displaying the maximized layout.

Now in contrast, binding Alt+1 and Alt+2 outside of Openbox (e.g. via LXQt's hotkey handler) to wmctrl -s 0 and wmctrl -s 1 respectively or using the scroll wheel on the workspace indicator of the LXQt panel to continuously switch workspaces back and forth does not seem to trigger the issue at all.

cortile cannot work with quicktile which zentile can

After enter my Xfce session ,if cortile didnot init, quicktile can sucessfully tile every corner in 9x2 ways. But if cortile runs ,there are six or more places quicktile cannot tile correctly ,neither xfwm4 can. even when cortile tile disabled, quicktile cannot, only if log out session and log in again with no coritle runs,quicktile can worked properly.
zentile can work with quicktile and xfwm4 ,cortile must grasp something and unwilling to share with other window manager.
I would like to tile windows automatically and manually.

pre-tile, post-untile, etc. events and states

This will allow users to define some custom window-manager related tweaks (for example: enable/disable focus follow mouse, change window decoration, or hide “quake terminal”)
Something like, if ~/.config/cortile/pre-tile.sh exist it will be executed and so on.

What do you think?

[Feature request] Remember window monitor

Hello,

It would be nice of Cortile to remember on which monitor I put my windows.

Use case :

  1. I launch an app.
  2. It appears on monitor A.
  3. I move it to monitor B.
  4. I close it.
  5. I launch it again.

Expected : it appears on monitor B.

Actual : it appears on monitor A.

Thanks

Status file with current workspace state?

Background:
I'm working on integrating Cortile into the next Mabox ISO. To make it as easy as possible for the user to try out Cortile, I am writing a small helper in the form of tint2 executor. Currently it's quick and dirty but functional (as demo). It shows icons with the current Cortile layout for a given workspace (or untiled). With click it switches layouts. Using the mouse wheel is possible to increase/decrease aspect ratio (or switch windows if layout = fullscreen)

Please have a look: https://www.youtube.com/watch?v=sfuXrpgVaDE

One thing that makes me wonder...

To find out about the current state of a given workspace Cortile must be launched with the -v option and then I grep the logs. It works, but I don't think it's very elegant. Maybe you have another idea?

Weird interaction between tiling and sticky windows in xfce

Due to how xfce manages virtual desktops, I tend to stick any window that I throw up on my secondary screen, as I want them on all desktops. When doing this with tiling turned on on that screen it seems like that window is effectively removed from the tiling logic. This makes it so that any other window on that screen now takes up the full screen and the sticky one is now floating above or behind it.

It would be nice if sticky windows can be treated as any other window (just re-tiled when moving to a new desktop)

Is it possible to control if a window is sticky based on the screen it is on? That could be useful as well.

Can I disable hot corners and keep only kbd shortcuts?

Obviously, this is just a suggestion.

My mouse movement is kind of erratic, so disabling hot corners will be good for me.

I already changed these settings:

# Width and height of a hot-corner area within the edge corners (0 - 100).
#edge_corner_size = 10
edge_corner_size = 0

# Width or height of a hot-corner area within the edge centers (0 - 100).
#edge_center_size = 100
edge_center_size = 0

Maybe a config setting can help me...

[Documentation] Prior and Next keys

I don't recall seeing these keys on a keyboard before. Looking at the xgbutil/keyboard source they seem to be equivalent to Page_Up (Prior) and Page_Down (Next) . Maybe this is evident to everybody else. If not, it might be good to add these keys in parantheses in the Readme and config file.

Thank you

This is not an issue, just want to thank you for this fantastic project.
I've been testing with Openbox for some time and it's very impressive.
So impressive that I'm considering integrating Cortile in the next releases of Mabox Linux. For now, I encourage the community to give it a try.

I think I'll have some feature requests in the future, but for now, I want to test and get to know Cortile even more.

So thank you again and keep up the good work 👍

Weird behaviour when maximizing window

I tried to use cortile and experienced weird behaviour.

Whenever I maximize a window, cortile is getting stuck in some kind of action loop.

When cortile is stuck in the buggy loop and I move the cursor to another screen, cortile crashes with a panic.

https://www.youtube.com/watch?v=fbLiyfJpsX8

The environment was Debian 12 with XFCE4, specifically:

  • cortile v2.3.1 (f7d514e 2023-12-10T19:35:52Z)
  • xfwm4 v4.18.0 (7e7473c5b)
  • thunar v4.18.4

crash logs: https://gist.githubusercontent.com/nothub/ea55027fcfb57e5c3a1e689dc883e122/raw/cf34e1486bf59c98b84515698145a0d7e42cdd7b/gistfile1.txt

Extended external communication via D-BUS

External communication with cortile was implemented via unix domain sockets as discussed here #14 (comment).

The current implementation has some caveats, as it works in an asynchronous way. You have to listen for return values while you are requesting a state from cortile.
There were also feature requests that were either impossible to add or require extensive programming skills and knowledge of the X window backend.

To address these issues, I have opted to introduce a more efficient approach that uses quasi-synchronous interaction with cortile via D-BUS. Given that tray icon communication already relies on D-BUS, this change introduces no new dependencies.

For those who have developed custom event handlers/hook-up logic for cortile, I recommend transitioning to the new API as soon as possible.
The forthcoming external communication via D-BUS will supersede the now deprecated unix domain socket approach.

Details regarding the new D-BUS API will be published here and in the README.md file.

run cortile as user

i only can run cortile as root with sudo, i can't run it as user, it is that the default ? or it is something i do wrong in installing it

Can't start when no windows are active

I tried adding cortile to autostart list in xfce but it seems cortile can't start when no windows are active.
cortile.log:
Error on initialization GetProperty: No such property '_NET_ACTIVE_WINDOW' on window 765.

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.