Favorites can be saved on the fly by dragging the cadena from a web page address to a folder (this doesn't always work, but I don't know why)
I had 2 problems of compatibility between Linux and Windows:
- The *.desktop favorites files could not automatically open a web page on Internet (only the text content of the file)
- Some files were not readable with Ms Windows on Ntfs disk, because of unauthorized characters ( : " * / : < > ? \ | reserved characters )
I found the solutions
( beware, the *.desktop file name on Linux will not necessarily be the same as the one displayed in Windows: it depends on the text content in the file )
> The first thing to do is to move the "*.desktop" files to an empty folder.
There you place the file conversion script convert_desktop2url.bash :
Code: Select all
#!/bin/bash
#case-insensitive
# source - https://www.linuxquestions.org/questions/programming-9/bash-script-convert-ms-url-files-to-linux-desktop-links-4175483877/
shopt -s nocaseglob
#give folder as argument or execute in current directory
[ -n "${1}" -a -d "${1}" ] && cd "${1}"
for file in *.desktop
do
URLLINE=$(grep -Ei url= "$file")
FILENAME=`echo $(basename "$file") | cut -d'.' -f1`
echo -ne "[InternetShortcut]\n$URLLINE" > "$FILENAME.url"
done
https://www.linuxquestions.org/question ... 175483877/
To convert "*.desktop" to "*.url" files :
Code: Select all
$ bash convert_desktop2url.bash
> The second phase is to make compatible some files not recognized because of forbidden characters
So this command line will substitute the characters that are not letters of the alphabet, uppercase [A-Z], lowercase [a-z], digits [0-9], accented characters [àáâäôèéêëçîïùúû] (* but you can add those associated with your language!) , the dot or the dash [.-], by a space "/ /"
Code: Select all
for f in *.url; do nf=$(echo "$f" |sed -e 's/[^A-Za-z0-9àáâäôèéêëçîïùúû.-]/ /g'); test "$f" != "$nf" && mv "$f" "$nf" && echo "$nf"; done
https://serverfault.com/questions/34848 ... 581#987581
This time it should work !