You are not logged in.

#1 2018-05-05 14:49:27

cuicui-369
Banned
Registered: 2018-04-02
Posts: 18

firefox create url shorcut with favicon

Is there a way to create a url shortcut with a favicon automaticaly.  When I paste the url adress from firefox to my desktop it doesn't take the favicon from the website.  I would like to be able to have url shortcut on my desktop with favicon. When I was using chromium, I was able to get this feature working.  In chromium, I was going throught the 3 dots, then by more tools, then add to desktop. Is there something similar with firefox or add-on.

I'm sure there is something faster than downloading the favicon (from website), then to copy it in /usr/share/icons or pixmaps, then to clic on the url and paste it on the desktop, then configuring the launcher with the downloaded icon.

Last edited by cuicui-369 (2018-05-05 15:31:25)

Offline

#2 2018-05-05 18:06:27

cuicui-369
Banned
Registered: 2018-04-02
Posts: 18

Re: firefox create url shorcut with favicon

I made a script that produce shortcurl url with favicon automatically.  Here the script.  It's quite simple.

#!/bin/bash
echo Enter a url:
read url
shorturl=`echo $url | cut -d '/' -f3`
favicon=`echo http://s2.googleusercontent.com/s2/favicons?domain_url=http://$shorturl`
wget $favicon
urlname=`echo $shorturl | cut -d '.' -f1`
favicon_ico=`echo $urlname.ico`
mv *$shorturl $favicon_ico
sudo mv $favicon_ico /usr/share/icons/favicons
echo [Desktop Entry] >> /home/user/tmp/$urlname.desktop
echo Version=1.0 >> /home/user/tmp/$urlname.desktop
echo Type=Link >> /home/user/tmp/$urlname.desktop
echo Name=$urlname >> /home/user/tmp/$urlname.desktop
echo Comment= >> /home/user/tmp/$urlname.desktop
echo Icon=/usr/share/icons/favicons/$favicon_ico >> /home/user/tmp/$urlname.desktop
echo URL=$url >> /home/user/tmp/$urlname.desktop
chmod +x /home/user/tmp/$urlname.desktop

There is only one problem, the picture that get downloaded (the favicon.ico) is really low quality.

Offline

#3 2018-05-05 19:47:12

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,456

Re: firefox create url shorcut with favicon

For the majority of websites out there, if you simply wget: https://<domainname>/favicon.ico, it's the original icon, not the one that Google may have processed. If you want to get really fancy, wget the homepage, find the <link rel="shortcut icon"> entry in the header and then download the href.

Offline

#4 2018-05-06 08:17:23

Haller
Member
Registered: 2018-04-08
Posts: 45

Re: firefox create url shorcut with favicon

Why do you make the .desktop-File executable?
You don't need that...

Offline

#5 2018-05-06 16:59:17

cuicui-369
Banned
Registered: 2018-04-02
Posts: 18

Re: firefox create url shorcut with favicon

Otherwise this windows happen and I got to choose a choice.

[Launch Anyway / Mark Executable / Cancel]

5lb8mf.png

I'm using Archlinux with Xfce4.

Offline

#6 2018-05-06 17:02:03

Haller
Member
Registered: 2018-04-08
Posts: 45

Re: firefox create url shorcut with favicon

ok

Offline

Board footer

Powered by FluxBB