Distribution: Ubuntu 23.10
DE: GNOME 45.2
WM: Mutter
Windowing System: Wayland
snap: 2.61.1
snapd: 2.61.1
kernel: 6.5.0-15-generic
I have cursor theme at $HOME/.icons. Snap apps does not respect that location. It looks a bit weird. Is there a solution ? I know it’s due to sandboxing but how can we allow $HOME/.icons access?
Icon themes also need to be installed in the snap. As it’s not possible… move the cursor theme to the snap’s .icons folder. i.e
$HOME/snap/<snap-name>/current/.local/share/icons
This is a lot of work… but you may try some auto mating commands…
Today I finally found a real solution to this problem and just thought I’d share it with the internet. Hopefully some people find this useful and are able to apply this advice to whatever cursor theme they are using.
So currently I am using a cursor theme called “Bibata-Modern-Ice” which has no snap package in the store and my solution here basically goes over how to compile it into a snap, install on your system and configure your snap applications to actually use it.
I cloned the repo with this command git clone https://github.com/stoefelz/arcaurora-cursors-snap
I went here and downloaded “Bibata-Modern-Ice.tar.xz”
Extracted the archive containing my cursor theme and verified that it’s directory structure is like so:
Bibata-Modern-Ice
├── cursors
│ ├── [...] (Lots of files with numbers & stuff)
├── cursor.theme
└── index.theme
Recompressed the archive which was downloaded in step 2 into a zip archive. (I think this may be unnecessary)
Moved into the repository directory in my terminal (cd arcaurora-cursors-snap) and also moved the zip file I made in the previous step to this same directory.
Installed snapcraft using the command sudo snap install snapcraft
Ran the command snapcraft inside the git repo directory
I was prompted to allow the automatic installation of a snap called lxd during the process. I had to manually add my user to the lxd group which I did using sudo usermod -a -G lxd (your linux user here)
After logging out of GNOME and then logging back in I moved back into the repo directory and reran the snapcraft command
Finally, the snapcraft command exited successfully and I then found a file in my repo directory called bibata-modern-ice-cursors_1.0_amd64.snap which I installed using the command sudo snap install bibata-modern-ice-cursors_1.0_amd64.snap --dangerous
I ran snap connections firefox command and noted the plug and slot for firefox:gtk-3-themes and firefox:icon-themes which had extra entries for me (from previous theme installation attempts).
I disconnected the firefox:gtk-3-themes & firefox:icon-themes plugs using commands sudo snap disconnect firefox:gtk-3-themes and sudo snap disconnect firefox:icon-themes
Reconnected the firefox gtk 3 themes plug using sudo snap connect firefox:gtk-3-themes gtk-common-themes:gtk-3-themes
Connected the icon themes plug to my newly installed snap package with the command sudo snap connect firefox:icon-themes bibata-modern-ice-cursors:icon-themes
Restarted the firefox snap app and observed that the Bibata modern ice cursor theme is actually being used after all this work.
To apply this theme to my other apps I basically repeated steps 12 - 16 but with the package name of the other app I wanted to change like discord for example. If you want to see a list of your packages in the terminal you can run snap list
Disclaimers: I’m not really much of a programmer and I don’t really know what I’m doing on a deep technical level. I think this solution won’t work if your theme for other like normal gtk apps isn’t set to exactly the same thing as what’s being used in the theme snap. For example my cursor theme in gnome-tweaks is set to “Bibata-Modern-Ice” and I installed the same exact files in the archive from step 2 into ~/.icons /usr/share/icons and .local/share/icons so if your doing this with a different cursor theme you might need to make sure you have it installed in those locations also and that everything lines up in the snapcraft.yaml file where I basically replaced all the references to arc aurora with the theme I wanted (Bibata modern ice).
To allow snap to connect to locate and access hte $HOME/ .icons. You need to connect to home to access the snap package. After this you allow to access the specific directories in your home directory include iocn folder. For this run command:
Yea I tried the sudo snap connect discord:home just now like how johntk005 stated and it doesn’t seem to allow the current gtk cursor theme to work - for me… I wish it were that simple though. I’ve tried many other solutions and such from several online forums and only the solution I’ve outlined earlier worked for me personally.
The home interface does not allow access to any hidden files or directories (i.e. anything starting wirh a dot) … so it wouldn’t help with accessing ~/.icons at all
Packaging the theme as a content provider snap (best done by the theme upstream themselves indeed) is the correct solution to provide themes to snaps
That’s the correct solution may be from the POV of snap and snap community, but not at all from the POV of an user. An user can use any arbitrary cursor. The package format should support it. I really think, that as a community we should look into theming heavily now, specifically for KDE, as there is nothing called default in KDE like in Gnome.
If you would look at the description of the arcaurora-cursors snap that you took as base for creating your own snap you would see this:
**Applying the theme**
To apply the theme to a single application, perform the following:
`sudo snap connect [snap-you-want-to-theme]:icon-themes
arcaurora-cursors:icon-themes`
To apply to all applications run the following command. Thanks to
@flexiondotorg for the handy loop.
` for plug in $(snap connections | grep gtk-common-themes:icon-themes | awk
'{print $2}'); do sudo snap connect ${plug} arcaurora-cursors:icon-themes;
done`
_NOTE:_ Some apps like the Ubuntu Snap Store may require logging out, and
back in to load the changes.
So you could apply the theme to all your currently installed snaps with that one command. I used that previously, but for the themes and icons snaps. Pretty much any snap of that kind has that handy commands in it’s description.