elementary / switchboard-plug-applications

Switchboard Applications Plug
https://elementary.io
GNU General Public License v3.0
14 stars 12 forks source link

Xbindkeys As Startup Application Delays Display of Plank & Panel #41

Open lostmoonofsaturn opened 5 years ago

lostmoonofsaturn commented 5 years ago

With xbindkeys set as a Startup Application, the display of Plank and the top panel at the beginning of a new session, after reboot or logging out, is delayed by 45-60 seconds, occasionally much longer or not displaying at all. The correct background is displayed.

Xbindkeys executes this script allowing movement between workspaces with a mouse tilt wheel, stored in the home directory as ".xbindkeysrc":

# -- Move Right --
# This is the general command that works with any number of workspaces:
# "xdotool set_desktop $(expr $(expr $(xdotool get_desktop) + 1) % $(xdotool get_num_desktops))"
# This is the optimized command for 5 workspaces:
"xdotool set_desktop $(expr $(expr $(xdotool get_desktop) + 1) % 5)"
    b:7

# -- Move Left --
# This is the general command that works with any number of workspaces:
# "xdotool set_desktop $(expr $(expr $(xdotool get_desktop) + $(expr $(xdotool get_num_desktops) - 1)) % $(xdotool get_num_desktops))"
# This is the optimized command for 5 workspaces:
"xdotool set_desktop $(expr $(expr $(xdotool get_desktop) + 4) % 5)"
    b:6
lostmoonofsaturn commented 5 years ago

Fixed it:

Setting xbindkeys as a "Startup Application" created /etc/xdg/autostart/xbindkeys.desktop which included "xbindkeys_startup" as the executable. I don't have xbindkeys_autostart installed, only xbindkeys.

Changing the executable to "xbindkeys" resolved the issue.

peteruithoven commented 5 years ago

Is there a reason you might be running into this? Are you running standard elementary OS? Any customization? You closed it because you renamed some files locally? That doesn't solve it for other users right?

lostmoonofsaturn commented 5 years ago

It's a clean new install of Elementary. I've always invoked that script with xbindkeys, not xbindkeys_autostart.

I didn't rename local files. "xbindkeys" is a binary executable. "xbindkeys_autostart" is a shell script that makes a few checks and then runs xbindkeys. (I was wrong when I said xbindkeys_autostart wasn't installed here.)

There is no delay when I executing xbindkeys_autostart in a terminal window; the script works as it should. Since there is a delay when xbindkeys_autostart is the executable in /etc/xdg/autostart/xbindkeys.desktop, I'll reopen this, although my own problem is resolved.

peteruithoven commented 5 years ago

Ah I just realized you've manually added this script and added it to the Startup Applications. One valid concern here is that this startup applications list can have such a big impact on starting the Wingpanel and Plank.

Possibly related: https://github.com/elementary/os/issues/208

lostmoonofsaturn commented 5 years ago

Just in case, to clarify:

Exec=/usr/bin/xbindkeys executes and invokes my .xbindkeysrc , shown in my first post here, without the delay.

Exec=/usr/bin/xbindkeys_autostart executes and invokes my .xbindkeysrc with the delay. It checks for the presence of ${HOME}/.xbindkeys.noauto, /etc/xbindkeysrc, and $HOME/.xbindkeysrc.scm. None of those files exist here.

Both xbindkeys and xbindkeys_autostart execute in a terminal, invoke .xbindkeysrc, and return the prompt immediately.