summaryrefslogtreecommitdiff
path: root/.config/wmii-hg
diff options
context:
space:
mode:
Diffstat (limited to '.config/wmii-hg')
-rw-r--r--.config/wmii-hg/config.sh2
-rw-r--r--.config/wmii-hg/rules2
-rw-r--r--.config/wmii-hg/theme-abyss28
-rw-r--r--.config/wmii-hg/theme-emacs16
-rw-r--r--.config/wmii-hg/theme-emacs.el43
-rw-r--r--.config/wmii-hg/theme-solarized17
-rw-r--r--.config/wmii-hg/theme-solarized-dark12
-rw-r--r--.config/wmii-hg/theme-tango10
-rw-r--r--.config/wmii-hg/theme-tango-dark11
9 files changed, 62 insertions, 79 deletions
diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh
index 02ec65b..6efe4f1 100644
--- a/.config/wmii-hg/config.sh
+++ b/.config/wmii-hg/config.sh
@@ -10,7 +10,7 @@ HIST="$XDG_CACHE_HOME/wmii/history"
mkdir -p -- "${HIST%/*}"
# Colors tuples: "<text> <background> <border>"
-. theme-abyss
+. theme-emacs
log() {
echo "wmiirc[$$]: $*"
diff --git a/.config/wmii-hg/rules b/.config/wmii-hg/rules
index 65f8339..e3a40a2 100644
--- a/.config/wmii-hg/rules
+++ b/.config/wmii-hg/rules
@@ -1,6 +1,8 @@
/wimenu/ floating=always
/panel/ tags=/.*/ floating=always
+/^zoom *:zoom *:/ tags=/.*/ floating=always
+
/^FLTK:FLTK:/ floating=always
/Emacs|Navigator/ force-tags=+sel floating=never
diff --git a/.config/wmii-hg/theme-abyss b/.config/wmii-hg/theme-abyss
deleted file mode 100644
index e297faf..0000000
--- a/.config/wmii-hg/theme-abyss
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/hint/bash
-# Abyss
-
-abyss_orange="#e69f00"
-abyss_skyblue="#56b4e9"
-abyss_bluegreen="#009e73"
-abyss_yellow="#f8ec59"
-abyss_vanilla_cream="#fcfbe3"
-abyss_blue="#0072b2"
-abyss_vermillion="#d55e00"
-abyss_redpurple="#cc79a7"
-abyss_scarlet="#FF1A00"
-abyss_bluegray="#848ea9"
-abyss_background="#050000"
-abyss_background2="#0d1000"
-abyss_foreground="#bbe0f0"
-abyss_hl_line="#00f000"
-abyss_magenta="#ff00ff"
-abyss_hilite="#dd5542"
-abyss_white="#ffffff"
-abyss_green="#00ff00"
-
-WMII_BACKGROUND="${abyss_background}"
-
-# ="<text> <background> <border>"
-WMII_NORMCOLORS="${abyss_redpurple} ${abyss_background2} ${abyss_background2}"
-WMII_FOCUSCOLORS="${abyss_background2} ${abyss_skyblue} ${abyss_bluegray}"
-WMII_URGENTCOLORS="${abyss_vanilla_cream} ${abyss_skyblue} ${abyss_bluegray}"
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}\"))")")"
diff --git a/.config/wmii-hg/theme-emacs.el b/.config/wmii-hg/theme-emacs.el
new file mode 100644
index 0000000..2d74e3b
--- /dev/null
+++ b/.config/wmii-hg/theme-emacs.el
@@ -0,0 +1,43 @@
+(defvar wmii-unspecified-fg "black")
+(defvar wmii-unspecified-bg "white")
+(defvar wmii-unspecified-box "black")
+
+(defun wmii-normalize-color (frame colorname &optional default)
+ "Given an Emacs colorname, normalize it to an \"#rrggbb\" string."
+ (let ((rgb (color-name-to-rgb (or colorname default) frame)))
+ (if rgb
+ (apply 'color-rgb-to-hex (append rgb '(2)))
+ (when default
+ (wmii-normalize-color frame default)))))
+
+(defun wmii-face2triplet (face &optional frame)
+ "Dump an Emacs face as a WMII color triplet."
+ (let ((fg (face-foreground face frame 'default))
+ (bg (face-background face frame 'default))
+ (box (face-attribute face :box frame 'default))
+ (inv (face-inverse-video-p face frame 'default)))
+ (let ((fg (if inv bg fg))
+ (bg (if inv fg bg)))
+ (list (wmii-normalize-color frame fg wmii-unspecified-fg)
+ (wmii-normalize-color frame bg wmii-unspecified-bg)
+ (wmii-normalize-color frame
+ (cond
+ ((equal box nil) bg)
+ ((equal box t) fg)
+ ((stringp box) box)
+ ((listp box) (or (plist-get box :color) fg)))
+ wmii-unspecified-box)))))
+
+(defun wmii-theme (&optional frame)
+ "Dump the current Emacs theme as a WMII theme."
+ (concat
+ "WMII_BACKGROUND='" (car (wmii-face2triplet 'default frame)) "'\n"
+ "WMII_NORMCOLORS='" (string-join (wmii-face2triplet 'mode-line-inactive frame) " ") "'\n"
+ "WMII_FOCUSCOLORS='" (string-join (wmii-face2triplet 'mode-line frame) " ") "'\n"
+ "WMII_URGENTCOLORS='" (string-join (wmii-face2triplet 'mode-line-highlight frame) " ") "'\n"))
+
+(defun wmii-theme-for-display (display)
+ (let ((frame (make-frame-on-display display)))
+ (let ((theme (wmii-theme frame)))
+ (delete-frame frame)
+ theme)))
diff --git a/.config/wmii-hg/theme-solarized b/.config/wmii-hg/theme-solarized
deleted file mode 100644
index 8c40e4d..0000000
--- a/.config/wmii-hg/theme-solarized
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/hint/bash
-SOL_BASE03='#002b36'
-SOL_BASE02='#073642'
-SOL_BASE01='#586e75'
-SOL_BASE00='#657b83'
-SOL_BASE0='#839496'
-SOL_BASE1='#93a1a1'
-SOL_BASE2='#eee8d5'
-SOL_BASE3='#fdf6e3'
-SOL_YELLOW='#b58900'
-SOL_ORANGE='#cb4b16'
-SOL_RED='#dc322f'
-SOL_MAGENTA='#d33682'
-SOL_VIOLET='#6c71c4'
-SOL_BLUE='#268bd2'
-SOL_CYAN='#2aa198'
-SOL_GREEN='#859900'
diff --git a/.config/wmii-hg/theme-solarized-dark b/.config/wmii-hg/theme-solarized-dark
deleted file mode 100644
index fc74b6c..0000000
--- a/.config/wmii-hg/theme-solarized-dark
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/hint/bash
-# Solarized-dark
-
-. theme-solarized
-
-WMII_BACKGROUND="$SOL_BASE02"
-
-# ="<text> <background> <border>"
-WMII_NORMCOLORS="$SOL_BASE0 $SOL_BASE03 $SOL_BASE02"
-WMII_FOCUSCOLORS="$SOL_BASE0 $SOL_BASE02 $SOL_BASE0"
-WMII_URGENTCOLORS="$SOL_RED $SOL_BASE03 $SOL_RED"
-
diff --git a/.config/wmii-hg/theme-tango b/.config/wmii-hg/theme-tango
deleted file mode 100644
index 6ba744f..0000000
--- a/.config/wmii-hg/theme-tango
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/hint/bash
-TANGO_butter=("#fce94f" "#edd400" "#c4a000")
-TANGO_orange=("#fcaf3e" "#f57900" "#ce5c00")
-TANGO_choc=( "#e9b96e" "#c17d11" "#8f5902")
-TANGO_cham=( "#8ae234" "#73d216" "#4e9a06")
-TANGO_blue=( "#729fcf" "#3465a4" "#204a87")
-TANGO_plum=( "#ad7fa8" "#75507b" "#5c3566")
-TANGO_red=( "#ef2929" "#cc0000" "#a40000")
-TANGO_alum=( "#eeeeec" "#d3d7cf" "#babdb6"
- "#888a85" "#555753" "#2e3436")
diff --git a/.config/wmii-hg/theme-tango-dark b/.config/wmii-hg/theme-tango-dark
deleted file mode 100644
index efea1e9..0000000
--- a/.config/wmii-hg/theme-tango-dark
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/hint/bash
-# Tango-tark
-
-. theme-tango
-
-WMII_BACKGROUND="${TANGO_alum[5]}"
-
-# ="<text> <background> <border>"
-WMII_NORMCOLORS="${TANGO_alum[0]} ${TANGO_alum[4]} ${TANGO_alum[3]}"
-WMII_FOCUSCOLORS="${TANGO_alum[5]} ${TANGO_alum[1]} ${TANGO_alum[0]}"
-WMII_URGENTCOLORS="${TANGO_orange[0]} ${TANGO_alum[4]} ${TANGO_orange[4]}"