The app ask you to choose a folder and then trough python SimpleHTTPServer it runs a server that shares that folder using your local IP as address, and using libqrencode it creates a QRCode to make it easy to other people to get access to the server.
Off course the can be improved, I’m not programmer this is just a modified version of the one that I use on my Android device.
Dependencies:
yad
libnotify
python3
qrencode
iproute2
[Desktop Entry]
Name=Share It
Type=Application
Icon=emblem-shared
Exec=share-it.sh
Categories=Utility;
I don’t know which dependencies needs installing nor if the app works on a Librem 5 device because I’m still waiting for mine and I don’t have got the VM working now, but it should work.
From a first quick look at this script I have only two comments to add:
1 - myip=$(ip addr show wlan0
Here you are assuming that the wifi interface is called: wlan0 when in with systemd, in several systems (but not all of them) the interface name is usually: wlp1s0, and this is most likely the case with the Librem 5.
So maybe change the name to wlp1s0, or change that variable to something more name agnostic that greps the correct IP.
That can be used in different systems.
2 - If you have a git repo with this to point to us, we can go there and contribute
Yes, as a said I copied this from the one I use in Android, I just checked the one in my laptop and I made some modifications like the way I get the IP, hostname -I | cut -f 1 -d " " I also print the qrcode in the terminal doing this, qrencode $myip:$myport -t UTF8 but I couldn’t pipe that output to yad.
Can I use https://source.puri.sm/ as git repo or it’s just for Purism team? I’ve got an account there the one that I use to translate squeekboard.
On older systems, it was most likely called wlan0 but newer systems are more likely to use the ironically named ‘predictable naming’ where the name is actually unpredictable but will at least be the same every time you boot.
I think the names with a ‘p’ are PCIe cards and other naming would apply to other means of connection to the system e.g. USB, SDIO.
I would suggest that for 99.9% of Librem 5 devices, just picking any interface starting with wl will get the right interface. However if the kill switch is in use, it may be that the interface disappears. So a script should take that into account if it applies.
Here is the repo @joao.azevedo I uploaded the code with the improved way to get the local IP, I have to add a decent readme but it can be used by the time being.
I looked how using source easybashgui in the script could make the script much more readable (accessible / literate) and working just as well with other UIs / DEs (and with just the command line!), but questioned whether it would be best to have the lib packaged or just shipped with the script.
Hi, if you make the script work like that you can upload it to the git repo, If the lib is in the librem 5 repositories it’s just matter of install it.