dbus - Change Emacs 24 theme depending on connected monitors -


i'm using emacs 24 on ubuntu linux running laptop, connected nice external monitor, 1 color theme (using deftheme). when i'm on road, deftheme.

how can make emacs listen monitor connection events, , set theme accordingly?

i doubt there easy way react on changes display configuration. on linux, may lucky find dbus service signals such changes, can react upon means of emacs d-bus library, on os x , windows doubt there such simple way.

you may better off simple key binding toggles between 2 favorite themes:

(defvar my-current-theme nil   "the last used theme.")  (defun my-toggle-themes ()   "toggle between favorite themes."   (let ((new-theme (if (eq my-current-theme 'solarized-light)                        'zenburn 'solarized-light)))     (load-theme new-theme :no-confirm)     (setq my-current-theme new-theme)))  (global-set-key (kbd "c-c t") #'my-toggle-themes) 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -