当前位置: > CentOS > CentOS教程 >

如何在CentOS7中爲新版本Firefox創建桌面快捷圖標

时间:2015-01-08 23:03来源:http://qingtianjiedu.com 作者:http://qingtianjiedu

firefox qingtianjiedu

1.前言
2.需求
3.臨時方案
4.探索過程
5.操作過程

前言:

擎天節度現使用CentOS7,桌面環境爲GNOME,系統自帶Firefox,但版本爲24。remi源中的版本是24.7.0。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[root@localhost ~]# yum --enablerepo=remi-test info firefox
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * epel: mirrors.yun-idc.com
 * nux-dextop: mirror.li.nux.ro
 * remi: remi.kazukioishi.net
 * remi-php55: remi.kazukioishi.net
 * remi-test: remi.kazukioishi.net
Available Packages
Name        : firefox
Arch        : i686
Version     : 24.7.0
Release     : 1.el7.centos
Size        : 49 M
Repo        : updates/7/x86_64
Summary     : Mozilla Firefox Web browser
URL         : http://www.mozilla.org/projects/firefox/
License     : MPLv1.1 or GPLv2+ or LGPLv2+
Description : Mozilla Firefox is an open-source web browser, designed for
            : standards compliance, performance and portability.

Name        : firefox
Arch        : x86_64
Version     : 24.7.0
Release     : 1.el7.centos
Size        : 49 M
Repo        : updates/7/x86_64
Summary     : Mozilla Firefox Web browser
URL         : http://www.mozilla.org/projects/firefox/
License     : MPLv1.1 or GPLv2+ or LGPLv2+
Description : Mozilla Firefox is an open-source web browser, designed for
            : standards compliance, performance and portability.

[root@localhost ~]#
1
2
3
4
5
6
7
8
9
10
#系統信息
[root@localhost ~]# uname 
Linux 
[root@localhost ~]# lsb_release -a 
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch 
Distributor ID: CentOS 
Description:    CentOS Linux release 7.0.1406 (Core) 
Release:    7.0.1406 
Codename:   Core 
[root@localhost ~]#

2014-08-20 19:13:34

Firefox官方最新版本是31,下載地址:https://www.mozilla.org/en-US/firefox/all/
下載解壓後,直接點擊firefox即可運行。但需另外安裝Flash Player,具體可以參考擎天節度另一篇文章——在CentOS7 X64中爲Firefox安裝FlashPlayer插件

需求:

爲新版本Firefox創建桌面快捷圖標

臨時方案:

在此之前,擎天節度是通過創建軟連接到桌面上,點擊打開,但是界面很醜,用戶體驗差。

探索過程:

通過科學上網,在嘗試N多關鍵詞後,找到幾篇博客,通過其中的隻言片語,整合,嘗試,成功。

操作過程:

所有操作在ROOT用戶下進行
(*擎天節度不打算再使用系統自帶的低版本Firefox,故直接卸載,而非2個版本共存。若欲2個版本共存,可第4步時更改其中Exec路徑)
1.Firefox官網下載最新版Firefox for Linux
下載地址:https://www.mozilla.org/en-US/firefox/all/

2.解壓壓縮包至/opt目錄

3.進入/opt/firefox目錄,複製Firefox圖標至/usr/share/pixmaps/下:

1
cp -a /opt/firefox/browser/icons/mozicon128.png /usr/share/pixmaps/firefox.png

(*此操作非常重要,操作 需要用到,確保更名爲firefox.png,否則到時候無法正常顯示Firefox Logo)

4.桌面快捷圖標存放路徑爲/usr/share/applications,文件以.desktop結尾。新建文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
vim /usr/share/applications/firefox.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Firefox Web Browser
GenericName[en]= firefox
Comment=Firefox web browser
Exec=/opt/firefox/firefox %u
Icon=firefox.png
Terminal=false
Type=Application
StartupWMClass=Firefox-bin
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
Categories=Network;Application;

firefox 2014-08-20

firefox horsetong

注:有博文稱需要在/usr/bin中建立軟連接,擎天節度親測後發現,若單純使用桌面快捷圖標打開瀏覽器,而非使用命令行firefox打開,可不進行此操作。

1
ln -s /opt/firefox/firefox /usr/bin/firefox

進行此操作後,在命令行中輸入firefox,可打開firefox瀏覽器。但擎天節度發現一個BUG,會有報錯提示“GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0′ failed
”,擎天節度暫無技術能力解決此問題。

1
2
3
4
5
[root@localhost ~]# ln -s /opt/firefox/firefox /usr/bin/firefox
[root@localhost ~]# firefox

(process:29814): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
[root@localhost ~]#

相關網頁:
https://bbs.archlinux.org/viewtopic.php?id=164476
https://bugzilla.mozilla.org/show_bug.cgi?id=833117
https://bugzilla.mozilla.org/show_bug.cgi?id=672671
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1160569

附:
參考博客:
http://www.linuxdiyf.com/viewarticle.php?id=40517
http://www.libre-software.net/how-to-install-firefox-on-ubuntu-linux-mint
http://blog.snsgou.com/post-466.html


 

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容