support for defining autostart apps in lnf packages
ClosedPublic

Authored by mart on Dec 11 2017, 5:35 PM.

Details

Summary

meant to support layouts that want external apps such as lattedock
or conky, it adds services (in the defaults file they're saved as
the filename of the desktop file) in autostart and starts immediately
the app as well.
before applying a lnf, it removes from autostart anything the old
package had and attempts to stop the apps

Test Plan

tried to start/stop lattedock with the mechanism
some fallback may be needed for non kde apps

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Dec 11 2017, 5:35 PM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 11 2017, 5:35 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart requested review of this revision.Dec 11 2017, 5:35 PM
apol added a subscriber: apol.Dec 11 2017, 5:48 PM
apol added inline comments.
kcms/lookandfeel/kcm.cpp
387

Use splitRef or section

387

Also I'm not sure if it works, but something along the lines of systemctl --user stop servicename should work. Or at least it's a thing.

400

{}

@mart I suppose this mechanism is the first step in order to load external apps (such as lattedock) through the Look N' Feel package. Fantastic news of course! :)

in the future would it be possible for these apps to include also their layout in the Look N' Feel package?
For example Latte supports import/export of its layouts so it is possible to dynamically change its layout
from a Look n' Feel package.

mart added a comment.Dec 12 2017, 10:29 AM

in the future would it be possible for these apps to include also their layout in the Look N' Feel package?
For example Latte supports import/export of its layouts so it is possible to dynamically change its layout
from a Look n' Feel package.

we could add a new named file in the lnf package for the latte layout: in what format is it exported?
so lattedock upon startup may go read that file (is already possible for any app to access that package via standard KPackage api and reading the current lnf from kdeglobals, adding a new named file just makes it a bit more official)

mart added inline comments.Dec 12 2017, 1:29 PM
kcms/lookandfeel/kcm.cpp
387

it seems to look for a systemd service file?

mart updated this revision to Diff 23805.Dec 12 2017, 1:40 PM
  • e Qtring::section
mart marked 2 inline comments as done.Dec 12 2017, 1:40 PM
In D9288#178638, @mart wrote:

we could add a new named file in the lnf package for the latte layout: in what format is it exported?
so lattedock upon startup may go read that file (is already possible for any app to access that package via standard KPackage api and reading the current lnf from kdeglobals, adding a new named file just makes it a bit more official)

nice! I can play with it with some guidance to test it in order to support it both for 0.7 and master Latte versions if this is possible.
the layout file is just a text file that ends with .layout.latte .
Inside it looks like just like a plasma's appletsrc file with some extra configgroups that Latte needs.
The name of the file is also used as a layout name, e.g. Plasma.layout.latte means a Latte layout named Plasma .

If you want to take a look of one layout file a small example is:

Theoretically it should be also possible to download/install from store.kde.org any applets that can be found inside the layout.latte file
and cant be found in the user's environment.
Just like plasma is doing, I think.

mart updated this revision to Diff 23869.Dec 13 2017, 2:29 PM
  • only mess with autostart if we apply the layout
davidedmundson accepted this revision.Dec 13 2017, 2:42 PM
This revision is now accepted and ready to land.Dec 13 2017, 2:42 PM
This revision was automatically updated to reflect the committed changes.