Page 1 of 6 123 ... LastLast
Results 1 to 10 of 58

Thread: Unity launcher button

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

    Unity launcher button

    i am running Unity on my Ubuntu 16.04 LTS based laptop (last upgraded yesterday). i would like to set up a button on the launcher bar that will execute a command line or script of my own. how do i get started to do that? some google searches came up empty, but maybe i guessed the wrong terms.
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

  2. #2
    Join Date
    Feb 2010
    Location
    Obscurial Springs
    Beans
    15,209
    Distro
    Ubuntu Budgie Development Release

    Re: Unity launcher button

    Have you written the script in gedit, named, saved, and made it executable? If so the next step is to test the script. Creating a desktop entry could allow you to add a launcher and other forum members may be able to help with that. I've not created a launcher for a script in Unity.
    "Our intention creates our reality. "

    Ubuntu Documentation Search: Popular Pages
    Ubuntu: Security Basics
    Ubuntu: Flavors

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

    Re: Unity launcher button

    Make a .desktop file where Exec=path/to/your/script, make it executable and put it in ~/.local/share/applications. To get a template of a .desktop file, just bring up any .desktop file in /usr/share/applications with an editor.

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

    Re: Unity launcher button

    i usually manually do mine:
    example:
    gedit ~/.local/share/applications/my-app.desktop

    inside:
    [Desktop Entry]
    Version=
    Type=Application
    Name=
    GenericName=
    Comment=
    Icon=
    TryExec=/needs/to/be/full/path
    Exec=/needs/to/be/full/path
    Categories=

    this is my actual 1 i'm using:
    [Desktop Entry]
    Version=4.0.17
    Type=Application
    Name=Stremio
    GenericName=Media Center
    Comment=Watch instantly all the video content you enjoy in one place
    Icon=video
    TryExec=/home/user/Streamio/Stremio+4.0.17.appimage
    Exec=/home/user/Streamio/Stremio+4.0.17.appimage
    Categories=AudioVideo;Video;Player;

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

    Re: Unity launcher button

    Quote Originally Posted by Frogs Hair View Post
    Have you written the script in gedit, named, saved, and made it executable? If so the next step is to test the script. Creating a desktop entry could allow you to add a launcher and other forum members may be able to help with that. I've not created a launcher for a script in Unity.
    yes, but i used emacs instead of gedit to create it. it will create more in the future once i know this can be done and how.
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

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

    Re: Unity launcher button

    Quote Originally Posted by Skaperen View Post
    yes, but i used emacs instead of gedit to create it. it will create more in the future once i know this can be done and how.
    It doesn't matter which editor you use, the script is just an executable text file.

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

    Re: Unity launcher button

    Quote Originally Posted by monkeybrain20122 View Post
    Make a .desktop file where Exec=path/to/your/script, make it executable and put it in ~/.local/share/applications. To get a template of a .desktop file, just bring up any .desktop file in /usr/share/applications with an editor.
    so, the mere existence of a properly constructed and executable .desktop file in that directory causes the button to exist?
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

  8. #8
    Join Date
    Feb 2010
    Location
    Obscurial Springs
    Beans
    15,209
    Distro
    Ubuntu Budgie Development Release

    Re: Unity launcher button

    The editor shouldn't matter as long the script is executable and works. See the posts above for help with the desktop entries needed to create the launcher.
    "Our intention creates our reality. "

    Ubuntu Documentation Search: Popular Pages
    Ubuntu: Security Basics
    Ubuntu: Flavors

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

    Re: Unity launcher button

    Quote Originally Posted by Skaperen View Post
    so, the mere existence of a properly constructed and executable .desktop file in that directory causes the button to exist?
    You have an executable script, the .desktop file (made executable) runs it when click, if you put it in .local/share/applications then it will show up in the dash (may have to logout and log back in), then you can pin it to the launcher.
    Last edited by monkeybrain20122; April 6th, 2018 at 01:56 AM.

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

    Re: Unity launcher button

    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?
    Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer

Page 1 of 6 123 ... 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
  •