The advice you've found is generally sound and can help solve the issue with the cursor not matching your system cursor in Flatpak apps. To explain a bit more, Flatpak applications run in a sandbox that isolates them from the rest of the system to improve security and stability. This sandboxing can sometimes lead to inconsistencies in theming, including cursor themes.
Here's a bit more detail about the commands:
flatpak --user override --filesystem=/home/$USER/.icons/:ro
This command allows Flatpak apps to read (but not write to) the .icons directory in your home folder, where custom icon themes, including cursor themes, are often stored.
flatpak --user override --filesystem=/usr/share/icons/:ro
Similarly, this command allows Flatpak apps to read (but not write to) system-wide icon themes located in /usr/share/icons.
These commands are safe to use and won't harm your system. They simply make certain directories available in a read-only mode to your Flatpak applications, enabling them to access your existing cursor themes.
Better Solution
There isn't necessarily a "better" solution, but there are a few additional steps you can take for a more comprehensive approach:
Flatpak Config File: You can create or edit a Flatpak configuration file to always apply these settings:
Create (or edit) the file ~/.local/share/flatpak/overrides/global and add the following lines:
Update Environment Variable: You can try setting the XCURSOR_PATH environment variable to include paths to your cursor themes. This can be done by adding a line to your .profile, .bashrc, or equivalent shell configuration file:
Flatseal: You can use a GUI application called Flatseal, which allows you to adjust permissions and other settings for installed Flatpak applications. You can easily set the filesystem access through Flatseal for each Flatpak application individually.
Re-login or Reboot: After making these changes, it's often a good idea to log out and log back in, or reboot the system to ensure all changes take effect properly.
In general, using the flatpak override commands as you've found is a straightforward, effective method to solve the cursor mismatch issue. The supplementary steps above can be helpful if you want more control or if the initial solution doesn't fully resolve the issue.