【分享】適合 Ubuntu MATE 的面板布局方案 [論壇 - Ubuntu基本設定]


正在瀏覽:   1 名遊客


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

« 1 2 (3) 4 »


回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

## 索引

* #17 - 關於「設定」如何備份和還原的提問
* #19 - 關於「File Manager」的「bookmarks」儲存在哪個檔案
* #20 - 關於「File / Properties / Emblems」
* #18 - 關於「gsettings」和「dconf」的概述
* #22 - 關於「dconf」的備份
* #23 - 簡易介紹「gsettings」這個指令的用法
* #24 - 關於「gschema.xml」的用途
* #25 - 關於「gschema.override」的用途
* #26 - 再次探討「~/.config/dconf/user」這個檔案
* #27 - 如何設定「dconf」的「db」採用「plain text keyfile」的格式
* #28 - 如何設定「dconf」的「預設值」
* #29 - 如何產生一個空的「dconf db」
* #30 - 注意事項
* #32 - 關於「mate-session / required-components」
* #33 - 如何設定「caja」可以按下「F4」,執行「Open in Terminal」的動作
* #34 - 如何設定「pluma」可以按下「F4」,執行「Open Terminal Here」的動作
* #35 - 如何切換「window manager」到「compiz」
* #36 - compiz-profile-switch
* #37 - 如何透過「gsettings」這個指令,設定「Theme」
* #38 - 關於「mate-appearance-properties (Appearance Preferences)」
* #39 - 關於「Meta Theme」

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

## 相關討論

* 【請益】Ubuntu MATE 22.04 如何啟用 Awesome 視窗管理器

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

1/27 21:47:56
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
回覆:「#17

夢見草 寫到:
請教一下 samwhelp 若我想要把我目前的桌面環境的設定備份下來,下回重灌系統時方便很快的匯入設定,因為我找不到匯出匯入的方式,所以每次都要花不少時間手動設定回來。

我說一下我的桌面環境
debian10, mate + compiz + emerald
compiz+emerald 都可在程式介面上找到設定匯出的部份
但是 mate 桌面環境的很多設定我就找不到

...略...


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

我覺得我今天可能寫不完我想要表達的,

所以先簡單作個結論。

* 關於「gsettings」和「dconf」是兩套系統。
* gtk相關的程式是透過「gsettings」的機制,去實作設定。而「dconf」則是做為「gsettings」的後端。
* 關於「dconf」只要跟「預設值」不同的「設定值」,就會紀錄在「~/.config/dconf/user」這個檔案,這個檔是「被compile過的」。

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

## Manpage

* man 7 dconf
* man 1 dconf
* man 1 gsettings

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

執行


file ~/.config/dconf/user



顯示


/home/sam/.config/dconf/user: GVariant Database file, version 0



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

所以關於「dconf」這部份最簡單的備份,就是直接複製「~/.config/dconf/user」這個檔。

然後直接放到新系統的「~/.config/dconf/user」。


cp ~/.config/dconf/user ~/.config/dconf/user.backup



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

若是要將「~/.config/dconf/user」匯出看得懂的格式,只要執行下面指令


dconf dump /




要注意我上面那句,


關於「dconf」只要跟「預設值」不同的「設定值」,就會紀錄在「~/.config/dconf/user」這個檔案



所以匯出來的設定,只會有跟「預設值」不同,才會匯出來。


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

若是要將「~/.config/dconf/user」匯出成「keyfile」,執行下面指令


dconf dump / > user.txt



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

若是要將「keyfile」匯入到「~/.config/dconf/user」,執行下面指令



dconf load / < user.txt



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

也可以匯出和匯入某個群組底下的設定,

就是我在「回覆:#15」提到的用法。

匯出

執行下面指令,將「/org/mate/panel/」這個群組底下的設定匯出


dconf dump /org/mate/panel/ > panel.ini



匯入

執行下面指令,將「panel.ini」匯入到「/org/mate/panel/」這個群組底下


dconf load /org/mate/panel/ < panel.ini



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

以上先簡單介紹關於「dconf」這部份的備份方式

我會慢慢補上,我在「回覆:#18」提到,要寫給您的概念指引。

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


1/27 21:54:31
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

[回到索引]

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

# 簡易介紹「gsettings」這個指令的用法

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

以下我們先重頭介紹起,

先簡單介紹「gsettings」這個指令的用法。

先以「更改桌面圖片」這個設定,當作說明主軸的範例。

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

## Manpage

* man gettings

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

## list-recursively

執行下面指令,


gsettings list-recursively



會顯示很多內容

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

執行下面指令,搭配分頁程式「less」來觀看


gsettings list-recursively | less



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

執行下面指令,搭配「grep」過濾出我們要聚焦的內容


gsettings list-recursively | grep 'org.mate.background picture-filename'



顯示


org.mate.background picture-filename '${prefix}/share/backgrounds/mate/desktop/Stripes.png'



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

## set

執行下面指令,將「org.mate.background picture-filename」設定為「/usr/share/backgrounds/mate/desktop/Float-into-MATE.png」


gsettings set org.mate.background picture-filename "'/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'"




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

## get

執行下面指令,讀取目前「org.mate.background picture-filename」的「設定值」


gsettings get org.mate.background picture-filename



顯示


'/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'



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

## reset

執行下面指令,將「org.mate.background picture-filename」的「設定值」恢復成「預設值」


gsettings reset org.mate.background picture-filename




接著執行下面指令,讀取目前「org.mate.background picture-filename」的「設定值」


gsettings get org.mate.background picture-filename



顯示


'${prefix}/share/backgrounds/mate/desktop/Stripes.png'



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

待續...

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

[回到索引]

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

1/28 1:34:56
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

[回到索引]

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

# 關於「gschema.xml」的用途

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

## 放置資料夾

* /usr/share/glib-2.0/schemas/

在「/usr/share/glib-2.0/schemas/」有放置一些定義檔案,副檔名是「gschema.xml」。

這些檔案,就是用來定義「key」和「default value」等等。

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

執行下面指令,

觀看「/usr/share/glib-2.0/schemas/」這個資料夾,

有放置那些副檔名是「gschema.xml」的檔案


ls /usr/share/glib-2.0/schemas/*.gschema.xml



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

您可以自己作個小實驗,

產生一個檔案「/usr/share/glib-2.0/schemas/demo.gschema.xml」

模仿這些檔案的寫法,

然後記得要執行「sudo glib-compile-schemas /usr/share/glib-2.0/schemas/」才會生效。

就會將結果儲存在「/usr/share/glib-2.0/schemas/gschemas.compiled」這個檔案

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

執行


file /usr/share/glib-2.0/schemas/gschemas.compiled



顯示


/usr/share/glib-2.0/schemas/gschemas.compiled: GVariant Database file, version 0



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

對照「#23」的例子,

執行


grep 'picture-filename' /usr/share/glib-2.0/schemas/*



或是執行


grep 'picture-filename' /usr/share/glib-2.0/schemas/*.gschema.xml



顯示


/usr/share/glib-2.0/schemas/org.mate.background.gschema.xml:    <key name="picture-filename" type="s">




也就是前面操作的「org.mate.background picture-filename」的定義,

可以在「/usr/share/glib-2.0/schemas/org.mate.background.gschema.xml」這個檔案找到。

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

待續...

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

[回到索引]

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

1/28 1:41:21
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

[回到索引]

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

# 關於「gschema.override」的用途

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

## 放置資料夾

* /usr/share/glib-2.0/schemas/

在「/usr/share/glib-2.0/schemas/」除了有放置副檔名是「gschema.xml」的檔案

還會看到另一種副檔名是「gschema.override」的檔案

副檔名是「gschema.override」的檔案,是用來讓我們自己定義自己的「預設值」 (Vendor overrides),

也就是在「compile」後,會採用「gschema.override」裡面的設定,當作「預設值」。

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

沿用前面「#24」的例子,

執行下面指令


grep 'picture-filename' /usr/share/glib-2.0/schemas/org.mate.background.gschema.xml -A 4



顯示


    <key name="picture-filename" type="s">
      <default>'${prefix}/share/backgrounds/mate/desktop/Stripes.png'</default>
      <summary>Picture Filename</summary>
      <description>File to use for the background image.</description>
    </key>



可以看到在「/usr/share/glib-2.0/schemas/org.mate.background.gschema.xml」

定義「org.mate.background picture-filename」的預設值為「${prefix}/share/backgrounds/mate/desktop/Stripes.png」

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

接著來做個小實驗。

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

先執行下面指令,將「org.mate.background picture-filename」的「設定值」恢復成「預設值」


gsettings reset org.mate.background picture-filename



接著執行下面指令,讀取目前「org.mate.background picture-filename」的「設定值」


gsettings get org.mate.background picture-filename



顯示


'${prefix}/share/backgrounds/mate/desktop/Stripes.png'



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

產生一個檔案「/usr/share/glib-2.0/schemas/distro.gschema.override」,

> 主檔名可以任意取,只要副檔名是「gschema.override」即可。

內容如下



[org.mate.background]
picture-filename='/usr/share/backgrounds/default.jpg'




同樣地,要記得要執行「sudo glib-compile-schemas /usr/share/glib-2.0/schemas/」才會生效。

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

接著,可以執行下面指令,來觀察剛剛的設定是否有生效

也就是執行下面指令,讀取目前「org.mate.background picture-filename」的「設定值」


gsettings get org.mate.background picture-filename



顯示


'/usr/share/backgrounds/default.jpg'



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

接著繼續確認,將它設定成其他的值

執行下面指令,將「org.mate.background picture-filename」設定為「/usr/share/backgrounds/mate/desktop/Float-into-MATE.png」


gsettings set org.mate.background picture-filename "'/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'"



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

接著執行下面指令,讀取目前「org.mate.background picture-filename」的「設定值」


gsettings get org.mate.background picture-filename



顯示


'/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'



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

執行下面指令,將「org.mate.background picture-filename」的「設定值」恢復成「預設值」


gsettings reset org.mate.background picture-filename



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


接著執行下面指令,讀取目前「org.mate.background picture-filename」的「設定值」


gsettings get org.mate.background picture-filename



顯示


'/usr/share/backgrounds/default.jpg'



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

待續...

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

[回到索引]

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

1/28 1:49:00
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

[回到索引]

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

# 再次探討「~/.config/dconf/user」這個檔案

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

在前面「#22」,我有提到下面這個論點

* 關於「dconf」,只要跟「預設值」不同的「設定值」,就會紀錄在「~/.config/dconf/user」這個檔案,這個檔是「被compile過的」。

我們來做個小實驗,驗證這個論點

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

## 備份

在做實驗前,先執行下面指令,先將「~/.config/dconf/user」這個檔案備份


cp ~/.config/dconf/user ~/.config/dconf/user.backup




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

先執行下面指令,將「org.mate.background picture-filename」的「設定值」恢復成「預設值」


gsettings reset org.mate.background picture-filename



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

接著執行下面指令,讀取目前「org.mate.background picture-filename」的「設定值」


gsettings get org.mate.background picture-filename



顯示


'/usr/share/backgrounds/default.jpg'



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

接著執行下面指令,


dconf dump / | grep picture-filename



應該是沒有任何顯示,會直接顯示下一個「命令提示字元」

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

接著執行下面指令,將它設定成其他的值

執行下面指令,將「org.mate.background picture-filename」設定為「/usr/share/backgrounds/mate/desktop/Float-into-MATE.png」


gsettings set org.mate.background picture-filename "'/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'"



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

接著執行下面指令,讀取目前「org.mate.background picture-filename」的「設定值」


gsettings get org.mate.background picture-filename



顯示


'/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'



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

接著執行下面指令,


dconf dump / | grep picture-filename



顯示


picture-filename='/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'



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


接著執行下面指令,


grep picture-filename ~/.config/dconf/user -a



應該會看到一些內容,其中「picture-filename」是紅色的字樣

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

今天先介紹到這,後面還有一些進階的議題要表達,太晚所以先睡了

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

待續...

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

[回到索引]

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

1/28 1:55:30
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

[回到索引]

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

# 如何設定「dconf」的「db」採用「plain text keyfile」的格式

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

接下來要介紹進階的議題,

可以搭配閱讀「$ man 7 dconf」來了解相關的概念。

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

執行下面指令,準備「/etc/dconf/profile/」這個資料夾


sudo mkdir -p /etc/dconf/profile



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

接著產生一個檔案「/etc/dconf/profile/user

內容如下


user-db:user



> 原本系統上,預設並沒有「/etc/dconf/profile/user」這個檔案,

> 上面那行「user-db:user」,就是等同沒有這個檔案時的預設設定。

> 意思就是會採用「~/.config/dconf/user」這個檔案,當作「可寫入」的「db」。

> 可以搭配閱讀「man 7 dconf」的「profiles」那個章節

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

在「#22」,有提到「~/.config/dconf/user」是「被compile過的」

接著,我們要修改「/etc/dconf/profile/user」這個檔案的內容,

內容如下


service-db:keyfile/user




> 上面那行「service-db:keyfile/user」,

> 意思就是會採用「~/.config/dconf/user.txt」這個檔案,當作「可寫入」的「db」,並且是「plain text keyfile」的格式

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

接下來就可以來做測試

執行下面指令,將「org.mate.background picture-filename」設定為「/usr/share/backgrounds/mate/desktop/Float-into-MATE.png」


gsettings set org.mate.background picture-filename "'/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'"



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

執行下面指令,將設定匯出觀看


dconf dump /



顯示


[org/mate/desktop/background]
picture-filename='/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'




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

執行下面指令,直接觀看「~/.config/dconf/user.txt」這個檔案的內容


cat ~/.config/dconf/user.txt



顯示


[org/mate/desktop/background]
picture-filename='/usr/share/backgrounds/mate/desktop/Float-into-MATE.png'





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

也可以直接透過「dconf」來設定,

執行下面指令,將「/org/mate/desktop/background/picture-filename」設定為「/usr/share/backgrounds/mate/desktop/Float-into-MATE.png」


dconf write /org/mate/desktop/background/picture-filename "'/usr/share/backgrounds/ubuntu-mate-photos/gabriele-diwald-201135.jpg'"



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

執行下面指令,直接觀看「~/.config/dconf/user.txt」這個檔案的內容


cat ~/.config/dconf/user.txt



顯示


[org/mate/desktop/background]
picture-filename='/usr/share/backgrounds/ubuntu-mate-photos/gabriele-diwald-201135.jpg'




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

執行下面指令,將設定匯出觀看


dconf dump /



顯示


[org/mate/desktop/background]
picture-filename='/usr/share/backgrounds/ubuntu-mate-photos/gabriele-diwald-201135.jpg'




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

透過「dconf」來讀取「/org/mate/desktop/background/picture-filename」的「設定值」

執行下面指令


dconf read /org/mate/desktop/background/picture-filename



顯示


'/usr/share/backgrounds/ubuntu-mate-photos/gabriele-diwald-201135.jpg'




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

透過「gsettings」來讀取「org.mate.background picture-filename」的「設定值」

執行下面指令


gsettings get org.mate.background picture-filename



顯示


'/usr/share/backgrounds/ubuntu-mate-photos/gabriele-diwald-201135.jpg'




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

接著來測試直接修改「~/.config/dconf/user.txt」這個檔案的內容

內容如下


[org/mate/desktop/background]
picture-filename='/usr/share/backgrounds/ubuntu-mate-photos/nasa-53884.jpg'




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

透過「dconf」來讀取「/org/mate/desktop/background/picture-filename」的「設定值」

執行下面指令


dconf read /org/mate/desktop/background/picture-filename



顯示


'/usr/share/backgrounds/ubuntu-mate-photos/nasa-53884.jpg'




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

透過「gsettings」來讀取「org.mate.background picture-filename」的「設定值」

執行下面指令


gsettings get org.mate.background picture-filename



顯示


'/usr/share/backgrounds/ubuntu-mate-photos/nasa-53884.jpg'





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

## Wallpaper Package

* ubuntu-mate-wallpapers-photos / filelist

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

待續...

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

[回到索引]

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

1/28 11:28:25
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

[回到索引]

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

# 如何設定「dconf」的「預設值」

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

執行下面指令,先產生資料夾「/etc/dconf/db/distro.d」


sudo mkdir -p /etc/dconf/db/distro.d



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

延續「#27

修改「/etc/dconf/profile/user」這個檔案的內容,

內容如下


user-db:user
system-db:distro



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

接著執行下面指令


sudo dconf update



就會產生「/etc/dconf/db/distro」,

這個檔案的格式,就跟「~/.config/user」是一樣的,

就是「dconf」的「db」。

接著執行下面指令


file /etc/dconf/db/distro



顯示


/etc/dconf/db/distro: GVariant Database file, version 0




上面「/etc/dconf/profile/user」這個檔案內容的第二行「system-db:distro」,

指的就是「/etc/dconf/db/distro」這個檔案。

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

接著要來新增資料到「/etc/dconf/db/distro」這個「資料庫」。

產生一個檔案「/etc/dconf/db/distro.d/demo.conf」,

內容如下


[org/demo/code]
message="hello"




接著執行下面指令,才會生效


sudo dconf update



也就是「/etc/dconf/db/distro.d/demo.conf」的內容,
會被「compile」到「/etc/dconf/db/distro」這個檔案。

執行下面指令


grep message /etc/dconf/db/distro -a



顯示的內容,其中會有紅色內容的「message」。

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

執行下面指令,讀取「/org/demo/code/message」的值,


dconf read /org/demo/code/message



顯示


'hello'



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

執行下面指令,寫入「/org/demo/code/message」的值,


dconf write /org/demo/code/message "'beautiful-world'"



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

執行下面指令,讀取「/org/demo/code/message」的值,


dconf read /org/demo/code/message



顯示


'beautiful-world'



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

執行下面指令


grep hello /etc/dconf/db/distro -a



顯示的內容,其中會有紅色內容的「hello」。

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


執行下面指令


grep beautiful-world ~/.config/dconf/user -a



顯示的內容,其中會有紅色內容的「beautiful-world」。

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

## 小結

> 也就是「dconf write」會寫入到「~/.config/dconf/user」這個檔案,並不會更動「/etc/dconf/db/distro」這個檔案

> 只有執行「sudo dconf update」,才會更動「/etc/dconf/db/distro」這個檔案。

> 根據的就是「/etc/dconf/profile/user」這個檔案的內容設定

內容如下


user-db:user
system-db:distro



上面有效的第一行「user-db:user」,指的就是「~/.config/dconf/user」這個檔案,是可寫入
上面有效的第二行「system-db:distro」,指的就是「/etc/dconf/db/distro」這個檔案,

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

執行下面指令,觀看「dconf read」的用法


dconf help read



顯示


Usage:
  dconf read [-d] KEY 

Read the value of a key.  -d to read default values.

Arguments:
  KEY         A key path (starting, but not ending with '/')



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

執行下面指令,讀取「/org/demo/code/message」的「設定值」,


dconf read /org/demo/code/message



顯示


'beautiful-world'



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

執行下面指令,讀取「/org/demo/code/message」的「預設值」,


dconf read -d /org/demo/code/message



顯示


'hello'



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

我們也可以設定多個「預設值查找db」

設定「/etc/dconf/profile/user」這個檔案的內容

內容如下


user-db:user
system-db:local
system-db:site
system-db:distro



> 有效的第一行是「user-db:user」,也就是「~/.config/dconf/user」是「可寫入的

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

記得要先準備資料夾

* /etc/dconf/db/local.d
* /etc/dconf/db/site.d
* /etc/dconf/db/distro.d


sudo mkdir -p /etc/dconf/db/local.d
sudo mkdir -p /etc/dconf/db/site.d
sudo mkdir -p /etc/dconf/db/distro.d



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

接著執行


sudo dconf update



就會產生下面三個檔案

* /etc/dconf/db/local
* /etc/dconf/db/site
* /etc/dconf/db/distro

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


| profile 設定       | db                    | 取值「查找順序」                   |
| ----------------- | ---------------------- | ----------------------------- |
| user-db:user      | ~/.config/dconf/user   | 「設定值」  |
| system-db:local   | /etc/dconf/db/local    | 「預設值 1」 |
| system-db:site    | /etc/dconf/db/site     | 「預設值 2」 |
| system-db:distro  | /etc/dconf/db/site     | 「預設值 3」 |




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

也可以設定「/etc/dconf/profile/user」這個檔案的內容

內容如下


service-db:keyfile/user
user-db:user
system-db:local
system-db:site
system-db:distro





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


| profile 設定              | db                    | 取值「查找順序」                   |
| ------------------------ | ---------------------- | ----------------------------- |
| service-db:keyfile/user  | ~/.config/dconf/user   | 「設定值」  |
| user-db:user             | ~/.config/dconf/user   | 「預設值 1」 |
| system-db:local          | /etc/dconf/db/local    | 「預設值 2」 |
| system-db:site           | /etc/dconf/db/site     | 「預設值 3」 |
| system-db:distro         | /etc/dconf/db/site     | 「預設值 4」 |




> 在「/etc/dconf/profile/user」這個檔案的內容

> 有效的第一行是「service-db:keyfile/user」,也就是「~/.config/dconf/user.txt」是「可寫入的

> 請搭配閱讀「man 7 dconf」的「profiles」那個章節

其中有一段說明,摘錄如下


Each line in a profile specifies one dconf database. The first line indicates the database
used to write changes
, and the remaining lines indicate read-only databases. (The first
line should specify a user-db or service-db, so that users can actually make configuration
changes.)



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

## 應用

在「#11」,有提到一種「Gsettings / Relocatable schemas」,

當遇到「Relocatable schemas」,目前我還無法找到直接寫在「gschema.override (Vendor overrides)」的寫法。

所以就改採用這個方式,

會使用到的案例,有「custom-keybind」和「gnome-termina」的設定,

它們都有用到「Relocatable schemas」。

請參考我的實作案例

## System Modeling

* /etc/dconf/profile/user
* /etc/dconf/db/distro.d/

## Arch Packaging

* ezarcher-adjustment-modeling-dconf-default-user-db-initialization
* ezarcher-adjustment-modeling-gnome-terminal
* ezarcher-adjustment-modeling-mate-terminal
* ezarcher-adjustment-modeling-gnome-shell-keybind-custom-by-dconf-db-default
* ezarcher-adjustment-modeling-mate-keybind-custom-by-dconf-db-default
* ezarcher-adjustment-modeling-cinnamon-keybind-custom-by-dconf-db-default

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

待續...

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

[回到索引]

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

1/28 13:26:41
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

[回到索引]

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

# 如何產生一個空的「dconf db」

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

## Manpage

* man 1 dconf

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

執行


dconf help compile



顯示


Usage:
  dconf compile OUTPUT KEYFILEDIR 

Compile a binary database from keyfiles

Arguments:
  OUTPUT      The filename of the (binary) output
  KEYFILEDIR  The path to the .d directory containing keyfiles




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

先產生一個空的資料夾「demo.d」。


mkdir -p demo.d



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

執行下面指令


dconf compile demo demo.d



就會產生「demo」這個空的「dconf db」。

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

執行下面指令


file demo



顯示


demo: GVariant Database file, version 0



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

對照「#28」,

只要在「demo.d」這個資料夾,放置「plain text keyfile」,

接著再度執行「dconf compile demo demo.d」,資料就會被「compile」到「demo」這個檔案。

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

待續...

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

[回到索引]

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

1/28 19:15:12
應用擴展 工具箱
回覆: 【分享】適合 Ubuntu MATE 22.04 的面板布局方案
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29317
EXP: 6
離線
================================================================================

[回到索引]

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

# 注意事項

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

## 「.」 or 「/」

在「#25

提到的「/usr/share/glib-2.0/schemas/」裡面副檔名是「gschema.override」的檔案

舉例內容如下


[org.mate.background]
picture-filename='/usr/share/backgrounds/default.jpg'




> 關於「[org.mate.background]」,分隔的是用「.

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

對照「#27」和「#28

在「dconf」的「db」採用的「plain text keyfile」

舉例內容如下


[org/mate/desktop/background]
picture-filename='/usr/share/backgrounds/default.jpg'




> 關於「[org/mate/desktop/background]」,分隔的是用「/

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

## path

* /usr/share/glib-2.0/schemas/org.mate.background.gschema.xml

執行


grep '"org.mate.background"' /usr/share/glib-2.0/schemas/org.mate.background.gschema.xml



顯示


  <schema id="org.mate.background" path="/org/mate/desktop/background/">



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

在「gsettings」的操作範例


gsetting get org.mate.background picture-filename



也就是「org.mate.background」上面的「id="org.mate.background"」。

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

在「dconf」的操作範例


dconf read /org/mate/desktop/background/picture-filename



也就是「/org/mate/desktop/background/」上面的「path="/org/mate/desktop/background/"」。

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

關於「dconf」和「gsettings」相關的議題,

大致上我想要表達的,應該都表達完了,

所以寫到這,暫告一段落。

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

以上提供參考

報告完畢

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

[回到索引]

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

1/28 19:57:36
應用擴展 工具箱

« 1 2 (3) 4 »

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


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