請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示 [論壇 - 新手村]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示
會員三級
註冊日期:
2016/4/18 12:29
所屬群組:
已註冊使用者
等級: 9
HP : 0 / 221
MP : 39 / 4801
EXP: 84
離線
各位先進好

如標題Orz,昨天因公去請教同事的時候發現他的ubuntu .C檔有"C"的圖示
忽然發現我的沒有,因為他也不知道為什麼,只能來這請教各位先進了
或是有什麼google的Keyword可以提供
問了的初淺的問題,還請不吝指教
謝謝

2017/2/14 2:35
應用擴展 工具箱
回覆: 請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示
會員二級
註冊日期:
2013/11/7 9:24
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 187
MP : 30 / 5423
EXP: 51
離線
你指的是類似附件的圖示嗎?如果是的話,那只是系統用副檔名做為判定,再以特定的圖示顯示該類檔案,以便使用者以最直覺的方式判定該檔案的種類。

雖說副檔名和檔案實際的類別沒有絕對的關係,但是這個用法在各種不同的系統也行之有年

附件:



jpg  擷取選取區域_001.jpg (1.90 KB)
36860_58a262fc0c810.jpg 457X108 px

2017/2/14 9:53
應用擴展 工具箱
回覆: 請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 905
MP : 679 / 30224
EXP: 23
離線
ubuntu_net2016 寫到:
各位先進好

如標題Orz,昨天因公去請教同事的時候發現他的ubuntu .C檔有"C"的圖示
忽然發現我的沒有,因為他也不知道為什麼,只能來這請教各位先進了
或是有什麼google的Keyword可以提供
問了的初淺的問題,還請不吝指教
謝謝



以下提供我測試的簡單紀錄,給您參考。


我的環境是「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"的圖示」。

執行


$ apt-cache search breeze



顯示


libreoffice-style-breeze - office productivity suite -- Breeze symbol style
monitoring-plugins-standard - Plugins for nagios compatible monitoring systems (standard)
breeze - Default Plasma theme (meta-package).
breeze-cursor-theme - Default Plasma cursor theme.
breeze-dbg - debugging symbols for the Breeze desktop theme
breeze-icon-theme - Default Plasma icon theme.
gtk3-engines-breeze - GTK theme built to match KDE's Breeze
kde-style-breeze - Widget style for Qt and KDE Software
kde-style-breeze-qt4 - Widget style for Qt 4 and KDE Software
kwin-style-breeze - KWin Breeze Style
libapache2-mod-passenger - Rails and Rack support for Apache2
libapp-fatpacker-perl - module to pack dependencies onto script files
libsass-dev - C/C++ port of the Sass CSS precompiler - development headers
libsass0 - C/C++ port of the Sass CSS precompiler
libsass0-dbg - C/C++ port of the Sass CSS precompiler - debugging symbols
passenger - Rails and Rack support
passenger-doc - Rails and Rack support for Apache2 - Documentation
plasma-look-and-feel-org-kde-breezedark-desktop - Dark Breeze look-and-feel for Plasma
qml-module-qtquick-controls-styles-breeze - QtQuick style for Qt and KDE Software
ruby-fog-local - Module for the 'fog' gem to support local filesystem storage
ruby-fog-voxel - module for the 'fog' gem to support Voxel
ruby-fog-xml - XML parsing for fog providers
ruby-will-paginate - Pagination for Rails
sddm-theme-breeze - Breeze SDDM theme




執行


$ apt-cache show breeze-icon-theme



顯示


Package: breeze-icon-theme
Priority: extra
Section: universe/kde
Installed-Size: 58638
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Architecture: amd64
Source: breeze-icons (5.18.0-0ubuntu1)
Version: 4:5.18.0-0ubuntu1
Filename: pool/universe/b/breeze-icons/breeze-icon-theme_5.18.0-0ubuntu1_amd64.deb
Size: 2347946
MD5sum: aad4987458296385bf93d1779b14041c
SHA1: 363c03b2d1d94ebef9eab4aac16f2f5a7e9fd955
SHA256: 59b303516578a72c2abcfd3f52b27ca7bea254e994437844f828dc7460a0ea42
Description-en: Default Plasma icon theme.
This is the default icon theme for the KDE Plasma 5 desktop.
.
This package is part of the Breeze theme module.
Description-md5: fa118fac8097974c3aea1c246a5aa6f4
Homepage: https://projects.kde.org/projects/kde/frameworks/breeze-icons
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 3y
Task: kubuntu-desktop, kubuntu-full, edubuntu-desktop-gnome, ubuntustudio-graphics



所以您可以安裝「breeze-icon-theme


$ sudo apt-get install 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」


/usr/share/icons/elementary-xfce/mimes/16/text-x-csrc.png
/usr/share/icons/elementary-xfce/mimes/22/text-x-csrc.png
/usr/share/icons/elementary-xfce/mimes/24/text-x-csrc.png
/usr/share/icons/elementary-xfce/mimes/32/text-x-csrc.png



下面這四個,則是另一個樣式,顯示「"C"的圖示」,檔案不是「symbolic link」


/usr/share/icons/elementary-xfce/mimes/48/text-x-csrc.png
/usr/share/icons/elementary-xfce/mimes/64/text-x-csrc.png
/usr/share/icons/elementary-xfce/mimes/96/text-x-csrc.png
/usr/share/icons/elementary-xfce/mimes/128/text-x-csrc.png



================================================================================

然後再來看「breeze-icon-theme」

下面這兩個檔案是同一個樣式,顯示「"C"的圖示」。


/usr/share/icons/breeze/mimetypes/16/text-x-csrc.svg
/usr/share/icons/breeze/mimetypes/22/text-x-csrc.svg



下面這兩個檔案是另一個樣式,一樣顯示「"C"的圖示」,不過背景色是綠色。


/usr/share/icons/breeze/mimetypes/32/text-x-csrc.svg
/usr/share/icons/breeze/mimetypes/64/text-x-csrc.svg



================================================================================

使用「lsof」來觀察「File Manager」「開啟」那些檔案,
這個方法,在之前幾個討論有提到,「1」,「2」「3」,「4」。

## nautilus

先執行「nautilus」


$ nautilus



然後執行下面指令,找出「nautilus」的「process id」


$ ps axu | grep nautilus



顯示


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




或是執行


$ pidof nautilus



顯示


19108



然後執行下面指令,找出「process id」是「19108」開啟那些檔案,另外有使用「grep」來過濾


$ lsof -p 19108 | grep icon



顯示


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




上面的指令可以結合成一行來執行。


$ lsof -p $(pidof nautilus) | grep icon



原本預期會找到使用那個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

執行


$ dolphin4




執行


$ lsof -p $(pidof dolphin4) | grep icon



顯示


$ dolphin4 19709 user mem REG 8,18 10547304 262858 /var/tmp/kdecache-user/icon-cache.kcache




================================================================================

## pcmanfm

執行


$ pcmanfm




執行


$ lsof -p $(pidof pcmanfm) | grep icon



顯示


pcmanfm 19766 user mem REG 8,18 111344 5388166 /usr/share/icons/gnome/icon-theme.cache
pcmanfm 19766 user mem REG 8,18 201688 5388198 /usr/share/icons/elementary-xfce/icon-theme.cache
pcmanfm 19766 user mem REG 8,18 37264 5380032 /usr/share/icons/hicolor/icon-theme.cache
pcmanfm 19766 user mem REG 8,18 13732 5399847 /usr/share/icons/elementary-xfce-dark/icon-theme.cache




================================================================================

## caja

執行


$ caja




執行


$ lsof -p $(pidof caja) | grep icon



顯示


caja 19808 user mem REG 8,18 37264 5380032 /usr/share/icons/hicolor/icon-theme.cache
caja 19808 user mem REG 8,18 111344 5388166 /usr/share/icons/gnome/icon-theme.cache
caja 19808 user mem REG 8,18 201688 5388198 /usr/share/icons/elementary-xfce/icon-theme.cache
caja 19808 user mem REG 8,18 13732 5399847 /usr/share/icons/elementary-xfce-dark/icon-theme.cache




================================================================================

## thunar

執行


$ thunar




執行


$ lsof -p $(pidof Thunar) | grep icon



顯示


Thunar 2065 user mem REG 8,18 111344 5388166 /usr/share/icons/gnome/icon-theme.cache
Thunar 2065 user mem REG 8,18 37264 5380032 /usr/share/icons/hicolor/icon-theme.cache
Thunar 2065 user mem REG 8,18 201688 5388198 /usr/share/icons/elementary-xfce/icon-theme.cache
Thunar 2065 user mem REG 8,18 13732 5399847 /usr/share/icons/elementary-xfce-dark/icon-theme.cache




================================================================================


## 以下是測試過程中查到的網址或是檔案路徑,列出來提供參考


* /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桌面環境 試用小感)

### 操作步驟說明

執行


$ xfconf-query -l



顯示


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



執行


$ xfconf-query -c xsettings -l



顯示


/Gtk/ButtonImages
/Gtk/CanChangeAccels
/Gtk/ColorPalette
/Gtk/CursorThemeName
/Gtk/CursorThemeSize
/Gtk/DecorationLayout
/Gtk/FontName
/Gtk/IconSizes
/Gtk/KeyThemeName
/Gtk/MenuBarAccel
/Gtk/MenuImages
/Gtk/ToolbarIconSize
/Gtk/ToolbarStyle
/Net/CursorBlink
/Net/CursorBlinkTime
/Net/DndDragThreshold
/Net/DoubleClickDistance
/Net/DoubleClickTime
/Net/EnableEventSounds
/Net/EnableInputFeedbackSounds
/Net/IconThemeName
/Net/SoundThemeName
/Net/ThemeName
/Xft/Antialias
/Xft/DPI
/Xft/Hinting
/Xft/HintStyle
/Xft/Lcdfilter
/Xft/RGBA



執行


$ xfconf-query -c xsettings -l -v



顯示


/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



執行


$ xfconf-query -c xsettings -p /Net/IconThemeName



顯示


elementary-xfce-darker




執行下面指令,設定「Icon Theme」為「breeze」


$ xfconf-query -c xsettings -p /Net/IconThemeName -s breeze



執行下面指令,設定「Icon Theme」為原來的預設值


$ xfconf-query -c xsettings -p /Net/IconThemeName -r




執行下面指令,設定「Icon Theme」為「elementary-xfce-darker」


$ xfconf-query -c xsettings -p /Net/IconThemeName -s 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列表」


$ xfconf-query -l


顯示


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


### Property

在左方的「xfce4-settings-editor」的「Channel」,

點選「xsettings」,

可以在右方的「Property」,找到「/Net/IconThemeName」,點選「Value」那個欄位就可以設定,

也可以選定該欄位,然後按下下方的「Edit」按鈕,來編輯「Value」。

對照「xfconf-query」的用法,


$ xfconf-query -c xsettings -p /Net/IconThemeName -s breeze



經過上面的設定後,可以在「~/.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」的用法,


$ xfconf-query -c xsettings -p /Net/IconThemeName -r



### Monitoring

在左方「Channel」,選定「xsettings」,按下滑鼠右鍵,出現功能選單,
選擇「Monitor」,會出現另一個對話框,

這個功能對照「xfconf-query」的用法,


$ xfconf-query -c xsettings -m -v




================================================================================


由於「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」這個圖形界面工具。

執行


$ qdbus | grep xfce



顯示


org.xfce.SessionManager
org.xfce.Xfconf
org.xfce.PowerManager
org.xfce.SettingsDaemon
org.xfce.FileManager
org.xfce.Thunar
org.xfce.Panel
org.xfce.xfdesktop



執行


$ qdbus org.xfce.Xfconf



顯示


/
/org
/org/xfce
/org/xfce/Xfconf



執行


$ qdbus org.xfce.Xfconf /org/xfce/Xfconf



顯示


method QString org.freedesktop.DBus.Introspectable.Introspect()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface, QString propname)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface)
method void org.freedesktop.DBus.Properties.Set(QString interface, QString propname, QDBusVariant value)
signal void org.xfce.Xfconf.PropertyChanged(QString, QString, QDBusVariant)
signal void org.xfce.Xfconf.PropertyRemoved(QString, QString)
method QVariantMap org.xfce.Xfconf.GetAllProperties(QString channel, QString property_base)
method QDBusVariant org.xfce.Xfconf.GetProperty(QString channel, QString property)
method bool org.xfce.Xfconf.IsPropertyLocked(QString channel, QString property)
method QStringList org.xfce.Xfconf.ListChannels()
method bool org.xfce.Xfconf.PropertyExists(QString channel, QString property)
method void org.xfce.Xfconf.ResetProperty(QString channel, QString property, bool recursive)
method void org.xfce.Xfconf.SetProperty(QString channel, QString property, QDBusVariant value)



執行


$ qdbus org.xfce.Xfconf /org/xfce/Xfconf org.freedesktop.DBus.Introspectable.Introspect



顯示


$ <!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>




--------------------------------------------------------------------------------

執行


$ qdbus org.xfce.Xfconf /org/xfce/Xfconf org.xfce.Xfconf.ListChannels




顯示


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




對照「xfconf-query」的用法

執行


$ xfconf-query -l



顯示


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


--------------------------------------------------------------------------------

執行


$ qdbus org.xfce.Xfconf /org/xfce/Xfconf org.xfce.Xfconf.GetAllProperties xsettings /



顯示


/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/HintStyle: hintslight
/Xft/Hinting: 1
/Xft/Lcdfilter: lcddefault
/Xft/RGBA: rgb



對照「xfconf-query」的用法

執行


$ xfconf-query -c xsettings -l -v



顯示


/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



--------------------------------------------------------------------------------

執行


$ qdbus org.xfce.Xfconf /org/xfce/Xfconf org.xfce.Xfconf.GetProperty xsettings /Net/IconThemeName



顯示


elementary-xfce-darker



對照「xfconf-query」的用法

執行


$ xfconf-query -c xsettings -p /Net/IconThemeName



顯示


elementary-xfce-darker



--------------------------------------------------------------------------------

執行


$ qdbus org.xfce.Xfconf /org/xfce/Xfconf org.xfce.Xfconf.SetProperty xsettings /Net/IconThemeName breeze



對照「xfconf-query」的用法

執行


$ xfconf-query -c xsettings -p /Net/IconThemeName -s breeze



--------------------------------------------------------------------------------

執行


$ qdbus org.xfce.Xfconf /org/xfce/Xfconf org.xfce.Xfconf.ResetProperty xsettings /Net/IconThemeName true



對照「xfconf-query」的用法

執行


$ xfconf-query -c xsettings -p /Net/IconThemeName -r



================================================================================

## 相關工具

* 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
MP : 39 / 4801
EXP: 84
離線

Mark Chang

你指的是類似附件的圖示嗎?如果是的話,那只是系統用副檔名做為判定,再以特定的圖示顯示該類檔案,以便使用者以最直覺的方式判定該檔案的種類。

雖說副檔名和檔案實際的類別沒有絕對的關係,但是這個用法在各種不同的系統也行之有年

謝謝回復,這個我知道,會問這問題主要是需要處理開發環境,因同事OK,但我的不行,只好找出環境差異,才發現這個差異
我後來有發現到如果用新建檔案名稱給.c這樣就有icon,但其他的方法不一定,例如我的環境是用VM,我試了一下用VM tool拖曳進去好像就沒有(或是用檔案解壓出來的.c好像也沒有,時間久遠不太確定了Orz),
不過後有找到主要的環境差異後就沒有發生開發上的問題,就沒有繼續看這個差異了



samwhelp


謝謝幫忙,我一開始以為是在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
MP : 679 / 30224
EXP: 23
離線
延續上面「回覆#3」提到的概念,如何使用「xfconf-query」設定「XFCE」的「Icon Theme」,

並且搭配剛剛另一篇討論串的「回覆#3」,

裡面提到的一個「說明」,

以下紀錄如何使用「xfconf-query」來設定「XFCE」的「Theme」。

以「Numix」這個「Theme」為例

執行


$ apt-cache search Numix



顯示


numix-gtk-theme - Numix GTK2 and GTK3 themes



執行下面指令,安裝「numix-gtk-theme」這個套件


$ sudo apt-get install numix-gtk-theme




執行


$ dpkg -L numix-gtk-theme




可以看到主要是安裝在「/usr/share/themes/Numix」這個路徑。



所以可以執行下面指令,來設定「XFCE」的「Theme」。


xfconf-query -c xsettings -p /Net/ThemeName -s 'Numix'

xfconf-query -c xfwm4 -p /general/theme -s 'Numix'




* 對照「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)」來設定。


執行下面指令,來獲得值。


xfconf-query -c xsettings -p /Net/ThemeName

xfconf-query -c xfwm4 -p /general/theme




執行下面指令,來回復到預設值。


xfconf-query -c xsettings -p /Net/ThemeName -r

xfconf-query -c xfwm4 -p /general/theme -r



================================================================================

關於「Theme」放置的路徑

* /usr/share/themes
* ~/.local/share/themes
* ~/.themes

================================================================================

以上提供參考,報告完畢

2017/3/10 5:45
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.