You are not logged in.
I can't get xbindkeys to autostart upon startx.
I'm using xfce4 desktop environment and I don't use any display managers (I prefer not to), I start the DE with startx directly after logging in.
So far, I have attempted using ~/.xinitrc, and the Application Autostart tab from "Session and Startup" of xfce4.
Xinitrc works when I use it to run other commands.
Xbindkeys works when I enter 'xbindkeys' directly into a terminal after xfce starts.
What I tried:
~/.xinitrc
xbindkeys &
exec startxfce4~/.xinitrc
xbindkeys
exec startxfce4~/.xinitrc
( sleep 5 && xbindkeys ) &
exec startxfce4my .xbindkeysrc file:
https://pastebin.com/L6XQNTnC
What should I do to get this thing to autostart, or is there a better way of binding a key to a command like I'm doing here?
I looked though some other people having trouble autostarting xbindkeys. Some people using display managers managed to solve their problem, but I couldn't find any examples with either xfce or not using a display manager.
Thank you!
Last edited by js8cr3fk9 (2023-03-09 23:12:51)
Offline
oops accidentally clicked submit before finishing formatting
Last edited by js8cr3fk9 (2023-03-07 22:29:14)
Offline
What makes you believe that
~/.xinitrc
xbindkeys &
exec startxfce4 doesn't work?
Is there no xbindkeys process?
What if you
~/.xinitrc
xbindkeys > /tmp/xbindkeys.log 2>&1 &
exec startxfce4Sidebar: if that's your entire xinitrc, it's broken - see the last link below and the note on what to include at least.
Offline
What makes you believe that
~/.xinitrc xbindkeys & exec startxfce4doesn't work?
Is there no xbindkeys process?What if you
~/.xinitrc xbindkeys > /tmp/xbindkeys.log 2>&1 & exec startxfce4Sidebar: if that's your entire xinitrc, it's broken - see the last link below and the note on what to include at least.
The entire xinitrc was just those 2 lines. I didn't read through the wiki page carefully and I just assumed it would work because I was just running startxfce4 directly before I started messing with xinitrc.
I changed the xinitrc file and here's what it looks like now.
After I changing the xinitrc file, I can now see an xbindkeys task in my task manager, but my bind keys still doesn't appear to do anything (my keys doesn't adjust volume and brightness when I press them). If I enter xbindkeys into a terminal, my bind keys starts working, and another xbindkeys task will pop up in task manager.
/tmp/xbindkeys.log is created but empty.
Last edited by js8cr3fk9 (2023-03-06 23:03:15)
Offline
/tmp/xbindkeys.log is empty.
That's ok, there might just have been an error logged there.
Try
xbindkeys -n > /tmp/xbindkeys.log 2>&1 &though, since xbindkeys in daemon mode will somewhat silently fail (if it does)
in my task manager
ps fuxEdit: also a secondary instance (xbindkeys -n) will warn you that there's an instance already running.
my keys doesn't adjust volume and brightness when I press them
Post your $HOME/.xbindkeysrc
Last edited by seth (2023-03-06 20:57:21)
Offline
/tmp/xbindkeys.log is empty.
That's ok, there might just have been an error logged there.
Tryxbindkeys -n > /tmp/xbindkeys.log 2>&1 &though, since xbindkeys in daemon mode will somewhat silently fail (if it does)
in my task manager
ps fuxEdit: also a secondary instance (xbindkeys -n) will warn you that there's an instance already running.
my keys doesn't adjust volume and brightness when I press them
Post your $HOME/.xbindkeysrc
/tmp/xbindkeys.log is still empty, and buttons not changing volume/brightness after autostart.
ps fux sample:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
u4H 299 0.0 0.1 7876 4352 tty1 Ss 16:38 0:00 -bash
u4H 318 0.0 0.1 7612 4096 tty1 S+ 16:38 0:00 \_ /bin/sh /usr/bin/startx
u4H 333 0.0 0.0 4008 2304 tty1 S+ 16:38 0:00 \_ xinit /home/u4H/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.bZmUgBwzfL
u4H 334 5.4 2.2 755644 89096 tty1 Sl 16:38 0:09 \_ /usr/lib/Xorg -nolisten tcp :0 vt1 -keeptty -auth /tmp/serverauth.bZmUgBwzfL
u4H 343 0.1 1.6 610456 65660 tty1 Sl 16:38 0:00 \_ xfce4-session
u4H 347 0.0 0.2 24224 9728 tty1 Sl 16:38 0:00 \_ xbindkeys -nLast edited by js8cr3fk9 (2023-03-07 21:50:53)
Offline
Please don't post (oversized) images of text, post the text.
Why is xbindkeys a child process of xfce4-session (w/ a higher PID)?
Replace "exec startxfce4" w/ "exec xfce4-session" in your xinitrc.
Offline
My bad about the image.
child process of xfce4-session (w/ a higher PID)
Not sure what this means. If you're talking about it branching off xfce4-session in the COMMAND column, I think that's caused by the -n argument. Xbindkey's PID is higher both with and without -n though.
ps fux output with -n
# sample of file
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
u4H 333 0.0 0.0 4008 2304 tty1 S+ 16:38 0:00 \_ xinit /home/u4H/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.bZmUgBwzfL
u4H 343 0.1 1.6 610456 65660 tty1 Sl 16:38 0:00 \_ xfce4-session
u4H 347 0.0 0.2 24224 9728 tty1 Sl 16:38 0:00 \_ xbindkeys -nps fux output without -n
# sample of file
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
u4H 330 0.0 0.0 4008 2304 tty1 S+ 16:42 0:00 \_ xinit /home/u4H/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.smB0CROPoB/tmp/serverauth.smB0CROPoB
u4H 340 2.5 1.8 610444 72240 tty1 Sl 16:42 0:00 \_ xfce4-session
u4H 351 0.0 0.1 24224 4712 ? S 16:42 0:00 xbindkeysWhen I run "xbindkeys" with "exec xfce4-session", ps fux outputs 2 xbindkey processes, with one of them showing up as "[xbindkeys] <defunct>". Nothing else seems to happen though, I still need to manually launch xbindkeys to get my keys to work.
ps fux output with xbindkeys & exec xfce4-session
u4H 330 0.0 0.0 4008 2304 tty1 S+ 16:53 0:00 \_ xinit /home/u4H/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.FaLbS6Du9O/tmp/serverauth.FaLbS6Du9O
u4H 340 0.3 1.8 610392 69968 tty1 Sl 16:53 0:00 \_ xfce4-session
u4H 344 0.0 0.0 0 0 tty1 Z 16:53 0:00 \_ [xbindkeys] <defunct>
u4H 347 0.0 0.1 24224 4720 ? S 16:53 0:00 xbindkeys/tmp/xbindkeys.log is empty in all the cases I mentioned.
Full ps fux outputs:
xbindkeys
xbindkeys -n
xbindkeys & xfce4-session
xbindkeys -n & xfce4-session
Last edited by js8cr3fk9 (2023-03-07 22:31:55)
Offline
…
xbindkeys &
sleep 5
exec xfce4-sessionDo you by any chance also run xbindkeys from https://wiki.archlinux.org/title/Xfce#Autostart ?
Offline
I just found out that "xbindkeys & startxfce4" kinda worked all along; however, I have to press something (any key) on my keyboard before xbindkeys launches, otherwise my xbindkeys keys won't work for the rest of the desktop session (without launching them again). I also tested this by creating a clickable launcher for xbindkeys to test it out, and it confirmed my guess.
Now I need to make it work without needing to manually press stuff. Maybe something has to be activated before xbindkey starts?
It doesn't seem to have anything to do with the commands in my .xbindkeysrc file. I changed my .xbindkeyscr file to the code below to test:
"ps fux > /home/u4H/Desktop/test"
XF86AudioMuteand the same thing I described above still happened.
Do you by any chance also run xbindkeys from https://wiki.archlinux.org/title/Xfce#Autostart ?
I tried that before and it didn't work out so I removed it from the autostart tab.
Last edited by js8cr3fk9 (2023-03-08 21:59:50)
Offline
Please post your Xorg log, https://wiki.archlinux.org/title/Xorg#General
Offline
I just found out that "xbindkeys & startxfce4" kinda worked all along; however, I have to press something (any key) on my keyboard before xbindkeys launches, otherwise my xbindkeys keys won't work for the rest of the desktop session (without launching them again). I also tested this by creating a clickable launcher for xbindkeys to test it out, and it confirmed my guess.
I just found out that the XF86 keys were causing this. I assigned a command to a normal key and it worked without a problem. Now I need to find out what's causing the problem with the XF86 keys.
Please post your Xorg log, https://wiki.archlinux.org/title/Xorg#General
Last edited by js8cr3fk9 (2023-03-08 22:27:33)
Offline
Please post your Xorg log, https://wiki.archlinux.org/title/Xorg#General
Thanks for the help seth.
It turns out that I just have to include the key's state and keycode (m:0x8 + c:32) in .xbindkeysrc for it to work, like:
"pamixer --toggle-mute"
m:0x0 + c:74
XF86AudioMuteinstead of:
"pamixer --toggle-mute"
XF86AudioMuteLast edited by js8cr3fk9 (2023-03-10 03:21:59)
Offline