ssokolow / quicktile

Adds window-tiling hotkeys to any X11 desktop. (An analogue to WinSplit Revolution for people who don't want to use Compiz Grid)
https://ssokolow.com/quicktile/
GNU General Public License v2.0
860 stars 78 forks source link

Quicktile doesn't work if it's booted by an autostart script #104

Closed owenthereal closed 4 years ago

owenthereal commented 4 years ago

I installed the autostart script script to /etc/xdg/autostart. The quicktile process was started properly but no key bindings worked. If I run quicktile -d in a terminal, everything worked as expected. I'm wondering what I miss.

ricardochimal commented 4 years ago

@jingweno dunno if it'd help but mine is

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=quicktile
Comment=quicktile
Exec=quicktile --daemonize
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

I have it in $HOME/.config/autostart/

ssokolow commented 4 years ago

That is strange because it's supposed to work from an autostart file. Have you tried modifying the autostart file to run something like a script containing echo "it ran" > ~/test.log to make sure it's actually getting launched?

I know I've had trouble with my KDE being picky about running or not running autostart scripts which are listed as enabled.

Beyond that, what distro are you on? I'll try to download a VM and see if I can replicate the problem.

owenthereal commented 4 years ago

I figured it out. The issue was with the arrow keys binding. This is my config:

[general]
cfg_schema = 1
ColumnCount = 3
UseWorkarea = True
ModMask = <Ctrl><Alt>
MovementsWrap = True

[keys]
Left = left
Right = right

The key bindings work if I run quicktile in a terminal but it doesn't if it's started by autostart. My distro is Ubuntu 18.04. This only happens with arrow keys and I ended up binding H to left and L to right and things worked with autostart and terminal.

ssokolow commented 4 years ago

Interesting. It uses XGrabKey to grab them directly from the X server, so I'd expect any problems to manifest the other way around unless it's somehow getting launched in the period before your session start scripts spin up the X server or during a brief window when something else has an exclusive grab on those keys.

I'll see if I can find time to grab an Ubuntu 18.04 VM today or tomorrow.

EDIT: Grabbed a VM for Ubuntu 18.04 but didn't have time to diagnose yet. I'll try to find time tomorrow or the following day.

ssokolow commented 4 years ago

Sorry for going silent. I grabbed a VM, but I've been spending all my time on a crunch to see if I can get the GTK+ 3.x rewrite of QuickTile ready in time for Python 2.x to fall out of support at the end of the month.

ssokolow commented 4 years ago

If you'd like to try it, the GTK 3 rewrite is out for testing in this branch.

Just don't use the pip URL in the README because it's pointing toward the master branch so it won't require a fix-up commit when I merge the branch into master.

If you want to use the "pip from a URL" install method, substitute this command:

sudo pip3 install https://github.com/ssokolow/quicktile/archive/gtk3_port.zip
ssokolow commented 4 years ago

@jingweno Could you try making the following change to your autostart script and telling me what the resulting log file says?

Exec=sh -c 'quicktile --daemonize > ~/quicktile.log'

ssokolow commented 4 years ago

Closing for lack of response after two months.

tamipangadil commented 3 years ago

@jingweno dunno if it'd help but mine is

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=quicktile
Comment=quicktile
Exec=quicktile --daemonize
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

I have it in $HOME/.config/autostart/

This works on my side. I just copied the text above and save it on ~/.config/autostart/quicktile.desktop. And restarted my PC and it works as expected. Thanks @ricardochimal