Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Unable to launch programs by clicking file/icon

  1. #1

    Default Unable to launch programs by clicking file/icon

    Hi, a strange problem has appeared with my installation Leap 15.1.
    When I attempt to start a program by clicking either the file or an icon linking to it, i just get the file opening in Kate, or, if it's a desktop icon, the Desktop Entry, e.g.

    Code:
    [Desktop Entry]
    Comment[en_GB]=
    Comment=
    Exec=/home/andy/Programs/JobTracker/Start.py
    GenericName[en_GB]=
    GenericName=
    Icon=/home/andy/Programs/JobTracker/Icons/shackles.png
    MimeType=
    Name[en_GB]=JobTracker
    Name=JobTracker
    Path=/home/andy/Programs/JobTracker
    StartupNotify=true
    Terminal=false
    TerminalOptions=
    Type=Application
    X-DBUS-ServiceName=
    X-DBUS-StartupType=
    X-KDE-SubstituteUID=false
    X-KDE-Username=
    This happens even though the file properties are set to 'is executable' and the access permissions are set to 'Can view and Modify'. Python programs like the above have the correct shebang at the top.

    This happens with most programs, except those where the first tab of the Properties window lists the file as Type: executable.

    In all cases the program can be launched from the terminal, e.g. in the above case by entering ./Start.py. Start menu programs start normally.

    Does anyone have any idea what's going on? It's really very irritating.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    26,511

    Default Re: Unable to launch programs by clicking file/icon

    This is apperently all about a desktop? But which one. Please do not let your potential audience guess such an importnat fact.
    Henk van Velden

  3. #3

    Default Re: Unable to launch programs by clicking file/icon

    Whoops, my bad.
    It's KDE 5.12.8

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

    Default Re: Unable to launch programs by clicking file/icon

    Hi
    Only a few of the items are required and they do need data after the equals sign, get rid of the rest...

    https://en.opensuse.org/openSUSE:Pac...enu_categories
    https://specifications.freedesktop.o...ec-latest.html

    Code:
    [Desktop Entry]
    Comment[en_GB]=A python job tracker
    Comment=A python job tracker
    Exec=/home/andy/Programs/JobTracker/Start.py
    Icon=/home/andy/Programs/JobTracker/Icons/shackles.png
    Name[en_GB]=JobTracker
    Name=JobTracker
    StartupNotify=true
    Terminal=false
    Type=Application
    Encoding=UTF-8
    Categories=Office;ProjectManagement;
    I normally put icons in ~/.icons, then your Icon= would be;
    Code:
    Icon=shackles
    Last edited by malcolmlewis; 24-Jun-2020 at 14:02.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5

    Default Re: Unable to launch programs by clicking file/icon

    Hi Malcolm,
    That example file was the one that was automatically generated when i used the 'Link to Application' command from the right-click menu in a folder. It seems that if you leave some of the fields in the Application tab of the resulting dialogue unfilled, it leaves a blank after the equals sign.
    If it's a program I've written, I prefer to keep the icon in the program folder, it just makes it easier to keep track of the things.

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

    Default Re: Unable to launch programs by clicking file/icon

    Quote Originally Posted by andyStopford View Post
    Hi Malcolm,
    That example file was the one that was automatically generated when i used the 'Link to Application' command from the right-click menu in a folder. It seems that if you leave some of the fields in the Application tab of the resulting dialogue unfilled, it leaves a blank after the equals sign.
    If it's a program I've written, I prefer to keep the icon in the program folder, it just makes it easier to keep track of the things.
    Hi
    So did the modified one work?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7

    Default Re: Unable to launch programs by clicking file/icon

    No, the same thing happens even when directly clicking the executable file, so for the example above you get Start.py opening in Kate:

    Code:
    #!bin/python3.6
    import sys
    
    from PyQt5 import QtGui, Qt
    from PyQt5.QtWidgets import QApplication, QSplashScreen
    
    from JobTracker import MainWindow
    
    if __name__ == "__main__":
        app = QApplication(sys.argv)
        splash_pix = QtGui.QPixmap("./Icons/icon_start.png")
        splash = QSplashScreen(splash_pix, Qt.Qt.WindowStaysOnTopHint)
        splash.setMask(splash_pix.mask())
        splash.show()
        app.processEvents()
        myapp = MainWindow()
        myapp.show()
        splash.finish(myapp)
        sys.exit(app.exec_())
    Or, for QCad, say:

    Code:
    #!/bin/bash
    #
    # QCAD startup script
    #
    
    DIR=${0%/*}
    binary="$DIR/qcad-bin"
    
    # Many Linux distributions try to use a style plugin that
    # is not available as 32bit version, links against another 
    # version of Qt or is otherwise incompatible. For this
    # reason, this script forces the style to the integrated 
    # plastique style of Qt.
    
    # The style may be changed here or removed to use the
    # default style:
    
    LD_LIBRARY_PATH="$DIR" "$binary" -style plastique "$@"

  8. #8

    Default Re: Unable to launch programs by clicking file/icon

    Also, I tried logging into an alternative desktop (IceWM), with the same result, so not a problem specific to KDE.

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

    Default Re: Unable to launch programs by clicking file/icon

    Quote Originally Posted by andyStopford View Post
    Also, I tried logging into an alternative desktop (IceWM), with the same result, so not a problem specific to KDE.
    Hi
    I imagine all was working ok with respect to desktop icons before you created the shortcut? I wonder if the mime entry being blank screwed something up....

    Do you have a file;

    Code:
    cat ~/.local/share/applications/mimeinfo.cache
    Note I'm on GNOME here, but should still be the same....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  10. #10

    Default Re: Unable to launch programs by clicking file/icon

    Check the setting "When opening an executable file" in dolphin (General->Confirmations). It's probably set to "Open in application".

Page 1 of 2 12 LastLast

Posting Permissions

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