Mobile-Friendly Firefox Customizations for Librem 5

Yes, that is a valid option to consider.

How does that work in practice? Would this essentially ignore the error and continue the script? What’s the syntax to implement this?

1 Like

You just put that on the find command! (or in your case on both find commands) e.g.

REPO=$(find ~/ -ipath '*/Mobile-Friendly-Firefox' 2>/dev/null)

2 Likes

It’s that easy? Could there be any issues caused by adding this?

1 Like

Well, yeah, if there are unexpected errors then you won’t see them. So it’s a trade-off.

1 Like

Is there a way to specify the type of error (permission error in this case)?

1 Like

Not directly, no.

My suggestion would be: ignore any errors and just make sure that “REPO” ended up non-empty.

3 Likes

Okay, I have implemented this solution. Thank you very much for the help @irvinewade.

@kms, you should update FriendlyFox to pull this fix. And thank you for alerting me to this problem. If there are any other issues, please let me know, and I will investigate them.

3 Likes

Hum, I gave a different name to the folder in my phone because I already had a mobile-config-firefox folder from the previous repository, so the script wasn’t working. I immediately changed the REPO initialisation to this and then it worked fine:

REPO=$(dirname `realpath $0`)/src

I think that’s much better that trying to find the script from the home directory. It might not even be in the home directory if people clone the repo on the SD card. ($0 allows to get the name of the script as it was executed, realpath to make it absolute, dirname to remove the script name and get the parent directory)

1 Like

This is an interesting approach, but there is an issue. The way that friendlyfox.desktop works is by using find to cd into the directory before running the selected script. I can’t think of any other way for it to work, regardless of the location of the directory. I hadn’t thought about moving it to external storage though; that does complicate things further.

What do you think?

Also, @kms and others, I had forgotten to edit all of the files, so it may be necessary to manually delete and re-clone the repo once more. Sorry about that.

1 Like

Maybe using a log file would even be better instead ignoring the errors. :pencil2:

1 Like

Thank you for the suggestion. I have no idea how to use log files, and will need to learn. I have a lot going on currently, but I’ll put that on my to-do list.

1 Like

I can’t help you either.
My scripting skills are from the past and only for DOS/Windws environments.

2 Likes

I don’t even have scripting skills, unless you count searching the web for how to do basic things in a bash script and building one bit-by-bit. I’m more imaginative than I am proficient in coding or scripting.

2 Likes

In this case, I would not do that, provided that the required directory does get found. As you can see from the recent example, the actual error messages are completely unrelated to the operation and purpose of the script. The error messages are just noise. (In my opinion, find should grow an option to suppress selected error conditions as I often have the experience that I find what I am looking for but I get a bunch of expected and uninteresting permission errors along the way.)

However it would be trivial to replace my suggested /dev/null with an actual file if someone does care to keep the error messages for posterity.

But then if I were actually implementing this then I would have just produced a “unique” fixed directory pathname and claimed that for use by this software i.e. avoided the need for a find at all.

2 Likes

Returned error’s aren’t always helpful or meaningful. I agree, but see my remark as ‘good practise’ while coding. A logfile can be helpful for finding issues you did not think of when writing a script.

3 Likes

@user0 is there a way to apply these customizations to librewolf? I recall seeing something before but can’t find it now.

2 Likes

Yeah, if you have Librewolf installed, running the install.sh script (or using the Friendly-Fox icon) should ask you which browser you want to customize. Unless that’s the only Firefox-based browser you have installed, in which case it should just select it without a prompt. It should also support Mullvad Browser and Tor Browser, but I haven’t tested to verify. I have tested Librewolf flatpak, and it works without issue.

2 Likes

Thanks! that worked. I have LibreWolf - Flatpak, and it worked beautifully!

2 Likes

Hello.
What do you think of FireFox’s UI?
I will also post a screenshot.

http://ftp.us.debian.org/debian/pool/main/f/firefox-esr-mobile-config/
In this, “firefox-esr-mobile-config_3.2.0-1_all.deb”

sudo dpkg -i firefox-esr-mobile-config_3.2.0-1_all.deb

You can use it by installing it.
If you like it, please try using it.

2 Likes

I still prefer Firefox ESR’s toolbar at the top of the screen.

3 Likes