Skip to content

cheywood/vim-gnome-darkmode-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

A Vim plugin to run logic on GNOME darkmode change

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published