Icecat on Mobian on PinePhone
#11
(04-29-2022, 02:56 AM)wibble Wrote: You can edit the icecat .desktop file so that it launches with the LD_PRELOAD. It may be easier to use a wrapper script to launch it than to figure out exactly what you'd have to do to the exec line, but check the docs:
https://specifications.freedesktop.org/d...-variables

Thank you @wibble ! Should I expect to find the IceCat .desktop file in the /usr/lib64/IceCat directory? I just scoured it (including checking the “Show hidden files” option) but wasn’t able to find a file called “.desktop”   Undecided
  Reply
#12
The file isn't called .desktop - I'm referring generally to the launcher files that follow that standard format. It's probably something like /usr/share/applications/icecat.desktop but it depends on the package. If you list the files provided by the package and search for desktop you should find it. Something like:

dpkg-query -L icecat |grep desktop
  Reply
#13
(05-06-2022, 05:07 AM)wibble Wrote: The file isn't called .desktop - I'm referring generally to the launcher files that follow that standard format. It's probably something like /usr/share/applications/icecat.desktop but it depends on the package. If you list the files provided by the package and search for desktop you should find it. Something like:

dpkg-query -L icecat |grep desktop

Thank you again - we’re so nearly there aha.

/usr/share/applications/icecat.desktop is indeed the correct location, as confirmed by your dpkg-query command.

I have edited and saved the icecat.desktop file in vi wherever I found an “Exec=“ line - there were three:

Exec=icecat %u (beneath the “[Desktop Entry]” section)

Exec=icecat —new-window %u (beneath the “[Desktop Action new-window]” section)

Exec=icecat —private-window %u (beneath the “[Desktop Action new-private-window]” section)

The LD_PRELOAD argument I’ve been using to launch IceCat from the command line is:
LD_PRELOAD=/opt/glibc-2.35/lib/libm.so.6 /usr/lib64/icecat/icecat

So I’ve been trying various combinations of that in my edits of the Exec lines of the .desktop file, all without success so far. First, I started by putting that whole command immediately after the “=“ of each Exec line but that made the IceCat icon disappear from my app drawer so I reverted that change and put the whole LD_PRELOAD command just before the “%u” of each Exec line instead. The IceCat icon returned to the app drawer but when tapping on it the browser would still fail to load.

I tried adding “—“ tagged to the start of the LD_PRELOAD command but that didn’t work, so just in case, I tried removing the destination part of the command that goes “/usr/lib64/icecat/icecat” from the Exec lines but that didn’t work. I then tried removing the “—“ tags that I’d used before, in case that was misguided but still no dice.
I removed the LD_PRELOAD command from the second and third Exec lines, returning them to their original state, and left only the first Exec line modified in case modifying all three had been overkill but that didn’t help either.
Finally, I’ve tried prepending the whole LD_PRELOAD command at the start of the “Exec=“ line but before “Exec”, as well as on its own separate line just before the “Exec=“ line (along with all the variations already described above) - still no luck.

I’ve only ever written a script (copied character for character from instructions on a GitHub repo) and made it executable once before but that was a while ago and whilst I don’t remember what it was for I do remember that I felt pretty inadequate whilst trying it so if we can get this .desktop file edit to work that would definitely be quicker.
However, if we can’t then I’ll go and do some reading up on creating scripts and, if it’s ok with you, put my proposal/results here to see what you think?
  Reply
#14
The wrapper script should be something simple like:

#!/bin/sh
LD_PRELOAD=/opt/glibc-2.35/lib/libm.so.6 /usr/lib64/icecat/icecat "$@"

I'm assuming your command line above is correct - I would have expected it to be under /usr/bin or something. The "$@" is so that when you run the script any arguments get passed to icecat. The script needs to be somewhere in the path like /usr/bin, and you'll probably need to be root or use sudo to be able to put it there.
If you call the script /usr/bin/icecat-wrapper then you can make it executable with:

chmod +x /usr/bin/icecat-wrapper

Now in icecat.desktop edit the Exec lines so that instead of calling icecat they call icecat-wrapper instead of icecat, like:

Exec=icecat-wrapper %u
  Reply
#15
(05-07-2022, 04:28 AM)wibble Wrote: The wrapper script should be something simple like:

#!/bin/sh
LD_PRELOAD=/opt/glibc-2.35/lib/libm.so.6 /usr/lib64/icecat/icecat "$@"

I'm assuming your command line above is correct - I would have expected it to be under /usr/bin or something. The "$@" is so that when you run the script any arguments get passed to icecat. The script needs to be somewhere in the path like /usr/bin, and you'll probably need to be root or use sudo to be able to put it there.
If you call the script /usr/bin/icecat-wrapper then you can make it executable with:

chmod +x /usr/bin/icecat-wrapper

Now in icecat.desktop edit the Exec lines so that instead of calling icecat they call icecat-wrapper instead of icecat, like:

Exec=icecat-wrapper %u

Damn that was really above and beyond of you - thanks a bunch, it worked!  Big Grin

So now I’m just left wondering about that “proprietary software” warning in GNOME Software... I was looking at geolocation services in standard Firefox’s about:config a couple of days ago and was disappointed to see that the geo.provider.network.url is set to https://www.googleapis.com/geolocation/v...CE_API_KEY% then surprised that this was the case given that there’s a Github issue from last year pointing out that this should surely be set to Mozilla’s location services API*, not Google’s. I’ve since changed it to Mozilla’s but then I thought I’d better check IceCat’s about:config just in case and was actually quite shocked to see that it was also set to Google’s!

Obviously changing it to Mozilla’s is still far from ideal given that the purpose of GNU IceCat is (as far as I understand) to have a performant Gecko-based browser that’s as stripped of tracking as possible, including Mozilla’s tracking.
Is there a different location services API that would be more preferable to set from a reduced tracking perspective?

*https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%
  Reply
#16
Just set geo.enabled to false? If you want to enable it you'll have to find a provider you trust, or run your own server. Not something I've looked into, but perhaps look at the backends for UnifiedNLP as that's doing something similar for the Android location service.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Hardware VIdeo Acceleration on Mobian biketool 3 462 06-21-2022, 01:01 PM
Last Post: biketool
  cryptocurrency on mobian/pinephone biketool 31 6,033 06-15-2022, 03:14 PM
Last Post: Hobbes42
  Phosh 0.20 beta on mobian Anthony1224 1 214 06-11-2022, 06:29 AM
Last Post: Zebulon Walton
  How to get Pinetime working with Pinephone arkadione 10 616 06-09-2022, 09:16 AM
Last Post: Fish
  Pinephone incoming call / SMS notification no ringing / notification volume dcinoz 3 702 06-02-2022, 07:16 AM
Last Post: arkadione
  Dark theme (on Mobian)? TRS-80 9 2,693 05-03-2022, 04:40 AM
Last Post: wibble
  Mobian wiki and IRC forum sticky? biketool 1 194 04-30-2022, 08:24 PM
Last Post: TRS-80
  I'd like to have a Discord client on Mobian lsitongia 4 1,340 04-30-2022, 07:32 PM
Last Post: TRS-80
  Mobian virtual keyboard suddenly buggy HLing 1 267 04-22-2022, 01:21 PM
Last Post: HLing
  Issues with Mobian? Start here. tophneal 0 367 04-21-2022, 11:27 AM
Last Post: tophneal

Forum Jump:


Users browsing this thread: 1 Guest(s)