Gnome 3 sử dụng DCONFđể lưu trữ các tùy chọn trong một tệp nhị phân duy nhất : ~/.config/dconf/user.
Theo tài liệu Gnome, bạn chỉ nên lưu các cài đặt mà bạn cần và khôi phục chúng bằng dconfhoặc gsettings. Tuy nhiên, gsettingschỉ có thể khôi phục (các) giá trị cho một khóa duy nhất tại một thời điểm (cộng với giá trị phải được trích dẫn) và điều đó làm cho nó hơi khó xử cho loại nhiệm vụ này. Mà để lại cho chúng tôi với dconf.
Vì vậy, trong trường hợp cụ thể này, hãy lưu cài đặt hiện tại cho các gnome-shellphím tắt 1 :
dconf dump /org/gnome/shell/keybindings/ > bkp
Đây là một bkpmẫu:
[/]
toggle-message-tray=['<Super>m']
open-application-menu=['<Super>F1']
toggle-application-view=['<Control>F1']
focus-active-notification=['<Super>n']
toggle-recording=['<Control><Shift><Alt>r']
Tải cài đặt trên hệ thống khác:
dconf load /org/gnome/shell/keybindings/ < bkp
Phím tắt 1: WM và Media Keys thuộc về các lược đồ khác nhau:
/org/gnome/desktop/wm/keybindings/
/org/gnome/mutter/keybindings/
/org/gnome/mutter/wayland/keybindings/
/org/gnome/settings-daemon/plugins/media-keys/
Lưu ý rằng dconf chỉ bỏ các giá trị không mặc định vì vậy nếu bạn chạy, ví dụ:
dconf dump /org/gnome/desktop/wm/keybindings/
và không nhận được bất kỳ đầu ra nào có nghĩa là không có phím tắt WM tùy chỉnh được xác định.
Là một lưu ý phụ, dconf-editorlà một công cụ giúp trực quan hóa dconfcấu trúc cài đặt, nghĩa là schema [:path] key valueloại và các giá trị mặc định của bất kỳ khóa nào, v.v.
Đối với bản ghi, lưu các tùy chọn với gsettings:
gsettings list-recursively org.gnome.shell.keybindings > bkp
bkp mẫu vật:
org.gnome.shell.keybindings focus-active-notification ['<Super>n']
org.gnome.shell.keybindings open-application-menu ['<Super>F1']
org.gnome.shell.keybindings toggle-application-view ['<Super>a']
org.gnome.shell.keybindings toggle-message-tray ['<Super>m']
org.gnome.shell.keybindings toggle-recording ['<Control><Shift><Alt>r']
Bây giờ đang tải các tùy chọn (như tôi đã nói, đối với mỗi dòng trong tệp sao lưu, bạn cần một lệnh riêng và đừng quên trích dẫn các giá trị):
gsettings set org.gnome.shell.keybindings focus-active-notification "['<Super>n']"
gsettings set org.gnome.shell.keybindings open-application-menu "['<Super>F1']"
gsettings set org.gnome.shell.keybindings toggle-application-view "['<Super>a']"
gsettings set org.gnome.shell.keybindings toggle-message-tray "['<Super>m']"
gsettings set org.gnome.shell.keybindings toggle-recording "['<Control><Shift><Alt>r']"