You are not logged in.
Pages: 1
I wrote a service file to start the trackpad on my laptop when it boots. It executes a script I put in /bin that by itself works fine.
This is the script:
#!/bin/sh
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 8 2
#xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 8 200
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 8 6 7 4 5
and here is the service file
[Unit]
Description=Starts trackpoint script
After=display-manager.service
[Service]
ExecStart=/bin/trackpoint
[Install]
WantedBy=multi-user.target
when I add it to be started and reboot, it does not work. The following is the output of systemctl status trackpoint.service
trackpoint.service - Starts trackpoint script
Loaded: loaded (/etc/systemd/system/trackpoint.service; enabled)
Active: failed (Result: exit-code) since Wed 2013-02-13 10:04:01 EST; 9min ago
Process: 391 ExecStart=/bin/trackpoint (code=exited, status=1/FAILURE)
Feb 13 10:04:01 thinkpad trackpoint[391]: Unable to connect to X server
Feb 13 10:04:01 thinkpad trackpoint[391]: Unable to connect to X server
Feb 13 10:04:01 thinkpad trackpoint[391]: Unable to connect to X server
I'm not sure if there is something wrong with the script, which works when executed normally, or if it is my service file. Any help would be greatly appreciated.
Offline
I'm assuming that xinput requires x to be running?
If so, you're probably best off putting those commands in .xinitrc. The systemd multi-user.target is recahed before X starts.
You could look into when the graphical target is reached, if you boot directly into X as that may be after X is started.
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
I'm assuming that xinput requires x to be running?
If so, you're probably best off putting those commands in .xinitrc. The systemd multi-user.target is recahed before X starts.
You could look into when the graphical target is reached, if you boot directly into X as that may be after X is started.
I tried putting the script into .xinitrc, and the commands individually, and none of it worked. I also played around with the target a bit and that didn't change anything. It might just be that xinput is a bad way of doing what I'm trying to do, so I am going to look in to other solutions as well as trying to get this one to work.
Offline
First off, what display manager and DE are you using? Some of them ignore .xinitrc.
Make sure to put these comand before the line that starts your window manager.
'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard
Offline
I also recommend .xinitrc, but if you want to use a service file, you'll need to include the User= line and ensure it runs after X is running.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Online
It seems like the service file is a bad idea. My .xinitrc is posted below, what should I add and where to execute the script? Or should I just add the lines in the script directly to it?
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
exec gnome-session-cinnamon
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice
Offline
This would be easier imo.
You're just jealous because the voices only talk to me.
Offline
If you want to do it with systemd, you have to use systemd user session.
"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.
Offline
This would be easier imo.
Thanks, that did it, and it was much simpler.
Offline
Pages: 1