-
Notifications
You must be signed in to change notification settings - Fork 16
Run programs to update desktop integration #50
Conversation
Hello @rszibele, welcome to AppImage. Great to have you here. What an awesome PR for a first contribution. 👍 |
I think the following is caused by https://github.com/linuxdeploy/linuxdeploy-plugin-appimage, @TheAssassin please have a look:
The signing should not be attempted for PRs, as PRs cannot access the key. |
If I understand it correctly, then this PR runs the programs 5 seconds after the last activity. While this is clearly a step in the right direction, I think (might be wrong though) that merely copying in desktop files can trigger the running of such programs automatically. So we should also apply the same logic to copying around the files (desktop files, icon files, mime type files and such) that are needed for system integration.
Does this make sense @rszibele? Do you think you could have a go at it? |
Hi, yes that makes sense I'll have a look at it. |
Yes, you are correct. GNOME does this for each file, but from what I can tell they do not "rebuild" everything once a new .desktop file is added. KDE on the other hand doesn't do this, you have to manually call I will have to look further into this issue, but I believe the slowdowns are primarily caused by integrating AppImages that are already integrated. Every time appimaged is started (e.g after logging in), it re-registers all AppImages by calling I'll add a check to ensure only those AppImages get integrated that aren't integrated already. EDIT: appimaged also launches 1 pthread per file, this is very bad when you have, for example, extracted the linux kernel in your downloads folder. I'll think of a solution for this. |
Thanks @rszibele for addressing this; I am sure it will make a big difference! |
Actually it looks like I was a bit too fast merging this. It should rather be implemented in libappimage because
So please have a look at AppImageCommunity/libappimage#27 and AppImageCommunity/libappimage#28. |
This PR fixes issue #34.
Implementation
It checks if the following programs are available in the users
$PATH
:Based on the availability of each program, it executes each of them within a thread if more than 3 seconds have passed since the last AppImage was added. If another AppImage is dropped into one of the watched directories while still within the 3 seconds, then the timer is reset. So if suddenly a user drops 20 AppImages into the directory, the update will only be executed once.
Note: The execution time of the desktop update depends on the system, but it generally falls in the 100-600ms range, according to my tests on my main machine and an older laptop.
Tests
I have manually tested this with the Libreoffice and Subsurface AppImages on the following distributions: