Quick Tutorial for OnionShare (including creating and hiding desktop icons)

I really like OnionShare to transport files through internet. However, it has few issues on L5. To get best experience I will give you some hints I figured out (took some time as Linux “newbie”).

Scalability:
OnionShare is not designed for small screens and has hard coded minimum screen size, that’s for no reason bigger then L5-screen and then needed. You have 2 options to handle this:

  1. Scale your monitor scale back to 100%.
  2. Go into mobile settings, hit the “Compositor” menu and enable app scaling for OnionShare. Buttons will be small, but still usable.

OnionShare crashs on 2. or further start up:
There is a known issue - the app doesn’t always remove a file called “lock”, which prevents from starting. You can remove it on ~/.var/app/org.onionshare.OnionShare/config/onionshare. It will be created again each season and will be usually removed if you end the application on normal way (first disconnect, then close app). However, I wrote a little hack to solve this issue permanently:

First create a script (I called it StartOnionShare.sh) in your preferred directory. You can use Texteditor, if you have no better workflow for it. Copy following inside:

#! /bin/bash

rm /home/purism/.var/app/org.onionshare.OnionShare/config/onionshare/lock ;
/usr/bin/flatpak run --branch=stable --arch=aarch64 -- command=onionshare org.onionshare.OnionShare

This will remove that file (if it’s there) and start OnionShare automatically. However, that was just the first step. Now we have to create a desktop icon to start it. Therefor go to ~/local/share/application and create another [filename].desktop file (you can rename [filename] however you want, I named it OnionShare.desktop). Put in these lines:

[Desktop Entry]
Name=OnionShare
Exec=sh /home/purism/[directories to your script from above]/[scriptname].sh
Terminal=false
Type=Application
Icon=org.onionshare.OnionShare
Categories=Network;FileTransfer;
Keywords=tor;anonymity;privacy;onion service;file sharing;file hosting;
StartupNotify= true
StartupWMClass=onionshare
X-Flatpak=org.onionshare.OnionShare

It’s the same file like the usual OnionShare file to create the desktop-icon with just one difference: the Exec command, which will run the script from above.

Now you have 2 desktop icons and I guess you want to remove the original. In same directory as you created the *.desktop file, you have to create another one. You can copy & paste the file above (or the original /var/lib/flatpak/exports/share/applications/org.onionshare.OnionShare.desktop).

[Desktop Entry]
Name=OnionShare
Exec=/usr/bin/flatpak run --branch=stable -- arch-aarch64 --command=onionshare
Terminal=false
Type=Application
Icon=org.onionshare.OnionShare
Categories=Network;FileTransfer;
Keywords=tor;anonymity;privacy;onion service;file sharing;file hosting;
StartupNotify= true
StartupWMClass=onionshare
X-Flatpak=org.onionshare.OnionShare
NoDisplay=true

Let the Exec-line like in original and add NoDisplay=true. This way you haven’t uninstalled or changed anything at original application, but just disabled the desktop icon from original.

Connection lost:
The 3rd big issue I was often running into: I could start the app, but I couldn’t connect to tor-network. It happens when an old background process was not killed before and is still running. Just kill that process in task manager (called something OnionShare with the original icon) and restart OnionShare. Today I had it often that it seems to crash and restart phosh, the before it worked all fine. So save your work before doing this (will make no other issue then closing stuff).

5 Likes