LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How do I create a script to start up in .kde/Autostart? (https://www.linuxquestions.org/questions/slackware-14/how-do-i-create-a-script-to-start-up-in-kde-autostart-260320/)

Slovak 11-28-2004 08:02 PM

How do I create a script to start up in .kde/Autostart?
 
I want to put this in there instead of .xinitrc

xmodmap -e "pointer = 1 2 3 6 7 4 5"

CroMagnon 11-28-2004 08:34 PM

Have you tried just doing this?

Code:

cat > ~/.kde/Autostart/mybuttons << EOF
#!/bin/bash
xmodmap -e "pointer = 1 2 3 6 7 4 5"
EOF
chmod 700 ~/.kde/Autostart/mybuttons

I don't know for sure that this would work, but it seems like the most obvious thing to try first.

Slovak 11-28-2004 08:45 PM

What I did was just create a file in .kde/Autostart with this in it...
#!/bin/bash
xmodmap -e "pointer = 1 2 3 6 7 4 5"
saved it and it auto saved as a shell script, I removed the one from .xinitrc and rebooted thinking all would be well, boy was i wrong. The mouse worked all right, but my scroll up and down now acted as foreward and back, and my foreward and back buttons acted as scroll :confused: on my 7 button mouse. So I deleted my new script file and put it back in .xinitrc located in /etc/X11/xinit and it works right again.

CroMagnon 11-28-2004 08:59 PM

I might be steering you wrong (I didn't even know about the Autostart folder until you mentioned it), but did you make sure the script had execute permissions?

I can't do any testing for another couple of hours, so post a reply and I'll check back in after I get something working at home.

Slovak 11-28-2004 09:35 PM

I don't know how to give it execute permissions.

tw001_tw 11-28-2004 10:00 PM

"chmod 700 ~/.kde/Autostart/mybuttons"

chmod 700 makes a script exacutable.

-tw

CroMagnon 11-29-2004 03:57 AM

Just in case you're waiting for my results, setting the script executable worked perfectly for me. Just type the command tw posted, and everything should be fine. An alternative command (that does almost the exact same thing) is:
Code:

chmod u+x ~/.kde/Autostart/mybuttons

Slovak 11-29-2004 04:05 PM

Didn't work for nothing for me, same deal with buttons being reversed, scroll is fwd and back, fwd and back is scroll.

CroMagnon 11-29-2004 06:55 PM

When you're in X with the dodgy button setup, if you open a terminal and run that xmodmap command, does it fix the problem? (It should take effect instantly).

If it does, double and triple check the permissions on your script (ls -l ~/.kde/Autostart - you should see something like: "-rwx------ (usernames, sizes, etc) mybuttons". If that's ok, add an extra command to your script to make sure it's running when you log in... something like "touch ~/yes_i_am_running".

Slovak 11-30-2004 04:21 AM

I'll double check it when I get home tonight, I've been pretty busy lately.

Slovak 11-30-2004 05:12 PM

I got it, I have no idea what went wrong the first time I tried it, but it works this time. Thanks for the help. I think what I did wrong the first time was doing this as root, instead of user...

cat > ~/.kde/Autostart/mybuttons << EOF
#!/bin/bash
xmodmap -e "pointer = 1 2 3 6 7 4 5"
EOF
chmod 700 ~/.kde/Autostart/mybuttons

This time I did it as user and all is well, thanks again.

CroMagnon 11-30-2004 06:21 PM

Heh... if you did it as root, then the ~ part would expand to root's home directory instead of your own, so the file would be created in the wrong place :)


All times are GMT -5. The time now is 02:13 AM.