black-sheep-dev / harbour-takeoff

Takeoff is an autostart manager for Sailfish OS to start apps automatically after system boot.
GNU General Public License v3.0
0 stars 1 forks source link

Feature Idea: Desktop Launcher instead of autostart #4

Open nephros opened 4 years ago

nephros commented 4 years ago

Hi!

Lovely work! Thanks for doing SailfishOS stuff.

Here's an Idea: As an additional feature, have the app not add programs to autostart, but rather create a .desktop icon which will launch all the selected apps at once.

I have started an app I called "TheButton!" which does this - but as I am no programmer I haven't done a proper GUI for it, or rather wanted to learn QML this way but never got around to it.

Anyway, what is done is a set of scripts which does what I mean as a PoC, which you can look at here: https://gitlab.com/nephros/openrepos-thebutton/-/tree/master/script

  1. have to user select from their installed programs (that part is already in Takeoff of course)
  2. collect the "exec" parts of those programs (Takeoff also does something similar)
  3. shove the "exec" parts into a "launcher" (in my case, create a simple shell script in ~/.local/lib/<appname>/scripts, again Takeoff can already do something like it)
  4. create a .desktop file calling the launcher script ( <-- this is the revolutionary new part!!) and install an icon for it

Let me know if this is something you consider a useful idea.

nephros commented 4 years ago

My personal use case for this is to use several of these "Buttons" for certain "activities".

E.g. I have on Button called "GoodMorning" which will open two social media apps, a newspaper web site and the DailyComics app to ise with morning coffee. I have another one to launch all Instant Messaging apps for when I need communication information overload.

It's also nice to be able to do a "close all apps" action on the launcher, and with one tap have all one's favourite applications back.

black-sheep-dev commented 4 years ago

Hi, thank you for your ideas. Seems to be a nice feature like "Activites" in KDE. But I need to investigate if it is possible to generate desktop files in correct place somehow. The normal user has no permission to write into "/usr/share/applications".

nephros commented 4 years ago

Hi, thank you for your ideas. Seems to be a nice feature like "Activites" in KDE.

Yeah, it's quite similar if used that way.

But I need to investigate if it is possible to generate desktop files in correct place somehow. The normal user has no permission to write into "/usr/share/applications".

It is.

Correct location for a .desktop file is /home/${USER}/.local/share/applications/foo.desktop, or if you want to be very standards-compliant about it, $XDG_DATA_HOME/applications/foo.desktop.

There's possibly some API to do it through the session bus, but I wouldn't know for sure.

For icons, while I haven't tried that, I'm guessing /home/${USER}/.local/share/icons/NNxNN could work as well. If not I guess the application has to provide selectable icons in the system path.

Now, I'm not quite sure what the formally correct location for app generated user specific binaries is, but I think either ~/.local/bin or ~/.local/share/$APPLICATION_NAME/bin or ~/.local/share/$APPLICATION_NAME/libexec are acceptable enough.

Here's the reference spec for things like this, although it's not terribly usable: https://freedesktop.org/wiki/Software/xdg-user-dirs/

black-sheep-dev commented 4 years ago

Thank you for your information, I will investigate this.