Debian, LXDE & xmodmap

Soldato
Joined
8 Nov 2003
Posts
7,409
Location
UK
Hello,

I'm struggling with something that you guys would probably find really simple to do...

I'm trying attempting to launch a script that will run:

/usr/bin/xmodmap ~/.xmodmaprc

How hard can that be?

I've been on this page: http://crunchbanglinux.org/forums/topic/2614/autostart-applications-when-openbox-starts/

But I don't have an autostart file in this directory: ~/.config/openbox/

So I have created one and just put in

ob-autostart -d &

and saved it as that.

The application looks pretty good but I don't think it likes it when I put in the commandline that I want ie. /usr/bin/xmodmap/ ~/.xmodmaprc


Please help a tard
 
Right... the file should be called autostart.sh and you can put your commands into it - e.g.
Code:
#!/bin/bash
xmodmap ~/.xmodmaprc &
ob-autostart -d &   <<<< dunno what that's for....

The file doesn't need any special permissions.

Also - I believe that the default config file for xmodmap is .Xmodmap IIRC - and it calls that by default.
 
Hi,

Where should this file be? I've tried adding the command onto the only autostart.sh file that I could find which is in:

/etc/xdg/openbox Which contains:

Code:
# This shell script is run before Openbox launches.
# Environment variables set here are passed to the Openbox session.

# Set a background color
BG=""
if which hsetroot >/dev/null; then
    BG=hsetroot
else
    if which esetroot >/dev/null; then
	BG=esetroot
    else
	if which xsetroot >/dev/null; then
	    BG=xsetroot
	fi
    fi
fi
test -z $BG || $BG -solid "#303030"

# D-bus
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi

# Make GTK apps look and behave how they were set up in the gnome config tools
if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then
  /usr/libexec/gnome-settings-daemon &
elif which gnome-settings-daemon >/dev/null; then
  gnome-settings-daemon &
# Make GTK apps look and behave how they were set up in the XFCE config tools
elif which xfce-mcs-manager >/dev/null; then
  xfce-mcs-manager n &
fi

# Preload stuff for KDE apps
if which start_kdeinit >/dev/null; then
  LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
fi

# Run XDG autostart things.  By default don't run anything desktop-specific
# See xdg-autostart --help more info
DESKTOP_ENV=""
if which /usr/lib/openbox/xdg-autostart >/dev/null; then
  /usr/lib/openbox/xdg-autostart $DESKTOP_ENV
fi

I also have an autostart folder in /etc/xdg which contains "gnome-at-session.desktop" and "wicd-tray.desktop"

Also there is an autostart file without the .sh in /etc/xdg/lxsession/LXDE which contains:

Code:
lxde-settings
@xscreensaver -no-splash
@lxpanel --profile LXDE
@pcmanfm -d
 
Last edited:
I just created it in that directory... didn't work :(

Even tried putting in the full directory of xmodmap to no avail. Any suggestions mate?

All I'm trying to do is use the keyboard hotkeys, i.e play, stop, previous & next for Amarok without having to go into the terminal everytime I reboot...
 
Not sure what you mean.

The only thing I have done to my system tray is enable the wicd icon next to the clock lol

I've been using Linux for about a year now, but only for browsing and E-mail. It's only till recently that I'm making an effort to actually try and learn.

Keytouch... I'll look into that. Thanks
 
really - ~/.config/openbox/autostart.sh should do the job, so you should look into why it's not being called... although the global one you added it to should also be called - so there's something wrong here. I see no reason why it's failing, try adding another command to it (like firefox or something) and restarting it to see if that works.

If you cba installing keytouch, you could also add the command into ~/.Xinitrc (which also doesn't exist by default normally).

Also... did you add the initial line (shebang) to autostart.sh (#!/bin/bash - I assume you're using bash)
 
Last edited:
Hello,

Yeah I copied and pasted all that...

Anywho, I installed that keytouch program and it works beautifully. Wish I had known about it a while back lol. The internet key doesn't work but I'm not fussed about that tbh!

I'll try adding firefox to autostart.sh see if that works then

Cheers buddy
 
use "xev" to see if the internet key is recognised. If it is, then you can get that to work as well.

Also - get back to us on the firefox thing... autostart.sh accepts whole lines of commands... mine has a three line string in it!
 
Nope, that didn't work either.

Code:
#!/bin/bash
firefox &
/usr/lib/iceweasel/firefox-bin -a iceweasel &
/usr/lib/iceweasel/firefox-bin &

Wasn't sure exactly how to get it going so I put every combo in there :o

EDIT: Yes, Internet key works fine. It's keycode 130.
 
Sure

Code:
gaz:/home/gaz# ls -l ~/.config/openbox
total 28
-rw-r--r-- 1 root root   101 2009-09-09 21:22 autostart.sh
-rw-r--r-- 1 root root 21767 2009-08-06 21:42 lxde-rc.xml
 
Don't know if you're too bothered any more... but if you are (and I'm off to bed shortly... so if you are, I can carry this on tomorrow)

First off - stop working as root when making config changes for stuff you don't need root for... that won't affect this, as "others" have read perms on the files - but it's good practice (generally don't work as root unless you have to).

next... might be an idea to
Code:
# chown -R gaz /home/gaz/config
(I can never remember if this is the one that needs "R" instead of "r" - it will tell you though!)

Then add
Code:
sleep 3 && firefox &
to your autostart file. It's possible that your commands are starting too quickly (i.e. before the wm is available), so we've told it to wait three seconds.
 
Sorry - double post


I shall give that a go mate. And yes it's bugging me lol.

Rebooting now...

EDIT: Didn't work :(

Code:
ls -l ~/.config/openbox

Still shows the same output...

(I can never remember if this is the one that needs "R" instead of "r" - it will tell you though!)

It's 'R'.
 
Still shows the same output...

Yeah - the "#" at the start of the command means run this as root. If you see a "$" at the start, it means run as user :)

Also - you shouldn't need to reboot, just restart Openbox.

Will have to think about this one a bit more...
 
Back
Top Bottom