Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to run some bash commands in my .xinitrc script, but the window manager starts without these commands running properly.

I run Arch Linux with the window manager is called "awesome", and I start it with startx. This is the entirety of my ~/.xinitrc file:

#!/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

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

rfkill block bluetooth

# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice
exec awesome

As you may have noticed, I'm trying to shut down my Bluetooth and activate trackpoint scrolling on my laptop. Each of those xinput and rfkill commands work when entered manually, but nothing happens when I run startx.

What on earth is the problem here? :(

share|improve this question
    
At least rfkill needs root privileges, if I'm not mistaken. Are you sure rfkill block bluetooth works on your system with user rights? –  Marco Dec 10 '12 at 21:47
    
Are these commands producing any errors? Could it be that they're working, but something later in your session startup overrides these settings? Try launching just an xterm instead of a window manager, while you're testing that. –  Gilles Dec 10 '12 at 23:23
    
@Gilles I tried starting only xterm (I replaced exec awesome with exec xterm) but I am presented with a completely blank terminal with no errors... –  Joshua Dec 10 '12 at 23:40
    
@Marco rfkill does indeed require root privileges, but I assumed that .xinitrc was run as root. If I can't rfkill in .xinitrc, where should I run it? –  Joshua Dec 10 '12 at 23:42
    
@Joshua You should be able to type commands in this terminal. The .xinitrc is your session initialization file, it most assuredly is not executed as root. If you want something to be executed as root, it should be in the system startup, not in your session's startup. –  Gilles Dec 10 '12 at 23:45

2 Answers 2

Urgh...the underlying problem was really trivial.

rfkill requires root privileges, so it wouldn't run properly.

The reason my xinput commands didn't work was because of a typo in the device name. It should be "TrackPoint" not "Trackpoint". xinput just silently failed.

Damn it, that took way longer than I'm proud of.

share|improve this answer

Look at ~/.xsession-errors. The output of .xinitrc is redirected there, so any errors that are encountered should show up there and will help you debugging your script.

share|improve this answer
    
There is no such file for me. I tried to find it as well... –  Joshua Dec 10 '12 at 23:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.