Change dark theme, switch in all emacs instances
This commit is contained in:
parent
07dadc4795
commit
2797d9df1f
1 changed files with 9 additions and 4 deletions
13
toggle_theme
13
toggle_theme
|
|
@ -2,11 +2,12 @@
|
||||||
(ns toggle-theme
|
(ns toggle-theme
|
||||||
"Script to toggle between light and dark themes. Inspired by
|
"Script to toggle between light and dark themes. Inspired by
|
||||||
https://github.com/pedrocr/dotfiles/blob/master/.config/sway/envsetup."
|
https://github.com/pedrocr/dotfiles/blob/master/.config/sway/envsetup."
|
||||||
(:require [clojure.java.shell :refer [sh]]))
|
(:require [clojure.java.shell :refer [sh]]
|
||||||
|
[babashka.fs :as fs]))
|
||||||
|
|
||||||
(def themes
|
(def themes
|
||||||
{:emacs
|
{:emacs
|
||||||
{:dark "doom-solarized-dark-high-contrast"
|
{:dark "doom-opera"
|
||||||
:light "doom-solarized-light"}
|
:light "doom-solarized-light"}
|
||||||
:gnome
|
:gnome
|
||||||
{:dark "Adwaita-dark"
|
{:dark "Adwaita-dark"
|
||||||
|
|
@ -55,5 +56,9 @@
|
||||||
theme-preferences)
|
theme-preferences)
|
||||||
(sh "gsettings" "set" "org.gnome.desktop.interface" "color-scheme" (str "prefer-" (name (next-theme))))
|
(sh "gsettings" "set" "org.gnome.desktop.interface" "color-scheme" (str "prefer-" (name (next-theme))))
|
||||||
|
|
||||||
(sh "emacsclient" "-e" (str "(load-theme '" ((:emacs themes) (next-theme)) ")"))
|
(run!
|
||||||
nil))
|
#(sh "emacsclient" "--socket-name" % "--eval" (str "(load-theme '" ((:emacs themes) switch-to) ")"))
|
||||||
|
(map str (fs/list-dir (fs/file (System/getenv "XDG_RUNTIME_DIR") "emacs"))))
|
||||||
|
nil)
|
||||||
|
|
||||||
|
false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue