2015-08-25 18:17:51 +00:00
|
|
|
(require 'sawfish.wm.defaults)
|
2015-08-31 19:33:17 +00:00
|
|
|
(require 'sawfish.wm.ext.match-window)
|
2015-08-25 18:17:51 +00:00
|
|
|
|
|
|
|
;;; Programs to run on startup
|
|
|
|
(system "setxkbmap dvorak")
|
|
|
|
(system "setxkbmap -option compose:caps")
|
|
|
|
(system "lxpanel &")
|
2015-08-29 18:31:54 +00:00
|
|
|
; (system "xscreensaver &")
|
|
|
|
|
|
|
|
;; For VMs
|
|
|
|
; (system "xset s off")
|
|
|
|
; (system "xset -dpms")
|
2015-08-25 18:17:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
;;; Custom functions
|
|
|
|
|
|
|
|
(defun launch-app (app)
|
|
|
|
(case app
|
|
|
|
('chrome (system "google-chrome --disable-gpu-compositing &"))
|
2015-08-31 19:33:17 +00:00
|
|
|
('term-code (system "gnome-terminal --role code --geometry=120x34 &"))
|
|
|
|
('term-quick (system "gnome-terminal --role quick --geometry=80x24 &"))
|
2015-10-30 05:02:24 +00:00
|
|
|
('term-std (system "gnome-terminal --role terminal --geometry=100x28 &"))
|
|
|
|
('quassel (system "quasselclient &")) ))
|
2015-08-25 18:17:51 +00:00
|
|
|
|
|
|
|
; Note that the documentation for 'insert-workspace' is wrong, and we insert
|
|
|
|
; *after* the provided value, not before
|
|
|
|
(defun launch-app-in-new-workspace (app)
|
|
|
|
(progn
|
|
|
|
(select-workspace (insert-workspace (cdr (workspace-limits))))
|
|
|
|
(launch-app app) ))
|
|
|
|
|
|
|
|
(defun send-to-new-workspace ()
|
|
|
|
(progn
|
|
|
|
(set 'space current-workspace)
|
|
|
|
(set 'window (input-focus))
|
|
|
|
(move-window-to-workspace
|
|
|
|
window
|
|
|
|
space
|
|
|
|
(insert-workspace (cdr (workspace-limits)))
|
|
|
|
t )
|
|
|
|
(select-workspace (cdr (workspace-limits))) ))
|
|
|
|
|
|
|
|
(defun send-workspace-to-top ()
|
|
|
|
(move-workspace current-workspace (- (cdr (workspace-limits)) current-workspace)) )
|
|
|
|
|
|
|
|
(defun build-new-workspace ()
|
|
|
|
(progn
|
|
|
|
(launch-app-in-new-workspace 'chrome)
|
|
|
|
(launch-app 'term-code)))
|
|
|
|
|
|
|
|
(defun destroy-workspace ()
|
|
|
|
(progn
|
|
|
|
(mapcar
|
|
|
|
(lambda (win)
|
|
|
|
(if (not (equal "panel" win)) (destroy-window win)) )
|
|
|
|
(workspace-windows) )
|
|
|
|
(remove-workspace)
|
|
|
|
(previous-workspace 1) ))
|
|
|
|
|
|
|
|
|
|
|
|
;;; Keybinds
|
|
|
|
(define apps-keymap (make-keymap))
|
|
|
|
|
|
|
|
(bind-keys apps-keymap
|
|
|
|
"t" '(launch-app 'term-std)
|
|
|
|
"q" '(launch-app 'term-quick)
|
|
|
|
"o" '(launch-app 'term-code)
|
2015-10-30 05:02:24 +00:00
|
|
|
"c" '(launch-app 'chrome)
|
|
|
|
"i" '(launch-app 'quassel) )
|
2015-08-25 18:17:51 +00:00
|
|
|
|
|
|
|
(unbind-keys global-keymap
|
|
|
|
"W-Left"
|
|
|
|
"W-Right"
|
|
|
|
"M-Up"
|
2015-08-27 04:41:38 +00:00
|
|
|
"M-Down"
|
|
|
|
"C-Tab")
|
2015-08-25 18:17:51 +00:00
|
|
|
|
|
|
|
; Workspace bindings
|
|
|
|
(bind-keys global-keymap
|
|
|
|
"M-C-Delete" 'restart
|
|
|
|
"Super-Left" '(previous-workspace 1)
|
|
|
|
"Super-Right" '(next-workspace 1)
|
|
|
|
"Super-Up" '(select-workspace (cdr (workspace-limits))) ; top of stack
|
|
|
|
"Super-Down" '(select-workspace (car (workspace-limits))) ; bottom of stack
|
|
|
|
"Super-Next" 'move-workspace-forwards
|
|
|
|
"Super-Prior" 'move-workspace-backwards
|
|
|
|
"Super-Shift-Next" send-workspace-to-top
|
|
|
|
"Super-End" destroy-workspace
|
|
|
|
"M-F1" '(select-workspace 0)
|
|
|
|
"M-F2" '(select-workspace 1)
|
|
|
|
"M-F3" '(select-workspace 2)
|
|
|
|
"M-F4" '(select-workspace 3)
|
|
|
|
"M-F5" '(select-workspace 4)
|
|
|
|
"M-F6" '(select-workspace 5)
|
|
|
|
"M-F7" '(select-workspace 6)
|
|
|
|
"M-F8" '(select-workspace 7)
|
|
|
|
)
|
|
|
|
|
|
|
|
; Window-specific workspace bindings
|
|
|
|
(bind-keys window-keymap
|
|
|
|
"Super-Shift-Left" 'send-to-previous-workspace
|
|
|
|
"Super-Shift-Right" 'send-to-next-workspace
|
|
|
|
"Super-Shift-Up" send-to-new-workspace )
|
|
|
|
|
|
|
|
; General bindings
|
|
|
|
(bind-keys global-keymap
|
|
|
|
"M-TAB" 'cycle-windows
|
|
|
|
"M-Shift-TAB" 'cycle-windows-backward
|
|
|
|
"Super-l" '(system "xscreensaver-command -lock")
|
|
|
|
"Super-x" apps-keymap
|
|
|
|
"Super-n" build-new-workspace
|
|
|
|
)
|
|
|
|
|
|
|
|
; Given a list of paired letter-command items, returns a new list of paired
|
|
|
|
; letter-function items, where each anonymous function calls the passed
|
|
|
|
; function with the original string as its argument
|
|
|
|
; 'function' should be a function, 'map' should be a list of strings
|
|
|
|
;
|
|
|
|
; This is currently unused, because my needs changed, but it's an excellent idea.
|
|
|
|
(defun funcmap (function map)
|
|
|
|
(mapcar
|
|
|
|
(lambda (item)
|
|
|
|
(if (= (length item) 1)
|
|
|
|
item
|
|
|
|
(lambda () (function item)) ))
|
|
|
|
map) )
|
|
|
|
|
|
|
|
|
|
|
|
;;; Custom variables
|
|
|
|
(set 'lock-first-workspace nil)
|
|
|
|
|
|
|
|
;;; Hooks
|
|
|
|
(add-hook 'idle-hook delete-empty-workspaces)
|
|
|
|
|
2015-08-31 19:33:17 +00:00
|
|
|
;;; Window Matching
|
|
|
|
(add-window-matcher '((WM_WINDOW_ROLE . "^code|terminal$"))
|
|
|
|
'((position . south-east)) )
|
|
|
|
|
|
|
|
(add-window-matcher '((WM_WINDOW_ROLE . "^quick$"))
|
|
|
|
'((position . north-east)) )
|