Author Topic: autostarting a script  (Read 354 times)

jalu

  • Member Level 4
  • *
  • Posts: 214
    • View Profile
    • Email
autostarting a script
« on: February 28, 2010, 01:38:43 AM »
i got two short questions.
first:
i need to autostart a script of mine. its only purpose is to autostart dropbox.
(its as easy as:
#!/bin/sh
dropbox start
exit 0)
i added it via the applications-menu (left-click; settings, settings-panel, apps, add new) and have choosen it afterwards form startup-applications.
a) is that correct? and b) would it be better to choose /home/markus/bin/start_dropbox or /usr/local/bin/start_dropbox. (i guess it doesnt matter...).

my second question is a bit of a shame. i simply don't get it. icons and that.
ok: i left-click on the desktop, choose applications, choose applications again and go to editors.
there i got nano and gedit. may i change the icons for those entries in the menu? i guess yes, but where?
(i could swear it will get down to the .desktop-stuff again... oh my).
Logged

Rui Pais

  • Member Level 1
  • *
  • Posts: 21
    • View Profile
Re: autostarting a script
« Reply #1 on: February 28, 2010, 06:17:30 PM »
i got two short questions.
first:
i need to autostart a script of mine. its only purpose is to autostart dropbox.
(its as easy as:
#!/bin/sh
dropbox start
exit 0)
i added it via the applications-menu (left-click; settings, settings-panel, apps, add new) and have choosen it afterwards form startup-applications.
a) is that correct? and b) would it be better to choose /home/markus/bin/start_dropbox or /usr/local/bin/start_dropbox. (i guess it doesnt matter...).

hi,
well on such basic script you could even add dropbox to startup applications, provided that you have/make a desktop file for it (Settings > Apps > New Aplication)

for your script to work it should be executable (run: chmod +x /path/to/script) and be on path (run: echo $PATH to check). Some distro don't have /usr/local/bin on path, and your personalized "/home/markus/bin/start_dropbox" should be manually added there.

my second question is a bit of a shame. i simply don't get it. icons and that.
ok: i left-click on the desktop, choose applications, choose applications again and go to editors.
there i got nano and gedit. may i change the icons for those entries in the menu? i guess yes, but where?
(i could swear it will get down to the .desktop-stuff again... oh my).
How is icons desktop done? e17 efm? an other file manager thunar/nautilus/rox? ...
Logged

jalu

  • Member Level 4
  • *
  • Posts: 214
    • View Profile
    • Email
Re: autostarting a script
« Reply #2 on: February 28, 2010, 11:33:25 PM »
if i understand you correct i did autostart dropbox the way you say. it autostarts, so that should be fine.

i don't use desktop icons. after installation i go to menu, settings, settings-panel, files.... and deselect "show desktop icons".
i usually got nautilus and pcmanfm installed (and nautilus only cause it comes with gnome-core).
Logged

Rui Pais

  • Member Level 1
  • *
  • Posts: 21
    • View Profile
Re: autostarting a script
« Reply #3 on: March 02, 2010, 10:54:03 PM »
i don't use desktop icons. after installation i go to menu, settings, settings-panel, files.... and deselect "show desktop icons".
i usually got nautilus and pcmanfm installed (and nautilus only cause it comes with gnome-core).
Ah, ok. Now i understand your question.
You mean icons on menu entries, not on desktop (i was confused by your example, referring the menu usual to Debian, i don't have an editors section, i forget that...)

Icons are set by .desktop files that are at folder /usr/share/applications/
To change the icons you can edit desktop file (with a text editor) but that 's not a good way, since an update can put things back again.

A better way it's copy the desktop file to ~/.local/share/applications/ and edit the new file.
It's a permanent change that overpass the defaults global one on /usr/share/... It's also, of course, a per-user change.

HTH


PS btw if you want to launch nautilus without bring the gnome desktop run it: nautilus --no-desktop
« Last Edit: March 02, 2010, 10:55:34 PM by Rui Pais »
Logged

jalu

  • Member Level 4
  • *
  • Posts: 214
    • View Profile
    • Email
Re: autostarting a script
« Reply #4 on: March 03, 2010, 11:32:39 AM »
thank you.
/usr/share/applications to /home/me/.local/applications
i will do. not sure why i got such problem with it, but it just it that way: i don't get it...once it works (somehow) i forget it again...

well: i could have been more clear, i thought i would be by using an example and forgot that others got other menus. lol. my fault.

thanks.
Logged

jalu

  • Member Level 4
  • *
  • Posts: 214
    • View Profile
    • Email
Re: autostarting a script
« Reply #5 on: March 03, 2010, 11:37:35 AM »
just a site note, i'm not much of a file-manager user anyway: i did do it with nautilus --no-desktop, and that did work well.
i tried to do a "script" in $home/bin:

#!/bin/sh
#name: nautilus
nautilus --no-desktop  $@
exit 0

and variatons of it. that did not work, so i ended up with using pcmanfm.
Logged

jalu

  • Member Level 4
  • *
  • Posts: 214
    • View Profile
    • Email
Re: autostarting a script
« Reply #6 on: March 08, 2010, 08:31:16 PM »
setting the menu-icon didn't work.
here you can see the icon for gedit:
http://img52.imageshack.us/img52/3297/emenu.png

here is my entry:
Quote
markus@desktop-sid$ cat .local/share/applications/gedit.desktop
[Desktop Entry]
Hidden=false
Exec=gedit %U
Icon=/home/m1arkust//Icons/Zenicons_0.2/32/Apps/Transparent/Abiword.png
Type=Application
NoDisplay=false
Version=1.0
MimeType=text/plain;
StartupNotify=true
GenericName[en_US]=gedit
Comment=Edit text files
Categories=GNOME;GTK;Utility;TextEditor;
Terminal=false
Name=gedit
GenericName=gedit
Icon[en_US]=/home/m1arkust//Icons/Zenicons_0.2/32/Apps/Transparent/Abiword.png
Name[en_US]=gedit
Comment[en_US]=Edit text files

the Zenwords-icon Abiword.png  may be seen in the Ibar on the shot.
not much of a big deal, but a bit annoying.
Logged