You are not logged in.
Pages: 1
Folks on my local network like to bookmark websites by dragging & dropping from the browser address bar into their file manager.
On Windows machines that creates an Internet Shortcut URL file.
For example, for Pi-Hole it will contain this:
[InternetShortcut]
URL=https://pi-hole.net/
How to make that useful on a Linux machine?
I've written a tiny bit of Python that seems to work.
# UseDesktopLink.py
import sys
import webbrowser
script, filename = sys.argv
file_object = open(filename,'r')
for line in file_object:
#print(line)
if line[0:4]=="URL=":
url=line[4:]
#print("url=",url)
# just in case the line has msdos cr-lf, remove that
url=url.replace('\x0d\x0a', '')
# or just Linux LF
url=url.replace('\x0a', '')
webbrowser.open_new(url)
file_object.close()
I intended it to work with a right-click on the URL file and "Open with ..", "Set default application" then a custom command.
python UseDesktopLink.py %f
But it's not working. 
What might I have forgotten to do?
Offline
wouldn't something like this be much simpler
#!/bin/sh
xdg-open $(grep -oP http.+ "${1}")Offline
@jwm-kit
Thanks, and please excuse my ignorance, how can I use that with "Open with" ?
Would it be "Open with other application" or "Set default application" ?
Or something else?
Offline
man xdg-openBe Excellent to each other and Party On!
 https://www.youtube.com/watch?v=rph_1DODXDU
 https://en.wikipedia.org/wiki/Bill_%26_Ted%27s_Excellent_Adventure
Do unto others as you would have them do instantaneously back to you!
Offline
Pages: 1