-*-LISp-*- ;; ;; Stumpwm user definitions ;; DIVIDED! (in-package :stumpwm) (set-contrib-dir "/usr/share/stumpwm") (load "/usr/share/stumpwm/amixer.lisp") ;; in contrib (load "/usr/share/stumpwm/notifications.lisp") ;; in contrib (load "/home/simon/stumpwm/mode-line.lisp") (load "/home/simon/stumpwm/mina.mods.lisp") (load "/home/simon/stumpwm/keypress.lisp") ;;(load "/home/simon/stumpwm/swank.el") (require 'swank) (swank:create-server) ;;(load-module "mpd") ;; (load-module "wifi") (defun cat (&rest strings) (apply 'concatenate 'string strings)) ;; use xlsfonts ;;(set-font "-*-montecarlo-medium-*-*-*-11-*-*-*-*-*-*-*") ;;(set-font "-*-proggysquare-medium-*-*-*-11-*-*-*-*-*-*-*") ;;(set-font "-*-mintsstrong-medium-*-*-*-*-*-*-*-*-*-*-*") ;;(set-font "-*-terminusmodx.icons-*-*-*-11-*-*-*-*-*-*-*-*") ;;(set-font "-*-anorexia-medium-*-*-*-*-*-*-*-*-*-*-*") ;;(set-font "-*-proggyclean-medium-*-normal-*-11-*-*-*-*-*-*-*") (set-font "-*-ohsnap.icons-medium-*-*-*-11-*-*-*-*-*-*-*") ;;(set-font "-*-envypn-medium-*-*-*-*-*-*-*-*-*-*-*") (set-prefix-key (kbd "C-i")) (defun show-key-seq (key seq val) (message (print-key-seq (reverse seq)))) (add-hook *key-press-hook* 'show-key-seq) ;; startup stuff (setf *startup-message* "DIN MAMMA!" *mouse-focus-policy* :sloppy ;; I like it sloppy *message-window-gravity* :bottom-right *input-window-gravity* :bottom-left *frame-number-map* "123qwe" *window-number-map* "123qwe") (setf *normal-border-width* 1 *maxsize-border-width* 1 *transient-border-width* 1 *window-border-style* :tight) (defun update-mode-line () "Update the mode-line sooner than usual." (let ((screen (current-screen))) (when (screen-mode-line screen) (redraw-mode-line-for (screen-mode-line screen) screen)))) ;; on/off stuff (if (not (head-mode-line (current-head))) (toggle-mode-line (current-screen) (current-head))) (defvar group-names "123qwe") (dotimes (i 6) (define-key *top-map* (kbd (format nil "s-~a" (char group-names i))) (format nil "gselect ~a" (1+ i))) (define-key *top-map* (kbd (format nil "s-C-~a" (char group-names i))) (format nil "gmove ~a" (1+ i)))) (defmacro make-groups (&rest names) (let ((ns (mapcar #'(lambda (n) (cat "gnew " n)) names))) `(run-commands ,@ns))) (make-groups "c0d3" "IRC" "w4r3z" "ELIT" "web-jumpz") (run-commands "gselect 1" "grename First") ;; define commands (defcommand iceweasel () () "Run or switch to firefox." (run-or-raise "iceweasel" '(:class "Iceweasel"))) (defcommand conkeror () () "Run or switch to conkeror." (run-or-raise "conkeror" '(:class "Conkeror"))) (defcommand reinit () () (run-commands "reload" "loadrc")) ;; does not work. ;;(defcommand startswank () () ;; (swank:create-server)) (defcommand urxvtdaemon () () (run-shell-command "urxvtd")) ;; king (defcommand urxvtkiller () () (run-shell-command "killall -9 urxvtd")) ;; king (defcommand urxvtdrestart () () (run-commands "urxvtkiller" "urxvtdaemon")) (defcommand dmenu () () (run-shell-command "dmenu_run -p 'inputz ' -nb black -nf '#506070' -fn '-*-ohsnap.icons-medium-*-*-*-11-*-*-*-*-*-*-*' -sf '#8cd0d3' -sb black -l 5 -b")) (defcommand amix () () (run-shell-command "sh /home/simon/bin/amix")) (defcommand amixplus () () (run-commands "amix" "amixer-master-1+")) (defcommand amixminus () () (run-commands "amix" "amixer-master-1-")) ;; define keys (defmacro defkey-top (key cmd) `(define-key *top-map* (kbd ,key) ,cmd)) (defmacro defkeys-top (&rest keys) (let ((ks (mapcar #'(lambda (k) (cons 'defkey-top k)) keys))) `(progn ,@ks))) (defmacro defkey-root (key cmd) `(define-key *root-map* (kbd ,key) ,cmd)) (defmacro defkeys-root (&rest keys) (let ((ks (mapcar #'(lambda (k) (cons 'defkey-root k)) keys))) `(progn ,@ks))) (defkeys-top ("s-0" "startswank") ;; does not work. ("s-RET" "exec urxvtc") ("s-p" "exec urxvtc -e tmux attach") ("s-v" "vsplit") ("s-h" "hsplit") ("s-r" "remove-split") ("s-R" "reinit") ("s-a" "windowlist") ("s-b" "mode-line") ("s-SPC" "next") ("s-m" "prev") ("s-d" "dmenu") ("s-X" "exec killall xfce4-panel") ("M-Print" "quit") ("s-k" "delete-window") ("s-S" "loadrc /home/simon/stumpwm/swank.el") ("s-Right" "move-focus right") ("s-Left" "move-focus left" ) ("s-Up" "move-focus up" ) ("s-Down" "move-focus down" ) ("s-C-Right" "move-window right") ("s-C-Left" "move-window left" ) ("s-C-Up" "move-window up" ) ("s-C-Down" "move-window down" ) ("s-S-Right" "gnext") ("s-S-Left" "gprev") ("s-ESC" "colon") ("s-S-Up" "prev-in-frame") ("s-9" "amixplus") ("s-8" "amixminus") ("s-S-Down" "next-in-frame") ("s-i" "iresize")) (defkeys-root ("C-u" "urxvtdrestart") ("C-t" "exec xterm") ("C-x" "exec xfce4-panel") ("f" "iceweasel") ("Q" "quit") ("v" "vsplit") ("r" "remove-split") ("h" "hsplit") ("k" "kill-window") ("c" "exec luakit") ) ;; defektz (define-key *top-map* (kbd "C-z") "gnext") (define-key *top-map* (kbd "C-<") "gprev") (define-key *top-map* (kbd "s-.") "echo-date") (define-key *top-map* (kbd "M-RET") "colon") (define-key *top-map* (kbd "s--") "fclear") (define-key *root-map* (kbd "N") '*notifications-map*) (fill-keymap *notifications-map* (define-key (kbd "a") "notifications-add") (define-key (kbd "r") "notifications-reset") (define-key (kbd "d") "notifications-delete-first") (define-key (kbd "D") "notifications-delete-last") (define-key (kbd "s") "notifications-show")) ;; defektz (setf *window-format* "%m%10c") (run-commands "gnewbg pr0n" "gnewbg media") ;; defektz-spezial (setf *mode-line-click-hook* (list #'(lambda (mode-line button x y) (declare (ignore mode-line x y)) (cond ((eq button 3) (run-commands "next" "remove-split")) ((eq button 2) (run-commands "gnext")) ((eq button 1) (run-commands "prev" "remove-split")))))) (setf *group-format* "%t")