I have to use a SOCKS5 proxy in order to connect with the matrix network due to the Great Firewall of China. At the same time, I cannot just set the proxy system wide, since I have to browse resources both inside the GFW as well as outside.
For now, running fractal via terminal command works fine so far:
flatpak run --env=all_proxy=socks5h://127.0.0.1:8080 org.gnome.Fractal
This is a workaround, but I would prefer to have a proper application starter integrated with the DE. When I deal with non-flatpak applications, it is rather simple to achieve this in a .desktop file, but when it comes to flatpak applications I fail.
Desktop Entry] Name = Fractal Name[de] = Fractal Version = 1.0 Exec = sh -c ‘flatpak run --env=all_proxy=socks5h://127.0.0.1:8080 org.gnome.Fractal;sleep 5’ Icon = org.gnome.Fractal Terminal = true Type = Application StartupNotify = true X-GNOME-UsesNotifications=true Categories=GNOME;GTK;InstantMessaging; DBusActivatable=true
This is my adapted org.gnome.Fractal.desktop file, but it obviously does not work. Could anybody point me to a solution / correct the errors in my starter?
Some other applications for e.g. Mastodon add a proxy configuration within the application settings. Are there possibly any plans to add this to Fractal as well?
I think the Exec= line needs to be an absolute path?
Instead of creating your own desktop file, try copying the one that Fractal installs (/var/lib/flatpak/exports/share/applications for system install or ~/.local/share/flatpak/exports/share/applications for user install), and just modify that in order to add --env. That should work. Mine looks like this:
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=fractal --file-forwarding org.gnome.Fractal @@u %U @@
I guess you need the environment variable because Fractal ignores your desktop proxy configuration? Well-behaved apps that use GProxyResolver or libproxy won’t look at the environment variable at all if running under GNOME; they will exclusively look at the settings you configure in System Settings → Network → Proxy. This includes all apps that use the proxy resolver portal.
First of all, thank you for your quick reply. Yes, it was smarter to copy the existing .desktop to .local/share/applications. It turned out that I had to rename the desktop file in the folder to something different than org.gnome.Fractalto make this work. Simply passing on the environment variable did not do the trick, I still had to wrap it in a bash command:
I had to add “terminal false”, otherwise the bash command would always load in a terminal window.
Fractal actually works properly when I just set the proxy system wide, but that’s not an option for me. I will point this out in a separate reply in this conversation.
So, summary
copy the original desktop file over from /var/lib/flatpak/exports
paste in .local/share/applications
rename to e.g. FractalProxy.desktop
add the Exec line from above, add the terminal line from above
Let me please explain why this is an unfortunate requirement for people in mainland China. The Matrix protocol is blocked, and the Great Firewall (GFW) is a very sophisticated tool to keep the “local internet” under tight control. So users can only resort to renting a server in e.g. Hong Kong and proxy through via SSH tunneling. Renting an “outside” server is not easy for locals (unlike expats as I am) due to payment constraints, and servers from e.g. Digital Ocean have very high ping and bad latency.
Aliyun (the AWS equivalent of Alibaba) unfortunately is on the rather expensive side concerning traffic costs. Thus, channeling ALL your traffic through this proxy quickly gets expensive.
At the same time, when you have to work on stuff on the “local internet” inside the GFW, you then have to go out the GFW and “come back” again, which makes everything incredibly slow. So you cannot conveniently run Fractal in the background, either. The only solution there is, is to specifically set Fractal to go through that proxy (or which application needs to have exclusive access to the outside world), whereas the regular traffic stays within the Chinese internet.
Unfortunately all these restrictions are enforced very strictly, and I had troubles with our local ISP already.
Another example is the Mastodon protocol. The wonderful maintainers of the Tuba application were so kind as to add proxy settings within the application when I asked them if they could implement this functionality.
I do not try to urge the Fractal team to also add this by default, but I think there are a lot of Chinese developers missing out on collaboration possibilities - or simply joining the wonderful realm of Matrix. I cannot post this solution on the Chinese version of GitLab or this Chinese GitHub Clone, as this would be removed quickly and I possibly get a call from the authorities.
Thanks for your help, and maybe I should bring this issue up on the Gnome GitLab?
Sigh. Almost worked. Element browser application or Electron works fine. Not here. Proxy in logs does not allow this.
There is no way that I can send files on this application in a native “drag and drop” way. This is just pointless, as I certainly do not want to handle stuff with worse UX than ICQ in 1998/1999 on Windows 98 or Windows ME. Right-click file - send to ICQ - contact selection - transfer done.
I am used to use Mattermost within our company realm, since 2013. Drag and drop is a standard since ages ago. Is it either because of the dreaded proxy, or perhaps due to issues in the UI? I think this is something we all should address. There are efforts to be put into this. How can we address these efforts?
I do know and understand developers need to get paid. Obiously, as being a jerk and having been in management position of NPOs to fund certain efforts, my idea was to simple-minded. My assumptions were wrong, so let’s get an understanding here. I could chime in with my companies as a paying entity or contributor:
How much time do we need to implement “right click in Files context menu?” We had this with Empathy and Pidgin before, and it still works with Evolution. Nextcloud has it with sharing via context menu.
How much time do we need for drag and drop, like in the Elements Elektron application?
I am willing to draw up funds, or searching for commercial entities to pay. Unfortunately, our own team is mostly Python or Java, we would not be much of help.
I complained, I made stupid statements - mea culpa, mea maxima culpa - let’s turn this silly complaint of mine instead to an improvement of UI/UX.
You are a foundation. There is money coming in. You get paid, no? Do you need more money? We can donate, no worries. I do not believe that all engineers involved sit at home in their underwear and create software just because of their good-will.
Sorry, I did not mean to accuse anyone. My bad. Gnome team - keep up the work for the greatest desktop I have ever known. I am around since VC-20/C64, and Gnome is imho the bestestest ever seen UI/UX. I am sorry to have steamed off about issues here. (Sometimes us humans fail in being decent people, just because we encounter errands. Mea culpa!)
It is outrageous for me to see, that competent engineers delivering the best desktop UX in my opinion are not getting paid. How come?
A foundation as a managing or legal entity does not mean that this is built on volunteers! I have been a board member of two NPOs in Vienna to represent a country in cultural affairs in front of the UN. 2015-217 we collected funds of 750,000+ Euros, and of course every musician or painter got paid well for their efforts. Everything based on a foundation / NPO / Verein. GNOME is backed by IBM/Canonical, yet contributors here do not see money to feed their cat or buy a pizza while working on the code?
I find this highly unfair, and I made a mistake in my assumptions. Please point me to the right topic area in the Discourse instance here to reach out for a strategic discussion with the foundation guys here. It cannot be that engineers with a highly sophisticated background and wonderful personal efforts are either under-paid or not-paid. This is wrong.
Bro, no worries. I also sit in my underwear sometimes when fixing shit at night. I give you some advice: I bought a bow-tie for the moments when the wife storms in at 02:30 to yell at me why I am this stupid donkey to still work on our company infrastructure.
Learning to do some Spanish Flamenco dancing steps also helps, looks sexy and helps to shut up the drama. Just a tip aside.