I wanted to write a short review of the surufy icon script. First thing first a bit of context:
the goal is to have a script that adds a suru style tile background to third party application icons when the application is installed (and remove it, when the app is uninstalled).
The script works fine (you can find it here), I am working now on the integration with the system, with both apt and snap.
what follows is thanks to @kenvandine support (if there is something wrong, it’s just my fault in understanding it)
Apt (and snap, I believe) has a Post-Invoke hook, that let me call a script after apt install is called, which is the thing I need to launch the surufy script, however:
- surufy script writes new icons under
$HOME/.local/share/icons/Yaru, but apt runs as root, so it doesn’t know where user’s $HOME is.
- the Post-Invoke script must be in
/etc/apt/apt.conf.d/, but snap package cannot install any file outside it’s containerized locations (e.g. /snap or $HOME/snap). As far as I know, there is no snap interface/slot we can use for this.
- we could write directly where normal icons are installed, but I’m not 100% happy with this, first because if the user switches to a different icon set, those icons will stay in suru format and also because with snap we probably cannot write in icons folder
- the only solution here is to provide this surufy script as a deb package, with both the apt hook and the actual script. This means, however, that snap version would not have it.
another goal would be to execute the script ONLY on the last installed application.