How do I turn a terminal command into a desktop icon?

Discussion in 'Modding and Customization' started by softhook, Nov 8, 2008.

  1. softhook

    softhook

    Joined:
    Oct 19, 2008
    Messages:
    2
    Likes Received:
    0
    Hi there.

    I would like to launch an application:
    /usr/share/processing-0148/./processing

    From the acer desktop with an icon. Can someone tell me how to do that?

    thanks
    Christian
     
    softhook, Nov 8, 2008
    #1
    1. Advertisements

  2. softhook

    will103

    Joined:
    Dec 1, 2008
    Messages:
    2
    Likes Received:
    0
    Hi,

    Create a file using your favored text editor and input the following text:

    #! /bin/bash

    mousepad

    exit 0

    Then in thunar right click on the file and under 'properties' select permissions and choose for the file to be executable. I have no idea how to change the default file icon though.

    All the best, will103
     
    will103, Dec 2, 2008
    #2
    1. Advertisements

  3. softhook

    mac_mac

    Joined:
    Nov 11, 2008
    Messages:
    1
    Likes Received:
    0
    So do we save this text file some place?
    What do we call it?
    Where do we save it?
    Is there a space between ! and / in the first line?
    Is this file 3 lines of text or are there other instructions?
    How does this relate to terminal command?

    Thank you
    mac
     
    mac_mac, Dec 4, 2008
    #3
  4. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0
    I wanna know this too!

    Anyone?
     
    lali, Dec 14, 2008
    #4
  5. softhook

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    Can we start again - I'm not quite sure what the previous set of instructions was meant to achieve.

    Three questions first:
    • are you using the standard Acer desktop or the advanced one? [/*:m:93lamxyz]
    • Where has this program you want to execute come from? (If it's been installed from a package there is probably already a 'desktop' file we can use, if not we'll have to create one)[/*:m:93lamxyz]
    • Have you got a suitable icon ready?[/*:m:93lamxyz]
     
    daldred, Dec 14, 2008
    #5
  6. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0
    Well, in my case I have installed a windows program, and I like to run it in Wine. (yes acer's default (sort of))
    I have made a desktop-file and aligned an icon for it and put the icon in the correct bin in the desktop, everything's fine but it can't execute the command:
    Code:
    sudo wine "C:\Program Files\Spotify\spotify.exe"
    I think I have to execute a file (shell script?) with the command in it rather then the command itself?

    Happy for help.
     
    lali, Dec 15, 2008
    #6
  7. softhook

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    So we're talking the basic desktop, and you've edited the group-app.xml file to change the icons etc...

    What does your .desktop file say on the 'Exec=' line? (And why do you need sudo to run this?)

    Having just looked at the spec for desktop files including highly special (to Linux) things like backslashes, I think the Exec line should be:

    Code:
    Exec=wine "C:\\\\Program Files\\\\Spotify\\\\spotify.exe"
    (Yes, that's four backslashes each time. I assume that wine is in your standard $PATH: that is, if you just run the command 'wine' from any terminal prompt, you get a brief message about how to use wine).
     
    daldred, Dec 15, 2008
    #7
  8. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0
    When I try the desktop-file without the sudo the terminal says: /home/user/.wine is not owned by you.


    Same problem, wine is not owned by me, I tried sudo and got the message
    and that is after I changed to the four backslashes...

    If I just type wine "C:\Program Files\Spotify\spotify.exe" in a terminal window the program starts without any hassle.

    So, right now I have the four slashes command on my Exec-line. :?
     
    lali, Dec 15, 2008
    #8
  9. softhook

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    Sounds like you may first have run the wine config as root. Try making the .wine directory yours:

    Code:
    sudo chown -R user:user /home/user/.wine
    and see if that helps.
     
    daldred, Dec 15, 2008
    #9
  10. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0

    The diroctory does'nt seem to belong to me now either...

    Should the program run in terminal?

    my desktop-file:

    Code:
    [Desktop Entry]
    Name=spotify
    Comment=Spotify
    Exec=wine "C:\\\\Program Files\\\\Spotify\\\\spotify.exe"
    Icon=spotify
    Terminal=false
    Type=Application
    Encoding=UTF-8
    Categories=Network;Application;
    GenericName=Spotify
     
    lali, Dec 16, 2008
    #10
  11. softhook

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    If you've run the command above, it should belong to you. Start a terminal and do

    Code:
    ls -l .wine
    If it doesn't belong to you, we need to get that sorted first.
     
    daldred, Dec 16, 2008
    #11
  12. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0
    My result:
    Code:
    [[email protected] ~]$ ls -l .wine
    total 488
    drwxrwxrwx 2 user user   4096 2008-12-14 20:09 dosdevices
    drwxrwxrwx 4 user user   4096 2008-12-14 20:09 drive_c
    -rw-rw-r-- 1 user user 457658 2008-12-14 23:08 system.reg
    -rw-rw-r-- 1 user user   2346 2008-12-14 23:08 userdef.reg
    -rw-rw-r-- 1 user user  22548 2008-12-14 23:08 user.reg
    
     
    lali, Dec 16, 2008
    #12
  13. softhook

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    OK, so thye do belong to you!

    Now in your desktop file, let's try two thing:

    First, it may well not need the quotes. Try taking them out and see if that helps.

    If not, try changing 'terminal' to true. That should at least give us a terminal with any error messages in it.

    If all that doesn't work, the final try will be to set up a script to run the program, and call that from the desktop file instead, but that is a long way round!
     
    daldred, Dec 16, 2008
    #13
  14. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0
    Terminal still tells me I'm not the owner. =/
    When I sudo without the quotes it now halt on the space in Program Files, telling med it cant find 'C:\Program'

    When i run the file with terminal as true, a terminalwindows pops up and disapears, when I try to start the file from a terminal window, I get the message that the file dos'nt exist or i have not the permission to the file.

    I appriciate you'r help!
     
    lali, Dec 16, 2008
    #14
  15. softhook

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    OK, so what exactly is the error it gives?

    (We'll crack this yet....!)
     
    daldred, Dec 16, 2008
    #15
  16. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0
    With sudo in the exec
    Code:
    wine: cannot find 'C:\Program Files\Spotify\spotify.exe'
    Without the sudo in exec
    Code:
    wine: /home/user/.wine is not owned by you
     
    lali, Dec 16, 2008
    #16
  17. softhook

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    Hmm. On the ownership side still, can you post part of the result of

    Code:
    ls -la
    in a terminal? The only line I'm interested in is the one for the .wine directory, which should look something along the lines of

    Code:
    drwxr-xr-x  3 user user    4096 2008-09-02 23:42 .vlc
    (That's obviously my .vlc directory - I haven't installed wine on the One).
     
    daldred, Dec 17, 2008
    #17
  18. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0
    There I have full rights.

    Code:
    drwxrwxrwx  4 user user  4096 2008-12-16 16:08 .wine
     
    lali, Dec 17, 2008
    #18
  19. softhook

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    This is wierd indeed.

    I'm wondering whether the best thing is to junk the wine setup and recofigure wine. This may mean you then have to reinstall your spotify program too..

    To junk & reconfigure, delete the .wine directory and run the configuration utility *as yourself, not root*:

    Code:
    rm -rF .wine
    winecfg
    If the first command there (the deletion) fails wsith complaints anbout permissions or ownership, use sudo before it to force it as root.

    Running winecfg as yourself should create all the wine setup you need to run it as yourself, not as root.
     
    daldred, Dec 17, 2008
    #19
  20. softhook

    lali

    Joined:
    Nov 7, 2008
    Messages:
    16
    Likes Received:
    0
    Same message in terminal. /home/user/.wine is not owned by you.

    u think it has to do with how i am accessing the file? I go to terminal
    Code:
    sudo thunar /usr/share/applications
    i does'nt know any other way to access that folder.

    when I try to run the program from it's desktop icon nothing at all happens.

    =/
     
    lali, Dec 17, 2008
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.