dconf-mode/README.org

50 lines
1.5 KiB
Org Mode
Raw Normal View History

* 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 ;;replace with elpaca or similar
(:type git
2024-01-23 14:21:44 -09:00
:repo "https://git.marq42.xyz/mir/dconf-mode"))
#+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? NO
- working with nonexistent directory? NO
- 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