Created
May 28, 2015 11:34
-
-
Save gabriel-laddel/37c35950cf18bd7ac933 to your computer and use it in GitHub Desktop.
lisp-customizations.lisp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package #:mm) | |
(sb-ext:restrict-compiler-policy 'debug 3) | |
(setq mm::*system-information* nil) | |
;;; interface to the SynPS/2 Synaptics TouchPad | |
;;; ============================================================================ | |
(defun touchpad-id () | |
(let* ((a (->> (run-program "xinput --list" :output :string) | |
(string-downcase) | |
(split "\n" ) | |
(some (lambda (s) (when (scan "touchpad" s) s))))) | |
(b (all-matches "\\d\\d" a))) | |
(read-from-string (apply (curry #'subseq a) b)))) | |
(defun touchpad-on? () | |
(= 1 (->> (run-program (format nil "xinput list-props ~A | grep \"Device Enabled\"" (touchpad-id)) :output :string) | |
(split "\\t") | |
(llast) | |
(read-from-string)))) | |
(defun touchpad-off () | |
(run-program (format nil "xinput set-prop ~d \"Device Enabled\" 0" (touchpad-id)))) | |
(defun touchpad-on () | |
(run-program (format nil "xinput set-prop ~d \"Device Enabled\" 1" (touchpad-id)))) | |
(defun toggle-touchpad () | |
(if (touchpad-on?) (progn (touchpad-off) (stumpwm::banish)) | |
(touchpad-on))) | |
(in-package #:stumpwm) | |
(defcommand toggle-touchpad () () | |
"toggles a synaptics touchpad" | |
(mm::toggle-touchpad)) | |
(define-key *root-map* (kbd "C-f") "toggle-touchpad") | |
(in-package #:drei-commands) | |
(set-key `(com-backward-kill-word ,*numeric-argument-marker*) | |
'deletion-table | |
'((#\Backspace :control))) | |
(in-package #:mm) | |
(setq mm::*system-information* nil) | |
(defun populate-agenda-items () | |
(setf *agenda* (l (make-agenda-item "Review Norm's paper on Riemann's curvature tensor") | |
(make-agenda-item "DO BACKUPS") | |
(make-agenda-item "finish off RPC") | |
(make-agenda-item "skullz") | |
(make-agenda-item "Historical MPEX data") | |
(make-agenda-item "history of earth") | |
(make-agenda-item "Get Masamune on all of the common lisp websites with tutorials")))) | |
;; (let* ((mjrcalc-path (qlpp "/lispy/"))) | |
;; (load (merge-pathnames mjrcalc-path "lib-meta.lisp")) | |
;; (mjr_meta::mjr_meta_load-packages :BASE-PATH (namestring mjrcalcpath)) | |
;; (mjr_meta::mjr_meta_use-packages :BASE-PATH (namestring mjrcalc-path))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment