Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.54 KB

README.md

File metadata and controls

52 lines (36 loc) · 1.54 KB

VIM GNOME darkmode sync

Aims to provide a mechanism to sync dark-style mode into running non-GUI local VIM instances under a GNOME desktop. This is likely a stop gap fix until a better approach is available.

Installation

If you use vim-plug, then add the following line to your vimrc file:

Plug 'cheywood/vim-gnome-darkmode-sync'

Or use some other plugin manager:

Requirements

Only works under GNOME; the plugin will check the XDG_CURRENT_DESKTOP environment varible. Python 3 is used to connect to the GNOME dark style preference, requiring the Python 3 bindings for gobject-introspection libraries (python3-gi on Debian-based distros).

Usage

The plugin runs logic upon startup and any change of the dark style preference. By default that logic sets the background light or dark.

If a callback is configured that function will be called with either "dark" or "light" allowing custom logic to be applied. When a custom function is used that replaces the default logic.

Configuration

" Run custom logic upon dark mode switch. Function is called with 'light' or 
" 'dark'
let g:gnome_darkmode_callback = 'CustomDarkmodeChangeFunctionName'

Disclaimer

This is a fairly quick rough cut. There are likely far better ways to do some of this. Use at your own risk, PRs are welcome :)

License

This script is licensed with GPLv3.