49 lines
1.5 KiB
Org Mode
49 lines
1.5 KiB
Org Mode
|
* Pitch:
|
||
|
In essence, this Emacs mode simply loads the data from dconf into ini files,
|
||
|
then applies them after each write to disk. It further provides the variable
|
||
|
=dconf--default-path= to allow more general or specific configuration, as
|
||
|
needed.
|
||
|
|
||
|
The main benefit of using something like this is that your GNOME (or whatever
|
||
|
else) settings are no longer a nebulous binary hive; they are declarative
|
||
|
human-readable text files. They can be version-controlled and distributed
|
||
|
alongside your other dotfiles. They can be viewed in other editors and
|
||
|
environments. They can be =grep='d through.
|
||
|
|
||
|
* Installlation:
|
||
|
With straight.el and use-package:
|
||
|
#+begin_src elisp
|
||
|
(use-package dconf-mode
|
||
|
:straight
|
||
|
(:type git
|
||
|
:repo "https://git.mitchmarq42.xyz/mitch/dconf-mode.el"))
|
||
|
#+end_src
|
||
|
|
||
|
* Usage:
|
||
|
I personally use this to manage my GNOME configuration like so:
|
||
|
|
||
|
#+begin_example
|
||
|
~/.config/gnome-custom-configs
|
||
|
├── desktop.gsets
|
||
|
├── settings-daemon.gsets
|
||
|
├── shell.gsets
|
||
|
└── terminal.gsets
|
||
|
#+end_example
|
||
|
|
||
|
Thus, editing `desktop.gsets' modifies the hive =/org/gnome/desktop/=.
|
||
|
|
||
|
* TODO
|
||
|
** have an option to use a temp buffer
|
||
|
** test
|
||
|
- working with nonexistent files
|
||
|
- older/newer emacs versions
|
||
|
- lexical binding?
|
||
|
|
||
|
* In other editors
|
||
|
To achieve something similar in vim/nvim:
|
||
|
#+begin_src vimscript
|
||
|
autocmd BufReadPre *.gsets silent !dconf dump /org/gnome/%:t:r/ > %
|
||
|
autocmd BufReadPost *.gsets set ft=dosini
|
||
|
autocmd BufWritePost *.gsets silent !cat % | dconf load /org/gnome/%:t:r/
|
||
|
#+end_src
|