diff options
Diffstat (limited to '.config/wmii-hg/theme-emacs')
-rw-r--r-- | .config/wmii-hg/theme-emacs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.config/wmii-hg/theme-emacs b/.config/wmii-hg/theme-emacs new file mode 100644 index 0000000..a45901c --- /dev/null +++ b/.config/wmii-hg/theme-emacs @@ -0,0 +1,16 @@ +#!/hint/bash +# Get theme settings from Emacs + +# emacs_unquote QUOTED_STRING +emacs_unquote() { + local str="$*" + if [[ $str =~ ^\"(.*)\"$ ]]; then + str=${BASH_REMATCH[1]} # un-quote it + str="${str//\\\\/\\}" # \\ -> \ + str="${str//\\\"/\"}" # \" -> " + str="${str//\\n/$'\n'}" # \n -> NL + fi + printf '%s' "$str" +} + +eval "$(emacs_unquote "$(emacsclient --eval "(when (load \"${WMII_CONFPATH}/theme-emacs.el\") (wmii-theme-for-display \"${DISPLAY}\"))")")" |