Results 1 to 10 of 10

Thread: Custom application launcher woes

  1. #1
    Join Date
    May 2024
    Beans
    Hidden!
    Distro
    Ubuntu

    Custom application launcher woes

    I'd like to use an alternative terminal emulator called "st".

    I am surprised how difficult it is to perform an extremely basic task on Ubuntu 24: add a shortcut to st to my dock.

    First result in search is https://help.ubuntu.com/community/HowToAddaLauncher which looks about a decade out of date and just useless.

    Fair enough, maybe it's a GNOME thing. Here's the documentation: https://help.gnome.org/users/gnome-h...tml.en#desktop

    Zero mention of pinning custom apps/programs to the dock, only my "favorite" apps - but I don't have an "app" made yet.

    How do I make a custom app for my terminal emulator? I find: https://developer.gnome.org/document...g_started.html

    Looks like I need to download an entire IDE ... from a site which "is planned for retirement". Well, I'm not doing that.

    Search around some more and apparently I need to make a "foo.desktop" file in ~/.local/share/applications

    I do that:

    Code:
    [Desktop Entry]
    Type=Application
    Terminal=true
    Name=st
    Icon=xterm
    Exec=/usr/local/bin/st
    This makes an "st" application available, but now when I launch it, it opens two windows: Terminal, which is opening another window for st.

    This defeats the point of what I'm trying to do.

    How do I add a shortcut for st to my dock, and why do I even have to ask such a basic question in 2024?

  2. #2
    Join Date
    Jun 2016
    Beans
    2,883
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Custom application launcher woes

    Quote Originally Posted by currentshaft View Post
    when I launch it, it opens two windows: Terminal, which is opening another window for st.

    This defeats the point of what I'm trying to do.
    The Terminal=true line is explicitly requesting this behavior. Does the launcher not work if you instead set Terminal=false or entirely remove the Terminal= line?
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    If your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  3. #3
    Join Date
    Apr 2007
    Beans
    3,141
    Distro
    Ubuntu

    Re: Custom application launcher woes

    That means the desktop cannot make an association between the launcher and a running window. To fix that, add a "StartupWMClass=…" line to indicate the WMClass of such terminal window.

  4. #4
    Join Date
    Dec 2014
    Beans
    2,658

    Re: Custom application launcher woes

    Quote Originally Posted by currentshaft View Post
    ... why do I even have to ask such a basic question in 2024?
    This is partially on the developers of st for not including a .desktop file - but then none of the suckless tools do, the developers believe in using a really minimal environment instead of the big DEs that are prevalent today; their programs don't even have any way to set options other than editing a header file before compiling. So the other part of the blame goes to you, for using a program that's not really meant for Ubuntu - the suckless tools are meant to be their own environment that's more minimalistic than than any flavour of Ubuntu.

    Holger

  5. #5
    Join Date
    May 2024
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Custom application launcher woes

    Quote Originally Posted by halogen2 View Post
    The Terminal=true line is explicitly requesting this behavior. Does the launcher not work if you instead set Terminal=false or entirely remove the Terminal= line?
    Yes, setting Terminal to "false" appears to work. However, when st is launched, it appears as a separate icon on the dock from the pinned shortcut I created. Is there any way to avoid having 2+ icons appears for st?

    Quote Originally Posted by Holger_Gehrke View Post
    This is partially on the developers of st for not including a .desktop file - but then none of the suckless tools do, the developers believe in using a really minimal environment instead of the big DEs that are prevalent today; their programs don't even have any way to set options other than editing a header file before compiling. So the other part of the blame goes to you, for using a program that's not really meant for Ubuntu - the suckless tools are meant to be their own environment that's more minimalistic than than any flavour of Ubuntu.
    This really has nothing to do with suckless or DEs, because I could be asking to create a custom launcher for any application. Why hasn't Gnome implemented a simple launcher/dock app creator to help befuddled users like me? Surely I'm not alone ...

  6. #6
    Join Date
    Dec 2014
    Beans
    2,658

    Re: Custom application launcher woes

    Quote Originally Posted by currentshaft View Post
    Why hasn't Gnome implemented a simple launcher/dock app creator to help befuddled users like me? Surely I'm not alone ...
    They have. It's called 'alacarte'. Since I use Xubuntu I don't know whether it's part of the Ubuntu default install, but it is in the repositories.

    Holger

  7. #7
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,798

    Re: Custom application launcher woes

    Is there any way to avoid having 2+ icons appears for st?
    I've seen that with a few applications. No guarantees, but try adding the following line to the st.desktop file:
    StartupWMClass=st

    Why hasn't Gnome implemented a simple launcher/dock app creator?
    There is a utility to make .desktop files called Desktop Files Creator (not made by the Gnome Project). See screenshot.
    Attached Images Attached Images

  8. #8
    Join Date
    May 2024
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Custom application launcher woes

    Quote Originally Posted by Dennis N View Post
    I've seen that with a few applications. No guarantees, but try adding the following line to the st.desktop file:
    StartupWMClass=st
    Unfortunately does not work and I still get multiple dock tiles, nor does the icon I have set (Icon=xterm).

  9. #9
    Join Date
    Jun 2016
    Beans
    2,883
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Custom application launcher woes

    Try this? -
    Code:
    [Desktop Entry]
    Type=Application
    Name=st
    Icon=xterm
    Exec=/usr/local/bin/st
    StartupNotify=true
    StartupWMClass=st-256color
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    If your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  10. #10
    Join Date
    May 2024
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Custom application launcher woes

    Thank you, halogen! That works great, I just had to adjust:

    Icon=utilities-terminal

    Great suggestions all around.

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
  •