Update stumpwm config

This commit is contained in:
Tom Willemse 2013-11-03 22:45:45 +01:00
parent 0d5831fa09
commit f4574d968b

View file

@ -1,9 +1,7 @@
;; -*- mode: lisp; -*-
; (require 'swank)
(require 'cl-ppcre)
(in-package :stumpwm)
(load "/usr/share/stumpwm/contrib/app-menu.lisp")
(defmacro elisp (&body body)
"Run BODY through emacsclient."
@ -13,20 +11,23 @@
:wait nil))
;; Naquadah
;; (defun colour (key)
;; (let ((colours (list :lblack #xeeeeec :dblack #x111113
;; :lwhite #xa5a5a4 :dwhite #x222224
;; :lred #xbf6d6d :dred #x744a4a
;; :lorange #xbfa47d :dorange #x73634a
;; :lyellow #xb2bf6d :dyellow #x6b734a
;; :lgreen #x8abf6d :dgreen #x52734a
;; :lturquoise #x7dbf97 :dturquoise #x4a735b
;; :lcyan #x7dbfbf :dcyan #x4a7373
;; :lblue #x6d97bf :dblue #x4a5b73
;; :lpurple #x8a7dbf :dpurple #x524a73
;; :lmagenta #xb27dbf :dmagenta #x6b4a73
;; :lpink #xbf6da4 :dpink #x734a63)))
;; (getf colours key)))
(defun colour (key)
(let ((colours (list :gray1 #x111111
:gray5 #xc2c2c2
:gray6 #xededed
:blue3 #x152e54
:lwhite #xa5a5a4 :dwhite #x222224
:lred #xbf6d6d :dred #x744a4a
:lorange #xbfa47d :dorange #x73634a
:lyellow #xb2bf6d :dyellow #x6b734a
:lgreen #x8abf6d :dgreen #x52734a
:lturquoise #x7dbf97 :dturquoise #x4a735b
:lcyan #x7dbfbf :dcyan #x4a7373
:lblue #x6d97bf :dblue #x4a5b73
:lpurple #x8a7dbf :dpurple #x524a73
:lmagenta #xb27dbf :dmagenta #x6b4a73
:lpink #xbf6da4 :dpink #x734a63)))
(getf colours key)))
(setf *app-menu* '(("Editor" . "emacs")
("Browser" . "conkeror")
@ -35,7 +36,7 @@
("Gimp" . "gimp")))
(defvar *conkeror-program* "conkeror"
"The executable to run to start Conkeror.")
(defvar *emacs-program* "emacsclient -c -a emacs"
(defvar *emacs-program* "emacsclient -c -a \"\""
"The executable to run to start Emacs.")
(defvar *firefox-program* "firefox"
"The executable to run to start Firefox.")
@ -47,8 +48,6 @@
"Hook run right before the screen gets locked.")
(defvar *screen-unlocked-hook* nil
"Hook run right after the screen is unlocked.")
(defvar *mpd-was-playing-p* nil
"Indicator of whether or not MPD was playing when it was paused.")
(defun get-mail-count (mailbox &optional (inbox "inbox"))
"Check how many new messages there are in MAILBOX."
@ -86,15 +85,16 @@
*jabber-connected*)
(jabber-send-default-presence))))
(defun mpd-pause ()
(let (mpd-was-playing)
(defun mpd-pause ()
"Pause MPD playback."
(when (setf *mpd-was-playing-p* (mpd-playing-p))
(when (setf mpd-was-playing-p (mpd-playing-p))
(sb-ext:run-program "/usr/bin/mpc" '("pause") :wait nil)))
(defun mpd-play ()
(defun mpd-play ()
"Resume MPD playback."
(when *mpd-was-playing-p*
(sb-ext:run-program "/usr/bin/mpc" '("play") :wait nil)))
(when mpd-was-playing-p
(sb-ext:run-program "/usr/bin/mpc" '("play") :wait nil))))
(defcommand run-emacs () ()
"Open Emacs"
@ -134,30 +134,32 @@
(run-hook *screen-unlocked-hook*)))
(defcommand lock-screen () ()
"Lock the screen using i3lock. Run *lock-screen-hook* before locking
it and run *screen-unlocked-hook* after it has been unlocked."
"Lock the screen using i3lock.
Run `*lock-screen-hook*' before locking it and run
`*screen-unlocked-hook*' after it has been unlocked."
(run-hook *lock-screen-hook*)
(sb-ext:run-program
"/usr/bin/i3lock" '("-n" "-c" "000000") :wait nil
:status-hook #'run-stumpwm-hook-on-exit))
;; (set-bg-color (colour :dwhite))
;; (set-border-color (colour :lwhite))
;; (set-fg-color (colour :lblack))
;; (set-float-focus-color (colour :lblue))
;; (set-float-unfocus-color (colour :dwhite))
;; (set-focus-color (colour :lblue))
;; (set-font "-*-tamsyn-medium-r-normal-*-17-*-*-*-*-0-iso8859-1")
;; (set-unfocus-color (colour :dwhite))
;; (set-win-bg-color (colour :dblack))
(set-bg-color (colour :dwhite))
(set-border-color (colour :lwhite))
(set-fg-color (colour :gray5))
(set-float-focus-color (colour :lblue))
(set-float-unfocus-color (colour :dwhite))
(set-focus-color (colour :lblue))
(set-font "-*-tamsyn-medium-r-normal-*-17-*-*-*-*-0-iso8859-1")
(set-unfocus-color (colour :dwhite))
(set-win-bg-color (colour :gray1))
;; (setf *colors* (mapcar #'colour '(:lwhite :lred :lgreen :lyellow :lblue
;; :lmagenta :lcyan :lblack)))
(setf *input-window-gravity* :bottom-left)
(setf *colors* (mapcar #'colour '(:lwhite :lred :lgreen :lyellow :lblue
:lmagenta :lcyan :gray5)))
(setf *input-window-gravity* :center)
(setf *message-window-gravity* :top-right)
;; (setf *mode-line-background-color* (colour :dwhite))
;; (setf *mode-line-border-color* (colour :dwhite))
;; (setf *mode-line-foreground-color* (colour :lblack))
(setf *mode-line-background-color* (colour :blue3))
(setf *mode-line-border-color* (colour :blue3))
(setf *mode-line-foreground-color* (colour :gray5))
(setf *shell-program* (getenv "SHELL"))
(setf *transient-border-width* 1)
(setf *window-border-style* :thin)
@ -221,4 +223,5 @@ it and run *screen-unlocked-hook* after it has been unlocked."
(concatenate 'string (sb-ext:posix-getenv "HOME")
"/.stumpwm.d/desktop.lisp"))
; (swank:create-server)
(ql:quickload "swank")
(swank:create-server :dont-close t)