Tôi dựa trên câu trả lời của @ terdon và tạo ra một kịch bản để làm điều tương tự , nhưng làm như vậy theo cách thân thiện hơn với người dùng.
Bạn có thể sử dụng nó như thế này:
gnome-key-bindings --unset-all --except 'close|switch-applications'
Vì tôi thích sử dụng các phím bấm mặc định Alt-F4 và Alt-Tab (và đảo ngược của chúng bằng cách sử dụng shift), điều này sẽ loại bỏ tất cả các phím bấm trừ những phím này.
Nó cũng có một menu trợ giúp tốt đẹp:
List/disable/enable/set gnome-key-bindings
gnome-key-bindings [-h | option] [value]
Options
--list Lists all the current keybindings
--set=key Set a specific keybinding
--unset=key Unsets a specific keybinding
--unset-all Unsets all keybindings
--except=REGEX Filter out keys matching REGEX from being unset
--print-default Prints the default shortcuts per Ubuntu 18.04
Examples:
Clearing all keys except a few:
gnome-key-bindings --unset-all --except "close|switch-applications|switch-input-source|show-desktop"
Setting a shortcut
gnome-key-bindings --set=maximize "<Super>Up"
Để sử dụng nó trên máy của riêng bạn
curl -s https://raw.githubusercontent.com/fatso83/dotfiles/master/utils/scripts/gnome-key-bindings -o gnome-key-bindings
curl -s https://raw.githubusercontent.com/fatso83/dotfiles/master/utils/scripts/easyoptions.sh -o easyoptions.sh
curl -s https://raw.githubusercontent.com/fatso83/dotfiles/master/utils/scripts/easyoptions.rb -o easyoptions.rb
chmod +x ./gnome-key-bindings
sudo mv ./gnome-key-bindings easyoptions.* /usr/local/bin/