You are not logged in.
Hello everyone
I am trying to get xbindkeys to start when I login to my system but no luck. I created the directory ~/.config/systemd/user and created a service file as follows:
[Unit]
Description=Start xbindkeys service.
[Service]
ExecStart=/home/jesc/Documents/Bash/start_xbindkeys.sh
[Install]
WantedBy=default.targetmy start_xbindkeys.sh file is as follows:
#!/usr/bin/env bash
xbindkeysIm not getting any errors (to the best of my knowledge) from journalctl
Mar 09 20:35:43 jonny-arch systemd[556]: Started Start xbindkeys service..
Mar 09 20:36:24 jonny-arch systemd[556]: Stopped Start xbindkeys service..No errors that I can see when showing the status of my service:
[jesc@arch system]$ systemctl --user status start_xbindkeys.service
● start_xbindkeys.service - Start xbindkeys service.
Loaded: loaded (/home/jesc/.config/systemd/user/start_xbindkeys.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2016-03-09 20:35:43 EST; 7min ago
Process: 2885 ExecStart=/home/jesc/Documents/Bash/start_xbindkeys.sh (code=exited, status=0/SUCCESS)
Main PID: 2885 (code=exited, status=0/SUCCESS)
Mar 09 20:35:43 jonny-arch systemd[556]: Started Start xbindkeys service..
Mar 09 20:36:24 jonny-arch systemd[556]: Stopped Start xbindkeys service..I stopped the service to see if changing "ExecStart=/home/jesc/Documents/Bash/start_xbindkeys.sh" to "ExecStart=/home/jesc/Documents/Bash/./start_xbindkeys.sh" would do anything but it didnt. If i run the script manually it works.
Can someone please help me out?
Thanks
Offline
Simply add xbindkeys to your .xinitrc or startup file of your desktop environment. This will start xbindkeys as soon as you start your x-server or DE. This way you can define different keys on different DEs
Arch is home!
https://github.com/Docbroke
Offline
xbindkeys has to be run from within an x session - that service file does not run it from within an x session.
Your script runs to completion which is probably why systemctl doesn report any errors. But if you were to log the output of the xbindkeys command, you would see that it is failing.
Also there's not much point in running env to call bash to call xbindkeys when you could just run xbindkeys in the first place (although still not from this service file: either put xbindkeys in xinitrc or follow these instructions for the service file).
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Online
Simply add xbindkeys to your .xinitrc or startup file of your desktop environment. This will start xbindkeys as soon as you start your x-server or DE. This way you can define different keys on different DEs
added xbindkeys to .xinitrc but no cigar
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh; do
[ -x "$f" ] && . "$f"
done
unset f
fi
twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
xbindkeys
exec xterm -geometry 80x66+0+0 -name logini also tried
exec xbindkeysbut nothing.
This is the .xinitrc file in my home directory btw (~/.xinitrc)
Offline
You're obviously not using startx, so .xinitrc isn't going to do anything. Use your WM/DE setup.
Offline
You're obviously not using startx, so .xinitrc isn't going to do anything. Use your WM/DE setup.
What am I doing wrong ![]()
i tried adding "xbindkeys" to the following files with reboots after each change.
~/.xinitrc
~/.config/xfce4/xinitrc
/etc/lxdm/lxdm.conf
/etc/lxdm/XsessionI am using xfce4 with lxdm as my display manager.
I just want to start xbindkeys when I log in ![]()
Offline
Offline
Unfortunately that worked. I really wanted to get this done through systemd as Im trying to get myself familiar with it. I mean its just a simple command I want to initiate once I log in.
BTW; Startup applications created a file in ~/.config/autostart/xbindkeys.desktop
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=xbindkeys
Comment=Start xbindkeys service.
Exec=xbindkeys
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=falseI really want to get this done with systemd. Ill play with it tomorrow again.
Offline
Please read the reply posted by Trilby again, in post 3, that is what you are looking for. Xbindkeys cannot start when x-server is not running, while systemd services start before x (unless you specify positively for service to start after x)
Arch is home!
https://github.com/Docbroke
Offline
Unfortunately that worked.
Yeah, don't you just hate when that happens.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Online