Wenn ich im Büro auf meinem Windows 7 Arbeitsrechner beim surfenrrecherchieren auf eine interessante URL stosse, die ich mir später zu Hause noch genauer durchlesen/ansehen möchte, dann ziehe ich das Favicon der URL direkt vom Firefox mittels drag&drop in einen durch Dropbox synchronisierten Ordner im Explorer.
Windows/Firefox erstellt dann eine Datei mit dem <title>-Tag der URL als Namen und der Erweiterung .URL. Der Inhalt der Datei ist beispielsweise
[InternetShortcut] URL=http://am.röschiba.ch/
Unter Windows XP – dem Vorgänger meines Ubuntu Systems – konnte man die Dateiendung .URL mit dem Firefox assoziieren und per Doppelklick im Browser öffnen. Unter Ubuntu bietet Firefox, wenn man die .URL Datei damit öffnet, die Datei aber nur zum Download an und ist nicht fähig die eingebettete URL zu laden.
Da ich ein Gewohnheitstier bin und keine Lust auf irgendwelche Bookmarksynchronisationswerkzeugexperimente hatte, habe ich mir ein kleines Nautilus Script geschrieben, das die gewählte Datei oder die gewählten Dateien interpretiert, die jeweilige URL ausliest und im Firefox in einem neuen Tab öffnet:
#!/bin/bash
# Author : Julian Mollik <jule@creative-coding.net>
# Creation Date : 11/11/2011
# Licence : GNU GPL
#
# extracts the URL from the given Windows .URL files and
# opens each found URL in a new tab in firefox
#
# example of a Windows .URL file content:
# [InternetShortcut]
# URL=http://am.röschiba.ch/
#
# check if at least one file-parameter is given
if [ "$#" -eq 0 ]
then
exit
fi
# loop through all given files
while [ $# -gt 0 ]
do
# read the current file line by line
while read line
do
# check if the first 4 characters are "URL="
if [ "${line:0:4}" == "URL=" ]
then
# remove the found "URL=" by replacing it
# and open the rest in a new firefox tab
firefox -new-tab `echo ${line/URL=/}`
fi
done < "`echo "$1"`"
shift
done
Wie man Nautilus Scripts verwendet steht in diesem Beitrag.
Ann
13/07/2012 18:49
Impressive solution !
However – make it easy:
Just add Wine to your Ubuntu installation. After that, when you try to open a *.url file the first time with Firefox (which is the standard web browser of the current Ubuntu distro) chose „open with Wine program starter“ and make that option the default. From then on Ubuntu Firefox will open any *.url quite like Firefox under MS Windows is doing it since the beginning of time. (Hello Firefox: when will Debian / Ubuntu Firefox open *.url files without Wine as Windows Firefox does ?).
URL-Dateien_sind_cool
30/09/2012 12:21
sieht gut aus. werd ich gleich mal ausprobieren. aber ich möchte auch genauso bequem per drag and drop url-dateien in debian erstellen können :-/
wird wohl nur 2. wahl gehen: copy url in clipboard. add shell extension for nautilus „create url file from clipboard“ – let zenity ask for a title the url-file should have… oder so ähnlich…
jule_
30/09/2012 15:25
Wenn du eine brauchbare Lösung fürs Erstellen von .URL Dateien in Debian/Ubuntu gefunden hast, dann gib doch bitte hier bescheid. Das würde mich auch interessieren!