LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   running at kde startup (https://www.linuxquestions.org/questions/linux-newbie-8/running-at-kde-startup-392315/)

spx2 12-13-2005 08:01 AM

running at kde startup
 
i just tried almost everything to make a bash script run at kde startup
i tried to put it in .kde/Autostart a symbolic link i tried to put
the script also
didnt work.

I dont know what to do.
i just need these settings for only a user not all of them

fouldsy 12-13-2005 08:33 AM

That should be the right place, but are you sure that the correct permissions are set on the bash script itself to allow it the be executed by a normal user? What is it the script contains and so is trying to do?

spx2 12-13-2005 08:43 AM

the script asks permission of the user with y/n answer
to open a bunch o programs
if it gets y it runs them and closes
else it returns user control over shell
here is the script
http://www.linuxquestions.org/questi...d.php?t=392237
last post

you talk about permissions
do you think i should go root with su
and make some chmod +777 bashscript first ?

fouldsy 12-13-2005 08:57 AM

If the script can be ran fine from the command line as user, that's enough - it shouldn't need root permissions for launching apps as your script does.

However, I'm not sure whether the KDE autostart allows you to run interactive shell apps like yours, as it doesn't actually display the shell on screen to allow you make your selection. I don't know how to enable interactive scripts like that even through a console login I'm afraid, or even if it's possible.

PTrenholme 12-13-2005 09:18 AM

Try making a desktop icon with this in the "Application" entry:
Code:

konsole -noclose -e <your script>
If that works (from the desktop), just move the .desktop file from ~/Desktop to ~/.kde/Autostart

(The "-noclose" option leaves the konsole open after the command termination, so you might not need it.)

Let us know if it works, please. (I haven't done this yet myself.)

Edit: O.K., I just tried it (with a sudo <command> and no -noclose), and it prompted me for the input (i.e., the sudoer password), ran the script, and vanished. Cool!

spx2 12-14-2005 02:12 AM

No it doesnt work.

spx2 12-14-2005 02:29 AM

i dont know how you made it run.
i dont understand you 100% from the post.
please be more explicit.
and also another question my user stef is not in list of sudoers
at least thats what the bash says if i do sudo <somecommand> it asks for pass
i give pass and it says its not it list of sudoers.
what do i do to make it be ?

berbae 12-14-2005 09:33 AM

Here is the format of the .desktop file

[Desktop Entry]
Exec=konsole -e <your script>
Name=Interactive script
Type=Application
X-KDE-StartupNotify=false

Put the file in ~/.kde/Autostart

and restart KDE

PTrenholme 12-14-2005 09:34 AM

Quote:

Originally Posted by spx2
i dont know how you made it run.
i dont understand you 100% from the post.
please be more explicit.

O.K., here's a "step-by-step:"

1. Bring up your desktop menu and select Settings->Desktop->Behavior. Check your button assignments to see where the "Desktop Menu" is assigned. (Mine is assigned to the right-hand button, so that's why I refer to a "right-click" below.)

2. Go to an empty spot on your desktop and click on it with your right-hand button to display the "Desktop Menu."

3. Select "Create New"->"Link to Application" from the displayed desktop menu.

4. Click on the "Application" tab in the displayed "Properties" box.

5. In the "Command" box displayed after (4), enter konsole -e <the full path to the script you want to run> <any arguments needed by the script> where, of course, the angle brakets ("<" and ">") and the text are replaced with the actuall path to the script you want to executate and, if you need them, the actual arguments. (Note that the script should be execuatable. Use the chmod command to make it so.)

6. Fill in the description under the "General" tab (to be displayed under the icon, and the name of the .desktop file you're creating), and -- if you wish -- the "Description" and "Comment" in the "Application" tab (for the pop-up).

7. Also, if you wish, click on the icon displayed in the general tab and select an icon to be used on the desktop from the displayed list of available icons.

8. Close the "Properties" window. You should now see a new icon on you desktop.

9. Click on the new icon to execute it. (Um, my system is set for single-click operation. You may need to double-click.)

10. If the new icon works properly, open "Konqueror," and move the icon's .desktop file from ~/Desktop to ~/.kde/Autostart.

Quote:

Originally Posted by spx2
and also another question my user stef is not in list of sudoers
at least thats what the bash says if i do sudo <somecommand> it asks for pass
i give pass and it says its not it list of sudoers.
what do i do to make it be ?

Look at info sudoers for a description of the contents of /etc/sudoers and info visudo for information on how to edit it. (You can actually use other editors, but visudo is set up to do some checking for you.) Note that you must be "root" to make any changes in /etc/sudoers, and granting of root privileges to users in, generally, not a good thing.

PTrenholme 12-14-2005 09:44 AM

Quote:

Originally Posted by berbae
Here is the format of the .desktop file

[Desktop Entry]
Exec=konsole -e <your script>
Name=Interactive script
Type=Application
X-KDE-StartupNotify=false

Put the file in ~/.kde/Autostart

and restart KDE

Yes, you can create your desktop file by hand, if you wish. F.Y.I., here's what my test file looks like (created as discribed above, not by hand):
Code:

$ cat Desktop/Remount\ SMB\ shares.desktop
[Desktop Entry]
Comment=
Comment[en_US]=
Encoding=UTF-8
Exec=konsole -e sudo /etc/rc.d/remountsmb
GenericName=Remount SMB shares
GenericName[en_US]=Remount SMB shares
Icon=
MimeType=
Name=Remount SMB shares
Name[en_US]=Remount SMB shares
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DCOP-ServiceType=
X-KDE-SubstituteUID=false
X-KDE-Username=


mr fidget 01-04-2006 05:20 AM

Quote:

Originally Posted by PTrenholme
O.K., here's a "step-by-step:"

THANKS! This is a great explanation!

I used it to start hotkeys and it works wonderfully.

The only things I would like to point out is that I had to remove the konsole -e part and just use the <program> <parameters> bit.

All the best.


All times are GMT -5. The time now is 07:33 PM.