請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示 [論壇 - 新手村]
正在瀏覽:
1 名遊客
請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員三級
![]() ![]() 註冊日期:
2016/4/18 12:29 所屬群組:
已註冊使用者 等級: 9
HP : 0 / 221
![]() |
各位先進好
如標題Orz,昨天因公去請教同事的時候發現他的ubuntu .C檔有"C"的圖示 忽然發現我的沒有,因為他也不知道為什麼,只能來這請教各位先進了 或是有什麼google的Keyword可以提供 問了的初淺的問題,還請不吝指教 謝謝
2017/2/14 2:35
|
||||||||||
![]() |
回覆: 請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員二級
![]() ![]() 註冊日期:
2013/11/7 9:24 所屬群組:
已註冊使用者 等級: 8
HP : 0 / 187
![]() |
你指的是類似附件的圖示嗎?如果是的話,那只是系統用副檔名做為判定,再以特定的圖示顯示該類檔案,以便使用者以最直覺的方式判定該檔案的種類。
雖說副檔名和檔案實際的類別沒有絕對的關係,但是這個用法在各種不同的系統也行之有年 附件: ![]() ![]()
2017/2/14 9:53
|
||||||||||
![]() |
回覆: 請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
ubuntu_net2016 寫到: 以下提供我測試的簡單紀錄,給您參考。 我的環境是「Xubuntu 16.04 amd64」, 「File Manager」除了預設的「thunar」, 我個人還有安裝「dolphin4」,「nautilus」,「caja」,「pcmanfm」。 我平常慣用的是「dolphin4」,所以圖示(icons)就有您說的「.C檔有"C"的圖示」。 然後「thunar」,「nautilus」,「caja」,「pcmanfm」是「gtk系」的。 執行「xfce4-appearance-settings」,會出現一個設定視窗,如同這一頁的第一張圖。 選擇第二個頁籤「Icons」,如同這一頁的第二張圖, 預設是採用「elementary xfce dark (addon for dark panels)」, 另外有一個「Breeze (Default Plasams 5 Theme)」,我猜應該是我以前有裝一些kde的軟體,所以才有額外安裝這個「icon theme」。 測試了一下,選擇「Breeze」這個「icon theme」, 在「thunar」,「nautilus」,「caja」,「pcmanfm」這幾個「File Manager」, 裡面的「c」檔案,顯示的icon,就會顯示如同您說的「"C"的圖示」。 執行
顯示
執行
顯示
所以您可以安裝「breeze-icon-theme」
然後根據您的「Desktop environment」提供的方式,來設定您的「icon theme」, 設定為「breeze-icon-theme」,我猜應該就會有您要的結果了。 在本文下方,會介紹在「XFCE」的環境下,幾種設定方式,包含使用「xfconf-query」和「xfce4-settings-editor」, 還有透過「dbus」的方式。 ================================================================================ 另外我剛測試的另一個發現,就是在還沒套用「breeze-icon-theme」前,原本是使用「elementary-xfce-dark」。 「thunar」,「nautilus」,「pcmanfm」這幾個「File Manager」, (註:「caja」有些例外,您可以自行測試顯示結果) 只要切換到「View as icons」這個顯示方式, 「c」檔案,顯示的icon,也會顯示如同您說的「"C"的圖示」。 可以看到「View as icons」的顯示是比較大的圖示, 若是「View as detailed List」則是顯示比較小的圖示, 兩個圖示是不一樣的樣式。 下面這四個檔案是同一個樣式,檔案是「symbolic link」,是連結到「text-x-script.png」
下面這四個,則是另一個樣式,顯示「"C"的圖示」,檔案不是「symbolic link」
================================================================================ 然後再來看「breeze-icon-theme」 下面這兩個檔案是同一個樣式,顯示「"C"的圖示」。
下面這兩個檔案是另一個樣式,一樣顯示「"C"的圖示」,不過背景色是綠色。
================================================================================ 使用「lsof」來觀察「File Manager」「開啟」那些檔案, 這個方法,在之前幾個討論有提到,「1」,「2」「3」,「4」。 ## nautilus 先執行「nautilus」
然後執行下面指令,找出「nautilus」的「process id」
顯示 user 19108 0.3 1.4 1250900 57148 ? Sl 17:26 0:03 nautilus --new-window user 19484 0.0 0.0 12884 980 pts/11 S+ 17:44 0:00 grep --color=auto nautilus 或是執行
顯示
然後執行下面指令,找出「process id」是「19108」開啟那些檔案,另外有使用「grep」來過濾
顯示 nautilus 19108 user mem REG 8,18 34236 5375178 /usr/share/icons/Adwaita/icon-theme.cache nautilus 19108 user mem REG 8,18 37264 5380032 /usr/share/icons/hicolor/icon-theme.cache nautilus 19108 user mem REG 8,18 111344 5388166 /usr/share/icons/gnome/icon-theme.cache nautilus 19108 user mem REG 8,18 201688 5388198 /usr/share/icons/elementary-xfce/icon-theme.cache nautilus 19108 user mem REG 8,18 13732 5399847 /usr/share/icons/elementary-xfce-dark/icon-theme.cache 上面的指令可以結合成一行來執行。
原本預期會找到使用那個icon檔案,不過好像是被整合到「icon-theme.cache」, 相關的可以找尋「icon-theme.cache」,可找到一些參考資料,目前尚未深究,先把網址紀錄起來。 * http://askubuntu.com/questions/279773/what-is-icon-theme-cache * https://developer.gnome.org/gtk3/stable/gtk-update-icon-cache.html * https://en.wikipedia.org/wiki/Memory-mapped_file * man gtk-update-icon-cache * https://wiki.archlinux.org/index.php/Icons * https://wiki.xfce.org/howto/install_new_themes * https://wiki.archlinux.org/index.php/GTK%2B#Configuration_tools * https://www.freedesktop.org/wiki/Specifications/xsettings-spec/ * https://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/ ================================================================================ ## dolphin4 執行
執行
顯示
================================================================================ ## pcmanfm 執行
執行
顯示
================================================================================ ## caja 執行
執行
顯示
================================================================================ ## thunar 執行
執行
顯示
================================================================================ ## 以下是測試過程中查到的網址或是檔案路徑,列出來提供參考 * /usr/share/icons/elementary-xfce/mimes/32/text-x-csrc.png * /usr/share/icons/breeze/mimetypes/32/text-x-csrc.svg * /usr/share/mime/text/x-csrc.xml * grep csrc /usr/share/mime/globs * https://wiki.archlinux.org/index.php/Icons * https://wiki.archlinux.org/index.php/Uniform_look_for_Qt_and_GTK_applications * https://wiki.xfce.org/howto/install_new_themes * http://askubuntu.com/questions/279773/what-is-icon-theme-cache * https://www.google.com.tw/#q=icon-theme.cache * https://www.google.com.tw/#q=icon-cache.kcache+plasma5 * http://docs.xfce.org/xfce/thunar/the-file-manager-window * https://specifications.freedesktop.org/icon-theme-spec/latest/ * https://specifications.freedesktop.org/icon-naming-spec/latest/ ================================================================================ ## xfconf-query 在「XFCE」,除了剛剛提到的,使用「xfce4-appearance-settings」這個「圖形界面(GUI)」工具, 也可以透過「xfconf-query」這個工具,使用「下指令(CLI)」的方式來做修改。 ### 相關參考 * $ man xfconf-query * XFCE Docs / Xfconf-query * XFCE Docs / Configuration Storage System (xfconf) (Package: xfconf) * XFCE Docs / Settings Daemon (xfsettingsd) (Package: xfce4-settings) * XFCE Wiki / Xfce Settings * XFCE Wiki / Xfce 4.6 General Info * ~/.config/xfce4/xfconf/xfce-perchannel-xml/ * ~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml * /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/ * /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml (Package: xfce4-settings) * /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/ * /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml (Package: xubuntu-default-settings) * https://www.freedesktop.org/wiki/Specifications/xsettings-spec/ * https://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/ * https://www.freedesktop.org/wiki/Software/xsettings/ ### 其他參考 * $ apt-cache search xsettings * Package: xsettingsd (GitHub) * xsettings.py (XSettings implementation in Python 3 ) * retext / ReText / xsettings.py * XCB (The X protocol C-language Binding) (Wikipidia (中文)) * The X Window system / The Xlib Manual * xorg / The X New Developer’s Guide * xorg / ProgrammingDocumentation * xorg / Development * xorg / Documentation * xorg / DeveloperStart * GtkSettings (回覆: ezgo 13 LXDE桌面環境 試用小感) ### 操作步驟說明 執行
顯示 Channels: parole thunar-volman xfprint xfce4-notifyd xsettings xfce4-settings-editor displays xfce4-desktop keyboards thunar xfce4-panel ristretto xfce4-keyboard-shortcuts xfce4-settings-manager xfce4-power-manager xfwm4 xfce4-session 執行
顯示
執行
顯示 /Gtk/ButtonImages true /Gtk/CanChangeAccels false /Gtk/ColorPalette black:white:gray50:red:purple:blue:light blue:green:yellow:orange:lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90 /Gtk/CursorThemeName Human /Gtk/CursorThemeSize 24 /Gtk/DecorationLayout menu:minimize,maximize,close /Gtk/FontName Andika 12 /Gtk/IconSizes gtk-button=16,16 /Gtk/KeyThemeName /Gtk/MenuBarAccel F10 /Gtk/MenuImages true /Gtk/ToolbarIconSize 3 /Gtk/ToolbarStyle icons /Net/CursorBlink true /Net/CursorBlinkTime 1200 /Net/DndDragThreshold 8 /Net/DoubleClickDistance 5 /Net/DoubleClickTime 400 /Net/EnableEventSounds false /Net/EnableInputFeedbackSounds false /Net/IconThemeName elementary-xfce-darker /Net/SoundThemeName default /Net/ThemeName Greybird /Xft/Antialias 1 /Xft/DPI 96 /Xft/Hinting 1 /Xft/HintStyle hintslight /Xft/Lcdfilter lcddefault /Xft/RGBA rgb 執行
顯示
執行下面指令,設定「Icon Theme」為「breeze」
執行下面指令,設定「Icon Theme」為原來的預設值
執行下面指令,設定「Icon Theme」為「elementary-xfce-darker」
上面設定,是會立即反應,可以直接看到結果,可以看到「xfce4-panel」或「Whisker Menu」上的圖示會改變, 或是您若有開啟「thunar」,「nautilus」,「caja」,「pcmanfm」這幾個「File Manager」, 也可以看到「圖示」都有相對應的改變。 ================================================================================ ## xfce4-settings-editor 在「XFCE」,除了可以使用「xfconf-query (man)」這個「指令工具(CLI)」, 還有另一個工具「xfce4-settings-editor (man)」,是「圖形界面工具(GUI)」。 而「xfce4-appearance-settings (man)」這個工具,則是屬於「xfce4-settings」其中一個「Dialog(設定對話框)」。 從Settings Editor 這一頁的第一張圖, 可以看到設定畫面拆成兩大區塊,左方是「Channel」,右方是「Property」, 這兩個術語的概念可以參考「Configuration Storage System (xfconf)」的說明。 ### Channel 關於「Channel」,對照「xfconf-query」,可以執行下面指令看到「Channel列表」
顯示
### Property 在左方的「xfce4-settings-editor」的「Channel」, 點選「xsettings」, 可以在右方的「Property」,找到「/Net/IconThemeName」,點選「Value」那個欄位就可以設定, 也可以選定該欄位,然後按下下方的「Edit」按鈕,來編輯「Value」。 對照「xfconf-query」的用法,
經過上面的設定後,可以在「~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml」這個檔案,看到新設定的值。 下方還有兩個按鈕「New」和「Reset」。 可以選定某個「Property」,然後按下「Reset」按鈕,就會恢復該「Property」的預設值。 關於「Channel / xsettings」的「Property」的預設值,可以在「/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml」這個檔案找到。 裡開頭有一段註解 <!-- Default values for the X settings registry as described in http://www.freedesktop.org/wiki/Specifications/XSettingsRegistry --> 所以可以在「XSettingsRegistry」找到「Net/IconThemeName」的說明。 對照「xfconf-query」的用法,
### Monitoring 在左方「Channel」,選定「xsettings」,按下滑鼠右鍵,出現功能選單, 選擇「Monitor」,會出現另一個對話框, 這個功能對照「xfconf-query」的用法,
================================================================================ 由於「xfconfd」是實做成「D-BUS Service」,所以也可以透過「dbus」的方式來溝通操作。 檔案「/usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd」是屬於「xfconf」這個套件。 相關的檔案「/usr/share/dbus-1/services/org.xfce.Xfconf.service」,或是執行「dpkg -L xfconf」找到相關的檔案。 以下使用「qdbus」這個工具來操作,它是屬於「qdbus」這個套件。 其他類似的工具有「gdbus」,「dbus-send」,或是「d-feet」這個圖形界面工具。 執行
顯示
執行
顯示
執行
顯示
執行
顯示 $ <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node> <interface name="org.freedesktop.DBus.Introspectable"> <method name="Introspect"> <arg name="data" direction="out" type="s"/> </method> </interface> <interface name="org.freedesktop.DBus.Properties"> <method name="Get"> <arg name="interface" direction="in" type="s"/> <arg name="propname" direction="in" type="s"/> <arg name="value" direction="out" type="v"/> </method> <method name="Set"> <arg name="interface" direction="in" type="s"/> <arg name="propname" direction="in" type="s"/> <arg name="value" direction="in" type="v"/> </method> <method name="GetAll"> <arg name="interface" direction="in" type="s"/> <arg name="props" direction="out" type="a{sv}"/> </method> </interface> <interface name="org.xfce.Xfconf"> <method name="IsPropertyLocked"> <arg name="channel" type="s" direction="in"/> <arg name="property" type="s" direction="in"/> <arg name="locked" type="b" direction="out"/> </method> <method name="ListChannels"> <arg name="channels" type="as" direction="out"/> </method> <method name="ResetProperty"> <arg name="channel" type="s" direction="in"/> <arg name="property" type="s" direction="in"/> <arg name="recursive" type="b" direction="in"/> </method> <method name="PropertyExists"> <arg name="channel" type="s" direction="in"/> <arg name="property" type="s" direction="in"/> <arg name="exists" type="b" direction="out"/> </method> <method name="GetAllProperties"> <arg name="channel" type="s" direction="in"/> <arg name="property_base" type="s" direction="in"/> <arg name="properties" type="a{sv}" direction="out"/> </method> <method name="GetProperty"> <arg name="channel" type="s" direction="in"/> <arg name="property" type="s" direction="in"/> <arg name="value" type="v" direction="out"/> </method> <method name="SetProperty"> <arg name="channel" type="s" direction="in"/> <arg name="property" type="s" direction="in"/> <arg name="value" type="v" direction="in"/> </method> <signal name="PropertyRemoved"> <arg type="s"/> <arg type="s"/> </signal> <signal name="PropertyChanged"> <arg type="s"/> <arg type="s"/> <arg type="v"/> </signal> </interface> </node> -------------------------------------------------------------------------------- 執行
顯示
對照「xfconf-query」的用法 執行
顯示
-------------------------------------------------------------------------------- 執行
顯示
對照「xfconf-query」的用法 執行
顯示
-------------------------------------------------------------------------------- 執行
顯示
對照「xfconf-query」的用法 執行
顯示
-------------------------------------------------------------------------------- 執行
對照「xfconf-query」的用法 執行
-------------------------------------------------------------------------------- 執行
對照「xfconf-query」的用法 執行
================================================================================ ## 相關工具 * xfconf-query (Package: xfconf) ($ man xfconf-query) * xfce4-settings-editor (Package: xfce4-settings) ($ man xfce4-settings-editor) ## Daemon * xfconfd (Package: xfconf) * xfsettingsd (Package: xfce4-settings) ($ man xfsettingsd) ================================================================================ 後記(2017-02-23): * xfconf-query 的操作案例,紀錄在另一個論壇的「這篇回覆#13」 ================================================================================ 後記(2017-02-28): * xdg-icon-resource 的操作案例和使用方法,紀錄在另一個討論「#11 回覆: 如何安裝 StarUML-v2.8.0-64-bit.deb ?」。 ================================================================================ 關於「update-icon-caches」和「gtk-update-icon-cache」,可以先參考以前寫的「這篇紀錄」, 暫時就不額外寫相關的介紹了。 ================================================================================ 暫告一段落 ![]()
2017/2/14 10:52
|
||||||||||
![]() |
回覆: 請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員三級
![]() ![]() 註冊日期:
2016/4/18 12:29 所屬群組:
已註冊使用者 等級: 9
HP : 0 / 221
![]() |
謝謝回復,這個我知道,會問這問題主要是需要處理開發環境,因同事OK,但我的不行,只好找出環境差異,才發現這個差異 我後來有發現到如果用新建檔案名稱給.c這樣就有icon,但其他的方法不一定,例如我的環境是用VM,我試了一下用VM tool拖曳進去好像就沒有(或是用檔案解壓出來的.c好像也沒有,時間久遠不太確定了Orz), 不過後有找到主要的環境差異後就沒有發生開發上的問題,就沒有繼續看這個差異了
謝謝幫忙,我一開始以為是在ubuntu裡有某些因素會造成編譯環境的判斷會失真 例如同樣的.c檔在某個因素下OS跟編譯環境均會判斷為.c code 但在某個因素下只單純由編譯環境判斷,造成編譯的差別 我看了您的方法感覺都是利用外在的環境與方法讓檔案套上icon而不是讓os自行判斷後補上icon 就沒有進行測試了,不過還是很感謝您的幫忙 另外後連編譯環境的差異在於少安裝了一個開發套件,安裝後就成功了 所以就沒深入研究這個問題了 再次感謝兩位幫忙
2017/3/6 17:09
|
||||||||||
![]() |
回覆: 請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
延續上面「回覆#3」提到的概念,如何使用「xfconf-query」設定「XFCE」的「Icon Theme」,
並且搭配剛剛另一篇討論串的「回覆#3」, 裡面提到的一個「說明」, 以下紀錄如何使用「xfconf-query」來設定「XFCE」的「Theme」。 以「Numix」這個「Theme」為例 執行
顯示
執行下面指令,安裝「numix-gtk-theme」這個套件
執行
可以看到主要是安裝在「/usr/share/themes/Numix」這個路徑。 所以可以執行下面指令,來設定「XFCE」的「Theme」。
* 對照「xfconf-query -c xsettings -p /Net/ThemeName -s 'Numix'」這個指令, 若是使用圖形界面工具的話,則是透過「xfce4-appearance-settings (Appearance)」來設定。 * 對照「xfconf-query -c xfwm4 -p /general/theme -s 'Numix'」這個指令 若是使用圖形界面工具的話,則是透過「xfwm4-settings (Window Manager Preferences)」來設定。 執行下面指令,來獲得值。
執行下面指令,來回復到預設值。
================================================================================ 關於「Theme」放置的路徑 * /usr/share/themes * ~/.local/share/themes * ~/.themes ================================================================================ 以上提供參考,報告完畢
2017/3/10 5:45
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.