6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linuxデスクトップでキーバインドを自由に設定する方法

Last updated at Posted at 2015-06-08

Linuxデスクトップには、その多くにGTK2.0, GTK3.0が使われていることが多いです。私が使用しているAwesomeもGTK2.0を使っています。

そして、多くの包括的ツールにおいて言えることですが、テーマを設定できることが少なくありません。具体的には、ファイルマネージャーやデスクトップ、ログインマネージャーなどですね。

今回の例で言うと、例えば、GTK2.0にEmacsのキーバインドを設定することができます。

ユーザーに設定するには~/.gtkrc-2.0を編集します。

bash
include "/usr/share/themes/Emacs/gtk-2.0-key/gtkrc"
binding "gtk-emacs-text-entry"
{
   bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) }
}

Emacsのキーバインド設定は、/usr/share/themes/Emacsに置いてあるので、そちらを読みこめばよいです。あと、自分で書きたい場合は、include以下のような感じで書いていきます。

そういえば、ChromiumでC-wのキーバインドで単語削除、タブ閉じるを行うのもこの設定でできます。もちろん、ウィンドウマネージャーによって設定ファイルの書き方は異なってくるため、上記設定はあくまでGTK2.0のみ有効なわけですが。あと、GTK3.0も同じような感じですが、多少書き方は異なるかもです。

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?