Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 58

Thread: Unity launcher button

  1. #11
    Join Date
    Aug 2013
    Beans
    4,941

    Re: Unity launcher button

    Quote Originally Posted by Skaperen View Post
    now, how to get the button to appear. or, perhaps, how to get Unity to reload its .desktop files. file managers can be notified when things show up in the directory it has open. so, why can't Unity do this with ~/.local/share/applications?
    I am not sure what you are asking, I suppose by "the button" you mean the launcher icon? See Kerry_s's post for the template to make a .desktop file, and the Icon= line has to be supplied by you (point it to a jpg or png file that represents your script) then make the .desktop file executable, put it in ~/.local/share/applications and it will appear in the dash if you search for it (may need a logout/login) and once you find it then you can pin it to the unity launcher like you do with other applications. No, they don't get pinned there automatically and it makes sense, you don't want every single application you install to show up at the launcher, just the "quick launch" ones.

  2. #12
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Unity launcher button

    log out and log back in is a problem. too many other things running. let me see if i can do this as a different user for testing.
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

  3. #13
    Join Date
    Aug 2013
    Beans
    4,941

    Re: Unity launcher button

    Quote Originally Posted by Skaperen View Post
    log out and log back in is a problem. too many other things running. let me see if i can do this as a different user for testing.
    Then try run

    Code:
    sudo updatedb
    No it wouldn't work for a different user since the script and the .desktop files are both in your user's home

  4. #14
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,187

    Re: Unity launcher button

    i think unity has the same restart switch as gnome?

    press alt+f2, type r & hit enter

  5. #15
    Join Date
    Aug 2013
    Beans
    4,941

    Re: Unity launcher button

    Quote Originally Posted by kerry_s View Post
    i think unity has the same restart switch as gnome?

    press alt+f2, type r & hit enter
    No, it is setsid unity, but for some systems that would log you out. In any case it is not that unity has not refreshed.

  6. #16
    Join Date
    Aug 2013
    Beans
    4,941

    Re: Unity launcher button

    BTW, you can check if your .desktop file is working by clicking it, if it works then you can just drag it from .local/share/applications to the launcher bar, that way you don't need to logout or login.

  7. #17
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Unity launcher button

    under a different user, the button is not showing up after logging out and back in. i cannot figure out how to get this forum to display text unformatted. so here is what i think should get the button show up under user magnatune (the user i log in to to download music from magnatune.com).

    Code:
    lt1/magnatune /home2/magnatune 60> ls -dl .local .local/share .local/share/applications .local/share/applications/playrumi.desktop
    drwxr-xr-x  3 magnatune magnatune 4096 May  9  2016 .local
    drwxr-xr-x 12 magnatune magnatune 4096 Mar 10 00:55 .local/share
    drwxr-xr-x  2 magnatune magnatune 4096 Apr  5 22:55 .local/share/applications
    -rwxr--r--  1 magnatune magnatune  224 Apr  5 22:47 .local/share/applications/playrumi.desktop
    lt1/magnatune /home2/magnatune 61> cat -n .local/share/applications/playrumi.desktop
         1    [Desktop Entry]
         2    Version=1.0
         3    Type=Application
         4    Name=Rumi
         5    GenericName=Rumi
         6    Comment=play rumi in the background
         7    Icon=music
         8    TryExec=/home2/magnatune/desktop/playrumi
         9    Exec=/home2/magnatune/desktop/playrumi
        10    Categories=Audio;Music;
    lt1/magnatune /home2/magnatune 62>
    Last edited by deadflowr; April 9th, 2018 at 04:23 AM. Reason: reset font size; placed in code tags
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

  8. #18
    Join Date
    Mar 2017
    Beans
    1,018

    Re: Unity launcher button

    @ Skaperen,
    You may not be aware of this but your .desktop file does not need to be executable to work with the unity launcher.
    If the file is correct you can drag and drop to the Unity launcher (sidebar).
    However, if you want to test it by clicking on the actual .desktop in the file browser it needs to be executable.
    If the .desktop file doesn't work , test your "Exec=" line in terminal, eg /home2/magnatune/desktop/playrumi

    I usually make .desktop files in ~/.local/share/applications executable because they show differently in the file browser.
    When executable the icon and name from the .desktop file is used.
    eg Attached Pic shows the same .desktop file executable and non executable.
    Last edited by again?; April 6th, 2018 at 05:01 AM.

  9. #19
    Join Date
    Aug 2013
    Beans
    4,941

    Re: Unity launcher button

    Quote Originally Posted by Skaperen View Post
    under a different user, the button is not showing up after logging out and back in. i cannot figure out how to get this forum to display text unformatted. so here is what i think should get the button show up under user magnatune (the user i log in to to download music from magnatune.com).

    lt1/magnatune /home2/magnatune 60> ls -dl .local .local/share .local/share/applications .local/share/applications/playrumi.desktop
    drwxr-xr-x 3 magnatune magnatune 4096 May 9 2016 .local
    drwxr-xr-x 12 magnatune magnatune 4096 Mar 10 00:55 .local/share
    drwxr-xr-x 2 magnatune magnatune 4096 Apr 5 22:55 .local/share/applications
    -rwxr--r-- 1 magnatune magnatune 224 Apr 5 22:47 .local/share/applications/playrumi.desktop
    lt1/magnatune /home2/magnatune 61> cat -n .local/share/applications/playrumi.desktop
    1 [Desktop Entry]
    2 Version=1.0
    3 Type=Application
    4 Name=Rumi
    5 GenericName=Rumi
    6 Comment=play rumi in the background
    7 Icon=music
    8 TryExec=/home2/magnatune/desktop/playrumi
    9 Exec=/home2/magnatune/desktop/playrumi
    10 Categories=Audio;Music;
    lt1/magnatune /home2/magnatune 62>
    ??? !!!

    I am not sure what you are doing, seems that you make the task very complicated for no reasons. Here is an example

    I compiled gimp 2.9 from source, since it has to be linked to newer libraries than the system versions I have a script that starts gimp-2.9 that takes care of all the environmental variables, the script is in my $HOME/bin
    Code:
    #! /bin/bash
    
    export INSTALL_PREFIX=$HOME/gimp-2.9
    
    export PATH=$INSTALL_PREFIX/bin:$PATH
    export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$LD_LIBRARY_PATH
    
    export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
    
    $INSTALL_PREFIX/bin/gimp-2.9
    I made it executable, made sure that it worked by running it to start gimp.


    Now I made a .desktop file and placed it in ~/.local/share/applications
    Code:
    [Desktop Entry]
    Type=Application
    Terminal=false
    Icon=/home/monkeybrain/share/icons/gimp.svg
    Exec=gimp-2.9 %F
    Name=GIMP-2.9
    Categories=Graphics;
    Since the script gimp-2.9 lives in $HOME/bin, it is directly in my path (see .bashrc) so I don't need to put in the full path in the Exec = line, if your script is elsewhere, put in the full path.
    I made it executable, clicked it and made sure that it indeed started gimp (by invoking the script gimp-2.9 in $HOME/bin)

    Now either drag the .desktop file to the launcher from ~/.local/share/applications, or open the dash, find gimp and drag it to the launcher, that's it.
    Attached Images Attached Images
    Last edited by monkeybrain20122; April 6th, 2018 at 05:18 AM.

  10. #20
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Unity launcher button

    the button is still not showing up. i've even rebooted a couple times. here's what i have:

    Code:
    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=Rumi
    GenericName=Rumi
    Comment=play rumi in the background
    Icon=music
    TryExec=/home/pdh/desktop/playrumi
    Exec=/home/pdh/desktop/playrumi
    Code:
    drwxr-xr-x  28 root root  4096 Apr  4 23:44 /
    drwxr-xr-x  26 root root  4096 Mar 23 20:53 /home
    drwxr-xr-x 160 pdh  pdh  53248 Apr  8 20:10 /home/pdh
    drwxr-xr-x   3 pdh  pdh   4096 May  9  2016 /home/pdh/.local
    drwxr-xr-x  19 pdh  pdh   4096 Apr  5 20:30 /home/pdh/.local/share
    drwxr-xr-x   2 pdh  pdh   4096 Apr  5 21:30 /home/pdh/.local/share/applications
    -rwxr--r--   1 pdh  pdh    210 Apr  5 20:56 /home/pdh/.local/share/applications/playrumi.desktop
    drwxr-xr-x   2 pdh  pdh   4096 Apr  5 21:12 /home/pdh/desktop
    -rwxr--r--   1 pdh  pdh    117 Apr  5 21:07 /home/pdh/desktop/playrumi
    /home2/magnatune was where i was testing logging out and back in. /home/pdh is where it ultimately goes. the script actually calls another script to execute a command in a background (detached) screen (the screen command) session, creating it if it does not exist, yet. but, things can't even get that far since the button does not show up. i can't click on it if it does not show up.
    Last edited by Skaperen; April 9th, 2018 at 01:54 AM.
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

Page 2 of 6 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •