如何在 Linux 中创建网页的快捷方式?

如何在 Linux 中创建网页的快捷方式?

我是 Linux 新手,也不是超级极客。在 Ubuntu 16.04.1 中,你无法像在 Windows 7 中那样将东西拖到桌面上。我想创建一个快捷方式。 我怎样才能做到这一点?

答案1

Chrome 和 Firefox 都允许你将链接拖到桌面,桌面会创建一个 .desktop 文件。此页面如下所示:

[Desktop Entry]
Encoding=UTF-8
Name=Link to launcher - How to create Shortcut to a Web Page in Linux? - Ask Ubuntu
Type=Link
URL=http://askubuntu.com/questions/892588/how-to-create-shortcut-to-a-web-page-in-linux
Icon=text-html

答案2

图标看起来不同。但您可以像在 Windows 中一样从 Firefox 和 Chrome 中拖放网页和链接。

Windows 链接从链接中读取 fav.ico 图标并将该图标显示为链接。Ubuntu 显示一个看起来像折叠页面的通用图标。它将链接页面的标题名称作为图标名称的一部分。

如果你右键单击创建的图标,然后单击以将其打开编辑您将看到页面的详细信息。在这种情况下,问题中的链接包含以下详细信息:

<!doctype html>
<html lang="en" class="ua-ua-">
<head>
    <title>Pop Gold Radio</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=1030" />
    <link rel="shortcut icon" href="favicon.ico" />
    <meta http-equiv="X-UA-Compatible" content="IE=8,9,edge" />
    <meta name="description" content="Pop Gold Radio Webplayer" />
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="js/jquery.jplayer292ed.min.js" title="jquery.jplayer292.swf" id="jpjs"></script>
    <script>page=0;</script>
    <script src="js/site.js?4.2.60"></script>
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,700" />
    <link rel="stylesheet" href="skin/base.css?4.2.60" />
    <script type="text/javascript" src="js/modernizr-custom.js"></script>
    <meta property="og:title" content="StreamLicensing" />
    <meta property="og:description" content="Web player" />
    <meta property="og:type" content="music.radio_station" />
    <meta property="og:url" content="http://player.streamlicensing.com/2430?l=&stream_id=4107" />



</head>
<body class="skin-">
    <div id="blurdiv"></div>
    <div id="container">
        <div id="jpdivmp3" class="jp-jplayer"></div>
        <div id="jpdivm4a" class="jp-jplayer"></div>
        <div id="jw1" class="jp-jplayer"></div>
        <div class="playerbg themebg" style=""></div>
        <div class="player">

            <div class="header titlecolor" style="background-color:rgba(0,0,0, .5)"><span class="head_title" style=""><span id="title">Pop Gold Radio</span></span>
            </div>

            <div id="videoad">
                <div>Your station will play momentarily.</div><div id="videoad_v"></div>
            </div>

            <div id="selector" class="themebg col" style="">
                <div class="themebg2">
                    <table cellspacing="0">
                        <tr style="font-size:19px"></tr>
                    </table>
                </div>
            </div>

            <div id="help" class="last-played">
                <i class="close">&#x2715;</i>               
                <div class="help-inner">
                    <h2 class="titlecolor" id="helptitle">title</h2>
                    <p></p>
                    <div id="privacy"></div>
                </div>
            </div>

            <div id="last-played" class="last-played">
                <i class="close">&#x2715;</i>
                <div id="songhist"></div>
            </div>



            <div class="player-content">
                                <div class="album-art">
                    <img class="songimg" src="configs/images/noalbum-white.png" />
                </div>

                <ul class="jp-controls">
                    <li><div class="jp-playx iconskin" id="playbtn" onclick="play()" title="Play/Stop"></div></li>
                </ul>
                <div class="jp-no-solution">
                    <div>Trouble Listening?</div>
                    <div><a id="directm3u" href="#" onclick="stop()">Download this m3u playlist to listen.</a></div>
                    Or just wait a little longer. The station may be offline, or you may need to update your browser.
                    <span id="nosoladd"></span>
                </div>

                <div class="song-info notrated">
                    <h1 id="song" class="song titlecolor">
                        <noscript>This player definitely requires JavaScript</noscript>
                    </h1>
                    <h2 id="artist" class="artist"></h2>
                    <!--
                    <div class="rating titlecolor">
                        <i>&#x2605;</i> <i>&#x2605;</i> <i>&#x2605;</i> <i>&#x2605;</i> <i>&#x2606;</i>
                    </div> -->                  
                </div>

                <section class="controls cf">
                    <div class="song-controls">
                        <i class="icon buy-open">&#xe73d;<span class="tooltip">Buy Now</span></i>
                        <a href="#" id="lyrics" target="_blank"><i class="icon lyrics-open">&#x266b;<span class="tooltip">Lyrics</span></i></a>
                        <i class="icon share-open">&#xe73c;<span class="tooltip">Share</span></i>
                        <i class="icon help-open">&#x2753;<span class="tooltip">Help &amp; Privacy</span></i>
                        <div id="vu" class="off"></div>
                    </div>
                    <div class="player-controls">
                        <span id="current-time">Stopped</span>
                        <i class="fa icon last-played-open">&#xe005;<span class="tooltip">Last Played</span></i>
                        <i class="fa icon mute" id="muteb"><span id="mutetxt">&#x1F50A;</span><span class="tooltip">Mute</span></i>
                        <div id="volumediv">
                            <div id="volume-fill"></div>
                            <div id="volumeknob"></div>
                            <div id="volume-control" class="iconskin"></div>
                        </div>
                    </div>
                </section>
                <div id="debug">
                                    </div>

            </div>

            <div class="side-content">
                <div class="banner-right"><iframe id="bnf" src="ad-frame.php?revive&z=3&id=3ac6f81f9fefceffd16a855fa764b74a&srv=adserver.cdnstream.com&refr=120" width="300" height="250" noresize="" scrolling="no" hspace="0" vspace="0" frameborder="0" marginheight="0" marginwidth="0"></iframe></div>
            </div>

            <div class="lower-content">
                <div class="banner"><iframe id="bnf" src="ad-frame.php?revive&z=15&id=3ac6f81f9fefceffd16a855fa764b74a&srv=adserver.cdnstream.com&refr=120" width="728" height="90" noresize="" scrolling="no" hspace="0" vspace="0" frameborder="0" marginheight="0" marginwidth="0"></iframe></div>

                <div class="lower-side">
                    <div id="linkbuttons">
                        <!--<a class="facebook" href="http://facebook.com/"><i>&#xf30c;</i></a>
                        <a class="twitter" href="http://twitter.com/"><i>&#xf309;</i></a>-->
                                            </div>
                    <div class="powered-by">Powered by <a target="_blank" href="http://streamlicensing.com/">StreamLicensing.com</a> &amp; <a href="http://last.fm/" target="_blank">last.fm</a><br><img style="margin-top:8px" title="Oi2 Media" src="configs/images/Oi2_28.png" height=28 width=43 /></div>
                </div>
            </div>

            <div class="share-overlay overlay">
                <i class="close">&#x2715;</i>
                <section class="overlay-content">
                    <h2 class="song titlecolor">Share This On</h2>
                    <div class="shricons">
                            <a id="afacebook" class="button facebook" href="javascript:void(window.open('http://www.facebook.com/sharer/sharer.php?s=100&p[title]=Pop+Gold+Radio&p[summary]=&p[url]=http%3A%2F%2Fplayer.streamlicensing.com%2F2430%3Fl%3D%26stream_id%3D4107&p[images][0]=','sharer','toolbar=0,status=0,width=548,height=325'))" tabindex="-1" title="Facebook"><i>&#xf30c;</i></a>
                            <a id="atwitter" class="twitter" href="https://twitter.com/share?url=http%3A%2F%2Fplayer.streamlicensing.com%2F2430%3Fl%3D%26stream_id%3D4107&text=Listening+to+Pop+Gold+Radio" target="_blank" title="Twitter"><i>&#xf309;</i></a></div>
                </section>
            </div>

            <div class="buy-overlay overlay">
                <i class="close">&#x2715;</i>
                <section class="overlay-content">
                    <h2 class="song titlecolor">Buy This Song</h2>
                    <ul class="buy-icons">
                        <li><a id="buyamz" class="amazon iconskin" href="http://amazon.com" target="_blank"><img src="skin/spacer.gif" /></a></li>
                        <li><a id="buyapp" class="itunes iconskin" href="http://itunes.com" target="_blank"><img src="skin/ajax-loader-white.gif" /></a></li>
                    </ul>
                </section>
            </div>

        </div>
    </div>







<script>
slsid = "2430";
autoplay = 1;
playvolume = 0.7;
spotxID = 0;
cc = 1, config = "_streamlicensing";
cfg_synchrobox300 = "", cfg_synchrobox728 = "";
cfg_cc_title = "Pop Gold Radio - %track";
streamcount = 1;
bufferGiveupCount = 18;
var prefer, version = '4.2.60';
mini = 0;
buynowurl = 'http://www.amazon.com/gp/redirect.html?location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie%3DUTF8%26x%3D0%26ref_%3Dnb_sb_noss%26y%3D0%26field-keywords%3D@%26url%3Dsearch-alias%253Ddigital-music&tag=er0bf-20'; //Replace @ with search term
cfg_itunes_at = "11lLzr";
defaultalbumpic = "configs/images/noalbum-white.png";
cfg_albumbackground = "1";
cfg_albumdisplay = "1";
cfg_staticalbumpic = 0;
cfg_NotASongKeywords = "promo,adwtag,awbreak,ais1,ais3,ais6,adcor,admain,station id,stationid".split(",");
cfg_HideNotASong = "1";
cfg_statictrack = "";
client_IP = "50.75.184.41";
lang = "en";
cfg_albumapi = "lastfm";
debug_ = 0;
prefer = 'H';
streams = [{"format":"v2","host":"70.38.12.44","id":"stream","port":8028}];
master = 0;

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-77407212-1', 'auto');
if('') {
  ga('create', '', 'auto', {'name':'tracker2'});
}
ga('send', 'pageview', '/_streamlicensing');
if('') {
    ga('tracker2.send', 'pageview', '/_streamlicensing');
}
</script>
<!-- Quantcast Tag -->
<script type="text/javascript">
var qevents = qevents || [];
(function() {
var elem = document.createElement('script');
elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js";
elem.async = true;
elem.type = "text/javascript";
var scpt = document.getElementsByTagName('script')[0];
scpt.parentNode.insertBefore(elem, scpt);
})();

_qevents.push({
qacct:"p-tY-2Wgagvfr5J"
});
</script>
<noscript>
<div style="display:none;">
<img src="//pixel.quantserve.com/pixel/p-tY-2Wgagvfr5J.gif" border="0" height="1" width="1" alt="Quantcast"/>
</div>
</noscript>
<!-- End Quantcast tag --></body>
</html>

它比您在 Windows 链接中看到的包含更多细节和不同类型的细节,但它确实有效。

如果双击创建的图标,它将直接带您进入该页面,与 Windows 相同。

问题中链接的答案显示了创建 *.desktop laucher 的方法,该laucher 可以为实际图标提供任意数量的自定义外观。但功能基本相同。

相关内容