Bug 433304 - Adding a new automatically starting application generates deprecated/invalid .desktop file
Summary: Adding a new automatically starting application generates deprecated/invalid ...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_autostart (show other bugs)
Version: 5.21.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Nicolas Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-20 08:59 UTC by Szőts Ákos
Modified: 2023-07-24 22:10 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szőts Ákos 2021-02-20 08:59:47 UTC
SUMMARY

I created a new autostart .desktop file through the KCM and the validation service complains.

STEPS TO REPRODUCE
1. Open Automatic start KCM module
2. Add a new "Application"
3. Use an executable (I used /usr/bin/xbindkeys)
4. Run the validator

OBSERVED RESULT

The resulting .desktop file looks like this:

$> cat .config/autostart/xbindkeys.desktop 
[Desktop Entry]
Comment[hu_HU]=
Comment=
Exec=/usr/bin/xbindkeys
GenericName[hu_HU]=
GenericName=
Icon=system-run
MimeType=
Name[hu_HU]=xbindkeys
Name=xbindkeys
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
TryExec=/usr/bin/xbindkeys
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

The validator tells for this file:

$> desktop-file-validate .config/autostart/xbindkeys.desktop 
.config/autostart/xbindkeys.desktop: warning: value "" for key "Comment[hu_HU]" in group "Desktop Entry" looks the same as that of key "GenericName[hu_HU]"
.config/autostart/xbindkeys.desktop: warning: value "" for key "Comment" in group "Desktop Entry" looks the same as that of key "GenericName"
.config/autostart/xbindkeys.desktop: warning: value "" for key "Path" in group "Desktop Entry" does not look like an absolute path
.config/autostart/xbindkeys.desktop: warning: key "TerminalOptions" in group "Desktop Entry" is deprecated


Possibly this is the reason why systemd-xdg-autostart-generator cannot generate a .service file which runs without error messages showing up in the log:

febr 20 09:04:12 openSUSE systemd-xdg-autostart-generator[1507]: /home/aki/.config/autostart/xbindkeys.desktop:14: Unknown key name 'TerminalOptions' in section 'Desktop Entry', ignoring.

febr 20 09:04:12 openSUSE systemd[1499]: /run/user/1000/systemd/generator.late/app-xbindkeys-autostart.service:17: WorkingDirectory= path is not absolute, ignoring:


EXPECTED RESULT

No warning messages.


Operating System: openSUSE Tumbleweed 20210217
KDE Plasma Version: 5.21.0
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.10.16-1-default
OS Type: 64-bit
Graphics Platform: X11
Comment 1 Nicolas Fella 2021-02-20 10:37:53 UTC
Does this cause any or is this purely cosmetic?
Comment 2 Nicolas Fella 2021-02-20 10:38:15 UTC
*any noticable issue
Comment 3 Szőts Ákos 2021-02-22 08:46:46 UTC
Currently, it's only cosmetic (apart from the scary-looking red and yellow lines in the journal).

In the future, though, I don't know how these programs will behave and what will be their reactions.
Comment 4 skierpage 2021-05-24 02:57:27 UTC
(In reply to Nicolas Fella from comment #1)
> Does this cause any or is this purely cosmetic?

When I added a startup application (actually a script) and checked the Terminal options
  Run in terminal
    Do not close when command exits
my script runs, but I don't see any terminal nor does it stick around, maybe because something is ignoring
  TerminalOptions=\s--noclose
in the generated .desktop file.

As a workaround my script writes debug messages to /tmp/myscript.$$.out , but I would like to see them in a terminal. If these terminal options aren't going to have any effect, then kcm_autostart shouldn't offer them (which is a slightly different bug, I guess).
Comment 5 Nicolas Fella 2021-05-24 11:23:08 UTC
(In reply to skierpage from comment #4)
> (In reply to Nicolas Fella from comment #1)
> > Does this cause any or is this purely cosmetic?
> 
> When I added a startup application (actually a script) and checked the
> Terminal options
>   Run in terminal
>     Do not close when command exits
> my script runs, but I don't see any terminal nor does it stick around, maybe
> because something is ignoring
>   TerminalOptions=\s--noclose
> in the generated .desktop file.
> 
> As a workaround my script writes debug messages to /tmp/myscript.$$.out ,
> but I would like to see them in a terminal. If these terminal options aren't
> going to have any effect, then kcm_autostart shouldn't offer them (which is
> a slightly different bug, I guess).

That's unrelated to the original report, can you please open a new bug so we can track this properly?
Comment 6 skierpage 2021-05-31 00:54:33 UTC
(In reply to Nicolas Fella from comment #5)
> (In reply to skierpage from comment #4)
> > (In reply to Nicolas Fella from comment #1)
> > When I added a startup application (actually a script) and checked the
> > Terminal options
> >   Run in terminal
> >     Do not close when command exits
> > my script runs, but I don't see any terminal nor does it stick around, ...
> 
> That's unrelated to the original report, can you please open a new bug so we
> can track this properly?
Thanks for responding 😽! I filed bug 437883.
Comment 7 Bug Janitor Service 2023-07-21 05:43:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3089
Comment 8 Nate Graham 2023-07-24 21:42:36 UTC
Git commit e9c4626b94a21ed80f438ee8a40d2d57610ed3db by Nate Graham, on behalf of Thenujan Sandramohan.
Committed on 24/07/2023 at 23:15.
Pushed by ngraham into branch 'master'.

Do not write empty path to desktop file

M  +0    -1    libkworkspace/autostartscriptdesktopfile.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/e9c4626b94a21ed80f438ee8a40d2d57610ed3db
Comment 9 Nate Graham 2023-07-24 22:10:54 UTC
Git commit ced23fc177a665d1c9fec64fdda0de4b0b24b7d6 by Nate Graham, on behalf of Thenujan Sandramohan.
Committed on 24/07/2023 at 23:44.
Pushed by ngraham into branch 'Plasma/5.27'.

Do not write empty path to desktop file


(cherry picked from commit e9c4626b94a21ed80f438ee8a40d2d57610ed3db)

M  +0    -1    libkworkspace/autostartscriptdesktopfile.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/ced23fc177a665d1c9fec64fdda0de4b0b24b7d6