LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Bash aliases won't autostart? (https://www.linuxquestions.org/questions/mandriva-30/bash-aliases-wont-autostart-220487/)

Ollir 08-21-2004 07:45 AM

Bash aliases won't autostart?
 
I know, I know, this is my about hundreth post about Konquaror autostart, but I just don't get it :( I have a working bash alias, the alias is named "liput". The .bashrc file reads like this:

alias liput="python rm.py -c 1 4"

How should I define the command in the Konqueror autostart to get the alias to start when kde starts? I have tried everything, and nothing actually works. But like a miracle, when manually using from terminal, the alias works like a charm. Any clues? I promise this was my last post concerning tha Autostart "feature"!

-Olli

320mb 08-21-2004 09:14 AM

Code:

alias liput='python rm.py -c 1 4'
try using single quotes...........like you see above

otish1000c 08-21-2004 09:22 AM

i don't know much about alias or bashrc, but have you tried just creating a symlink to the executable that you want to autostart, in the autostart directory? you can do it 2 ways...........

GUI method........
open Konqueror in normal (not root) file manager mode. navigate to the /.kde/autostart directory. on the top tool bar, click edit->create new->file->link to application. under "general" give it a name of your choice, under "application" name it the same, then in the "command" box, browse to the executable, put any special switches you might want to use, click "ok" when done.

terminal method..........
open a terminal, as normal user cd to /.kde/autostart. then type the following..........

ln -s /path/to/executable (hit enter)

where /path/to/executable is the path to the executable you want to run. you can also add any switches you want to use in the path.

otis

EDIT: oops............ i see 320mb has a suggestion too. as i said i'm not real familiar with aliases or bashrc, so try his suggestion first, as that might be a better way.

Ollir 08-21-2004 09:25 AM

The alias works fine from terminal, but I cannot get it to work as an "link to application" in .kde/Autostart/ -directory. So it can't be the quotes, I think. I just need to know how the simple liput -command should be entered to the "command" -field in the "link to application" properties window.

-Olli

Ghost_runner 08-22-2004 12:45 AM

i had to make a bash script for setiathome, maybe you need to do something similar. I put my alias after the call to /etc/bashrc for some reason the etc/bashrc would overwrite my alias. as to your shell script you can make

#!/bin/bash
python rm.py -c 1 4 &

then make a desktop icon link to application, then do

mv /home/[username]/Desktop/[application link name] /home/[username]/.kde/Autostart

and it should work for you. I know it's a bit of a hack, but it should work, if you want the program to autostart for you.
Btw, i use this method to make my background picture have rxvt running transparently over it.

Ollir 08-22-2004 03:04 AM

Thanks for your input people :) However, it just don't work... I didi both te ways you suggested and it basically gives me this error "exec failed: not a directory" I created this shell-script:

#!/bin/bash/
python rm.py -c 1 4 &

saved it as rm.sh and created a link to it. The name of the link was rm and the application field was also named a rm. It won't work by clicking or at kde startup, though it's in the .kde/Autostart -directory. I can't understand, what can be wrong. This seems to unnecessary, because the actual problem should be like making a cup of coffee. (that can be pretty hard too some times ;)

The file rm.sh is in my home directory, so there should be no problems with access priviledges.

Bear with me,

Olli

otish1000c 08-22-2004 08:09 AM

Quote:

The file rm.sh is in my home directory, so there should be no problems with access priviledges.
just because something is in /home, doesn't neccessarily mean that it has user priveledges. if it was created as root, it could/would have root permissions. i'd check that, just to be sure. right click the file, check the permissions tab, change if neccessary.

otis

Ghost_runner 08-22-2004 02:10 PM

I see the problem, you may not have python in a place in your path, you might have to edit your script thusly:

#!/bin/bash
/usr/bin/python /home/[username]/rm.py -c 1 4 &

then to make it run in kde, make the icon on your desktop, to create a rm.desktop object to do a

mv /home/[username]/Desktop/km.desktop /home/[username]/.kde/Autostart/km.desktop

assuming you name your desktop icon rm


All times are GMT -5. The time now is 12:47 AM.