#!/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}\"))")")"