「ドットファイル」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(文字列「http://www.gnu.org/」を「https://www.gnu.org/」に置換)
(同期)
(2人の利用者による、間の2版が非表示)
1行目: 1行目:
[[Category:ドットファイル]]
+
[[Category:設定ファイル]]
 
[[en:Dotfiles]]
 
[[en:Dotfiles]]
  +
[[pt:Dotfiles]]
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|XDG Base Directory サポート}}
 
{{Related|XDG Base Directory サポート}}
  +
{{Related|X resources}}
 
{{Related articles end}}
 
{{Related articles end}}
 
この記事では''ドットファイル''という名前で周知されているカスタム設定ファイルのユーザーリポジトリを収集しています。
 
この記事では''ドットファイル''という名前で周知されているカスタム設定ファイルのユーザーリポジトリを収集しています。
12行目: 14行目:
 
=== gitignore を使う ===
 
=== gitignore を使う ===
   
ホームディレクトリに [https://git-scm.com/blog/2010/04/11/environment.html git ディレクトリ] を作成することで変更を直接記録することができます。インデックスに追加するファイルは [http://git-scm.com/docs/git-add git add] で選択することを推奨します。
+
ホームディレクトリに [https://git-scm.com/blog/2010/04/11/environment.html git ディレクトリ] を作成することで変更を直接記録することができます。インデックスに追加するファイルは {{man|1|git-add}} で選択することを推奨します。
   
変更が追跡されないファイルが生じないように ([http://git-scm.com/docs/git-clean git clean] で削除されます)、まずは [http://git-scm.com/docs/gitignore gitignore] で全てのファイルを除外してください:
+
変更が追跡されないファイルが生じないように ({{man|1|git-clean}} で削除されます)、まずは {{man|5|gitignore}} で全てのファイルを除外してください:
   
 
{{hc|~/.git/info/exclude|
 
{{hc|~/.git/info/exclude|
23行目: 25行目:
 
$ git add -f ~/.config/*
 
$ git add -f ~/.config/*
   
最後に変更を [http://git-scm.com/docs/git-commit commit] してください:
+
最後に変更を {{man|1|git-commit}} してください:
   
 
$ git commit -a
 
$ git commit -a
   
 
=== 他のツール ===
 
=== 他のツール ===
  +
* {{App|dotbot|ドットファイルリポジトリの git サブモジュールとしてインストールすることができるミニマルなドットファイルマネージャ。|https://github.com/anishathalye/dotbot}}
* {{App|[[etckeeper]]|システム全体の設定が存在する {{ic|/etc}} をバージョン管理します。バージョン管理ソフトウェアが無視するパーミッションやモードを記録することで動作します。様々な SCM システムをバックエンドとして使用可能。フックを使用することでシステムがアップグレードされる前にリポジトリに変更を自動的にコミットできます。|http://joeyh.name/code/etckeeper/|{{Pkg|etckeeper}}}}
 
  +
* {{App|dotdrop|様々なホストのドットファイルを管理するツール。|https://github.com/deadc0de6/dotdrop|{{AUR|dotdrop}}}}
  +
* {{App|dotfiles|$HOME のドットファイルのシンボリックリンクを簡単に管理することができるツール。|https://github.com/jbernard/dotfiles|{{AUR|dotfiles}}}}
  +
* {{App|dotgit|ドットファイルを管理するための包括的なソリューション。|http://github.com/Cube777/dotgit|{{AUR|dotgit}}}}
  +
* {{App|dots|計画的にドットファイルを管理するためのポータブルツール。|https://github.com/EvanPurkhiser/dots|{{AUR|dots-manager}}}}
  +
* {{App|[[etckeeper]]|システム全体の設定が存在する {{ic|/etc}} をバージョン管理します。バージョン管理ソフトウェアが無視するパーミッションやモードを記録することで動作します。様々な SCM システムをバックエンドとして使用可能。フックを使用することでシステムがアップグレードされる前にリポジトリに変更を自動的にコミットできます。|http://etckeeper.branchable.com/|{{Pkg|etckeeper}}}}
 
* {{App|GNU Stow|リポジトリのドットファイルから {{ic|$HOME}} ツリーにシンボリックリンクを作成します。詳しくは [http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html] を見てください。|https://www.gnu.org/software/stow/|{{Pkg|stow}}}}
 
* {{App|GNU Stow|リポジトリのドットファイルから {{ic|$HOME}} ツリーにシンボリックリンクを作成します。詳しくは [http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html] を見てください。|https://www.gnu.org/software/stow/|{{Pkg|stow}}}}
  +
* {{App|homeshick|[[Bash]] で書かれた git ドットファイル同期ツール。|https://github.com/andsens/homeshick|{{AUR|homeshick-git}}}}
  +
* {{App|mackup|アプリケーションの設定を同期する小さな Python ユーティリティ。|https://github.com/lra/mackup|{{AUR|mackup}}}}
 
* {{App|Pearl|ドットファイルやプラグイン、プログラムあるいは git から入手できるあらゆるコードのパッケージマネージャ。システム間でパッケージを簡単に共有・同期することができ、すぐに使える状態にできます。|https://github.com/pearl-core/pearl|{{AUR|pearl-git}}}}
 
* {{App|Pearl|ドットファイルやプラグイン、プログラムあるいは git から入手できるあらゆるコードのパッケージマネージャ。システム間でパッケージを簡単に共有・同期することができ、すぐに使える状態にできます。|https://github.com/pearl-core/pearl|{{AUR|pearl-git}}}}
  +
* {{App|rcm|リポジトリから $HOME ツリーにドットファイルのシンボリックリンクを作成できます。|https://github.com/thoughtbot/rcm|{{AUR|rcm}}}}
 
* {{App|vcsh|全てのドットファイルをひとつのリポジトリで管理するのではなく、様々なモジュール (Emacs の設定や zsh の設定など) を別々のリポジトリに分割することで管理を分けることができます。git でしか動作しません。|https://github.com/RichiH/vcsh|{{AUR|vcsh}}}}
 
* {{App|vcsh|全てのドットファイルをひとつのリポジトリで管理するのではなく、様々なモジュール (Emacs の設定や zsh の設定など) を別々のリポジトリに分割することで管理を分けることができます。git でしか動作しません。|https://github.com/RichiH/vcsh|{{AUR|vcsh}}}}
* {{App|yadm|ひとつの Git リポジトリを使って複数のシステムでファイルを管理します。特定の OS やホストで別のファイルを使うようにすることができます。機密情報を暗号化することでリポジトリに安全に保存することが可能。|https://github.com/TheLocehiliosan/yadm|{{AUR|yadm}}{{Broken package link|パッケージが存在しません}}}}
+
* {{App|yadm|ひとつの Git リポジトリを使って複数のシステムでファイルを管理します。特定の OS やホストで別のファイルを使うようにすることができます。機密情報を暗号化することでリポジトリに安全に保存することが可能。|https://github.com/TheLocehiliosan/yadm|{{AUR|yadm-git}}}}
* {{App|homeshick|[[Bash]] で書かれた git ドットファイル同期ツール。|https://github.com/andsens/homeshick|{{AUR|homeshick-git}}}}
 
* {{App|dotbot|ドットファイルリポジトリの git サブモジュールとしてインストールすることができるミニマルなドットファイルマネージャ。|https://github.com/anishathalye/dotbot|}}
 
   
 
=== 複数のマシンでドットファイルを管理する ===
 
=== 複数のマシンでドットファイルを管理する ===
46行目: 54行目:
 
ときとして、ソフトウェアはパスワードを平文で設定ファイルに保存することがあります。そのような場合、git clean フィルターを利用することで機密情報を間違ってコミットする危険を減らすことができます。例えば、以下の .gitattributes ファイルは “some-dotfile” ファイルにフィルターを適用します:
 
ときとして、ソフトウェアはパスワードを平文で設定ファイルに保存することがあります。そのような場合、git clean フィルターを利用することで機密情報を間違ってコミットする危険を減らすことができます。例えば、以下の .gitattributes ファイルは “some-dotfile” ファイルにフィルターを適用します:
   
  +
{{hc|.gitattributes|<nowiki>
<pre>
 
# .gitattributes
 
 
some-dotfile filter=remove-pass
 
some-dotfile filter=remove-pass
</pre>
+
</nowiki>}}
   
 
“some-dotfile” ファイルが git にチェックインされた場合、git は “remove-pass” フィルターを実行します。フィルターは {{ic|.git/config}} に以下のように定義してください:
 
“some-dotfile” ファイルが git にチェックインされた場合、git は “remove-pass” フィルターを実行します。フィルターは {{ic|.git/config}} に以下のように定義してください:
   
  +
{{hc|.git/config|<nowiki>
<pre>
 
 
[filter "remove-pass"]
 
[filter "remove-pass"]
 
clean = "sed -e 's/^password=.*/#password=TODO/'"
 
clean = "sed -e 's/^password=.*/#password=TODO/'"
</pre>
+
</nowiki>}}
   
 
== リポジトリ ==
 
== リポジトリ ==
77行目: 84行目:
 
! [https://github.com/awalGarg/dotfiles awal]
 
! [https://github.com/awalGarg/dotfiles awal]
 
| fish || i3 || vim || sakura || tmux || || i3status || || The Lounge
 
| fish || i3 || vim || sakura || tmux || || i3status || || The Lounge
  +
|-
  +
! [https://github.com/ayekat/dotfiles ayekat]
  +
| zsh || karuiwm || vim || rxvt-unicode || tmux || ncmpcpp/mpd || karuibar || mutt || irssi
 
|-
 
|-
 
! [https://github.com/bamos/dotfiles bamos]
 
! [https://github.com/bamos/dotfiles bamos]
83行目: 93行目:
 
! [https://github.com/pbrisbin/dotfiles brisbin33]
 
! [https://github.com/pbrisbin/dotfiles brisbin33]
 
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || screen || || dzen || [https://github.com/pbrisbin/mutt-config mutt] || [https://github.com/pbrisbin/irssi-config irssi]
 
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || screen || || dzen || [https://github.com/pbrisbin/mutt-config mutt] || [https://github.com/pbrisbin/irssi-config irssi]
|-
 
! [https://github.com/bstaletic bstaletic]
 
| [https://github.com/bstaletic/dotfiles/blob/master/.zshrc zsh] || [https://github.com/bstaletic/dotfiles/blob/master/dwm/config.h dwm] || [https://github.com/bstaletic/dotfiles/blob/master/.vimrc vim] || terminator || screen || [https://github.com/bstaletic/blob/master/.ncmpcpp/config ncmpcpp] || [https://github.com/bstaletic/dotfiles/blob/master/.conkyrc conky] || ||
 
 
|-
 
|-
 
! [https://github.com/cinelli/dotfiles cinelli]
 
! [https://github.com/cinelli/dotfiles cinelli]
 
| zsh || dwm || vim || termite-git || || pianobar || htop || mutt-kz || weechat
 
| zsh || dwm || vim || termite-git || || pianobar || htop || mutt-kz || weechat
 
|-
 
|-
! [https://github.com/drkh5h/dotfiles drkhsh]
+
! [https://github.com/0n-s/dotfiles dillebidum]
| zsh || dwm || vim || st || screen || cmus || conky || mutt || weechat
+
| zsh/mksh || dwm/i3 || vim/vis || st || tmux/dvtm || ncmpcpp/mpv || htop/i3blocks || mutt || ii/irssi
 
|-
 
|-
 
! [https://github.com/Earnestly/dotfiles Earnestly]
 
! [https://github.com/Earnestly/dotfiles Earnestly]
104行目: 111行目:
 
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]
 
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]
 
| zsh || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||
 
| zsh || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||
|-
 
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]
 
| zsh || dwm || vim || termite-git || tmux || mpd || conky || mutt || weechat
 
 
|-
 
|-
 
! [https://github.com/hugdru/dotfiles hugdru]
 
! [https://github.com/hugdru/dotfiles hugdru]
125行目: 129行目:
 
! [https://github.com/jelly/Dotfiles jelly]
 
! [https://github.com/jelly/Dotfiles jelly]
 
| zsh || i3 || vim || termite || tmux || ncmpcpp || || mutt-kz-git || weechat
 
| zsh || i3 || vim || termite || tmux || ncmpcpp || || mutt-kz-git || weechat
  +
|-
  +
! [https://github.com/maximbaz/dotfiles maximbaz]
  +
| zsh || i3-gaps || neovim || alacritty || tmux || || py3status || thunderbird ||
 
|-
 
|-
 
! [https://github.com/meskarune/.dotfiles meskarune]
 
! [https://github.com/meskarune/.dotfiles meskarune]
136行目: 143行目:
 
|-
 
|-
 
! [https://github.com/pid1/dotfiles pid1]
 
! [https://github.com/pid1/dotfiles pid1]
| zsh || dwm || neovim || termite || tmux || || custom || mutt || weechat
+
| zsh || dwm || neovim || st || tmux || || custom || mutt || weechat
 
|-
 
|-
 
! [https://github.com/polyzen/dotfiles polyzen]
 
! [https://github.com/polyzen/dotfiles polyzen]
 
| zsh || i3 || vim || termite || tmux || || i3status || || weechat
 
| zsh || i3 || vim || termite || tmux || || i3status || || weechat
 
|-
 
|-
! [https://bitbucket.org/swalladge/dotfiles swalladge]
+
! [https://github.com/sistematico/majestic sistematico]
| zsh/bash || i3 || neovim/vim || termite || tmux || || i3status || ||
+
| zsh/fish/bash || [https://github.com/Airblader/i3 i3 Gaps] || vim/nano || termite || tmux || ncmpcpp || polybar || mutt || weechat
  +
|-
  +
! [https://github.com/swalladge/dotfiles swalladge]
  +
| zsh/bash || i3 || neovim/vim || termite || tmux || cmus || i3pystatus || mutt ||
 
|-
 
|-
 
! [https://github.com/thiagowfx/dotfiles thiagowfx]
 
! [https://github.com/thiagowfx/dotfiles thiagowfx]
157行目: 167行目:
 
|-
 
|-
 
! [https://github.com/Wintervenom/Configuration Wintervenom]
 
! [https://github.com/Wintervenom/Configuration Wintervenom]
| bash || herbstluftwm ||vim || rxvt-unicode || screen ||mpd ([https://github.com/Wintervenom/Scripts/tree/master/audio/mpd mpc-utils]) || [https://github.com/Wintervenom/Scripts/blob/master/wm/herbstluftwm/hlwm-dzen2https://github.com/wolfcore/dotfiles hlwm-dzen2] || mutt || weechat
+
| bash || herbstluftwm ||vim || rxvt-unicode || screen ||mpd ([https://github.com/Wintervenom/Scripts/tree/master/audio/mpd mpc-utils]) || [https://github.com/Wintervenom/Scripts/blob/master/wm/herbstluftwm/hlwm-dzen2 hlwm-dzen2] || mutt || weechat
 
|-
 
|-
 
! [https://github.com/wolfcore/dotfiles wolfcore]
 
! [https://github.com/wolfcore/dotfiles wolfcore]
 
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat
 
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat
|-
 
! [https://github.com/xfausto/dotfiles xfausto]
 
| zsh || dwm || vim || st || || ncmpcpp || conky || ||
 
 
|-
 
|-
 
! [https://github.com/zendeavor zendeavor]
 
! [https://github.com/zendeavor zendeavor]
176行目: 183行目:
 
* [http://dotshare.it dotshare.it]
 
* [http://dotshare.it dotshare.it]
 
* [https://dotfiles.github.io/ dotfiles.github.io]
 
* [https://dotfiles.github.io/ dotfiles.github.io]
  +
* [https://terminal.sexy/ terminal.sexy] - ターミナルのカラースキームデザイナー

2018年4月29日 (日) 14:41時点における版

関連記事

この記事ではドットファイルという名前で周知されているカスタム設定ファイルのユーザーリポジトリを収集しています。

バージョン管理

Git などのバージョン管理ソフトウェアでドットファイルを管理することで、変更を記録したり他のユーザーとファイルを共有したり、複数のホスト間でドットファイルを同期することができます。

gitignore を使う

ホームディレクトリに git ディレクトリ を作成することで変更を直接記録することができます。インデックスに追加するファイルは git-add(1) で選択することを推奨します。

変更が追跡されないファイルが生じないように (git-clean(1) で削除されます)、まずは gitignore(5) で全てのファイルを除外してください:

~/.git/info/exclude
*

それから git add -f で追跡したいファイルだけを追加します:

$ git add -f ~/.config/*

最後に変更を git-commit(1) してください:

$ git commit -a

他のツール

  • dotbot — ドットファイルリポジトリの git サブモジュールとしてインストールすることができるミニマルなドットファイルマネージャ。
https://github.com/anishathalye/dotbot || パッケージが存在しないか AUR で検索
  • dotdrop — 様々なホストのドットファイルを管理するツール。
https://github.com/deadc0de6/dotdrop || dotdropAUR
  • dotfiles — $HOME のドットファイルのシンボリックリンクを簡単に管理することができるツール。
https://github.com/jbernard/dotfiles || dotfilesAUR
  • dotgit — ドットファイルを管理するための包括的なソリューション。
http://github.com/Cube777/dotgit || dotgitAUR
  • dots — 計画的にドットファイルを管理するためのポータブルツール。
https://github.com/EvanPurkhiser/dots || dots-managerAUR
  • etckeeper — システム全体の設定が存在する /etc をバージョン管理します。バージョン管理ソフトウェアが無視するパーミッションやモードを記録することで動作します。様々な SCM システムをバックエンドとして使用可能。フックを使用することでシステムがアップグレードされる前にリポジトリに変更を自動的にコミットできます。
http://etckeeper.branchable.com/ || etckeeper
  • GNU Stow — リポジトリのドットファイルから $HOME ツリーにシンボリックリンクを作成します。詳しくは [1] を見てください。
https://www.gnu.org/software/stow/ || stow
  • homeshickBash で書かれた git ドットファイル同期ツール。
https://github.com/andsens/homeshick || homeshick-gitAUR
  • mackup — アプリケーションの設定を同期する小さな Python ユーティリティ。
https://github.com/lra/mackup || mackupAUR
  • Pearl — ドットファイルやプラグイン、プログラムあるいは git から入手できるあらゆるコードのパッケージマネージャ。システム間でパッケージを簡単に共有・同期することができ、すぐに使える状態にできます。
https://github.com/pearl-core/pearl || pearl-gitAUR
  • rcm — リポジトリから $HOME ツリーにドットファイルのシンボリックリンクを作成できます。
https://github.com/thoughtbot/rcm || rcmAUR
  • vcsh — 全てのドットファイルをひとつのリポジトリで管理するのではなく、様々なモジュール (Emacs の設定や zsh の設定など) を別々のリポジトリに分割することで管理を分けることができます。git でしか動作しません。
https://github.com/RichiH/vcsh || vcshAUR
  • yadm — ひとつの Git リポジトリを使って複数のシステムでファイルを管理します。特定の OS やホストで別のファイルを使うようにすることができます。機密情報を暗号化することでリポジトリに安全に保存することが可能。
https://github.com/TheLocehiliosan/yadm || yadm-gitAUR

複数のマシンでドットファイルを管理する

共有する設定をマスターブランチで管理して、マシンごとのブランチを作成することで、カスタマイズを加えながら様々なマシンのドットファイルを管理するという方法があります。特定のマシンの設定は専用のブランチにコミットし、共通設定はマスターブランチに追加します。そしてマスターを更新したら各マシンのブランチをリベースします。

また、特定のマシンの設定を特殊なコメントブロックに記述して qualia を使って自動的にアンコメントさせるという方法もあります。この方法は手間が少ない上にマージによる衝突が発生しません。

機密情報

ときとして、ソフトウェアはパスワードを平文で設定ファイルに保存することがあります。そのような場合、git clean フィルターを利用することで機密情報を間違ってコミットする危険を減らすことができます。例えば、以下の .gitattributes ファイルは “some-dotfile” ファイルにフィルターを適用します:

.gitattributes
some-dotfile filter=remove-pass

“some-dotfile” ファイルが git にチェックインされた場合、git は “remove-pass” フィルターを実行します。フィルターは .git/config に以下のように定義してください:

.git/config
[filter "remove-pass"]
clean = "sed -e 's/^password=.*/#password=TODO/'"

リポジトリ

作者 シェル WM / DE エディタ ターミナル マルチプレクサ オーディオ モニター メール IRC
Ambrevar zsh awesome emacs rxvt-unicode cmus htop/vicious mutt
awal fish i3 vim sakura tmux i3status The Lounge
ayekat zsh karuiwm vim rxvt-unicode tmux ncmpcpp/mpd karuibar mutt irssi
bamos zsh i3/xmonad vim/emacs rxvt-unicode tmux mpv/cmus conky/xmobar mutt ERC
brisbin33 zsh xmonad vim rxvt-unicode screen dzen mutt irssi
cinelli zsh dwm vim termite-git pianobar htop mutt-kz weechat
dillebidum zsh/mksh dwm/i3 vim/vis st tmux/dvtm ncmpcpp/mpv htop/i3blocks mutt ii/irssi
Earnestly zsh i3/orbment vim/emacs termite tmux mpd conky mutt weechat
ErikBjare zsh xmonad/xfce4 vim terminator tmux xfce4-panel weechat
falconindy bash i3 vim rxvt-unicode ncmpcpp conky mutt
graysky zsh xfce4 vim terminal ncmpcpp custom thunderbird
hugdru zsh awesome neovim rxvt-unicode tmux thunderbird weechat
insanum bash herbstluftwm vim evilvte tmux dzen mutt-kz
izmntuk zsh xfce4 vim rxvt-unicode/yaft tmux cmus xfce4-panel irssi
jasonwryan bash/zsh dwm vim rxvt-unicode tmux ncmpcpp custom mutt irrsi
jdevlieghere zsh xmonad vim terminal tmux htop mutt weechat
jelly zsh i3 vim termite tmux ncmpcpp mutt-kz-git weechat
maximbaz zsh i3-gaps neovim alacritty tmux py3status thunderbird
meskarune bash herbstluftwm vim rxvt-unicode screen conky weechat
neersighted zsh i3 vim rxvt-unicode tmux ncmpcpp htop mutt irssi
OK100 bash dwm vim rxvt-unicode cmus conky, dzen mutt weechat
pid1 zsh dwm neovim st tmux custom mutt weechat
polyzen zsh i3 vim termite tmux i3status weechat
sistematico zsh/fish/bash i3 Gaps vim/nano termite tmux ncmpcpp polybar mutt weechat
swalladge zsh/bash i3 neovim/vim termite tmux cmus i3pystatus mutt
thiagowfx bash/zsh i3 vim/emacs rxvt-unicode ncmpcpp i3blocks
unexist zsh subtle vim rxvt-unicode ncmpcpp mutt irssi
vodik zsh xmonad vim termite-git tmux ncmpcpp custom mutt weechat
w0ng zsh dwm vim rxvt-unicode tmux ncmpcpp custom mutt irssi
Wintervenom bash herbstluftwm vim rxvt-unicode screen mpd (mpc-utils) hlwm-dzen2 mutt weechat
wolfcore bash dwm vim rxvt-unicode tmux cmus custom weechat
zendeavor zsh i3 vim rxvt-unicode tmux ncmpcpp i3status weechat

参照