summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Isom <kyle@imap.cc>2018-04-05 17:29:29 -0700
committerKyle Isom <kyle@imap.cc>2018-04-05 17:29:29 -0700
commitb5d9e1dd47f57a12450b43eac9e81c730baaa6d1 (patch)
tree84d2667744f30924daeef1b0c6c35c26388ee576
parent4467b2357fdf3e61ac52cb30a89500b473c19ce5 (diff)
downloadhome-b5d9e1dd47f57a12450b43eac9e81c730baaa6d1.tar.gz
home-b5d9e1dd47f57a12450b43eac9e81c730baaa6d1.tar.bz2
home-b5d9e1dd47f57a12450b43eac9e81c730baaa6d1.zip
various updates from bragi
-rw-r--r--.bashrc61
-rw-r--r--.gitignore_global2
-rw-r--r--.profile6
-rw-r--r--.stumpwmrc218
4 files changed, 202 insertions, 85 deletions
diff --git a/.bashrc b/.bashrc
index 1777197..ccb6439 100644
--- a/.bashrc
+++ b/.bashrc
@@ -28,7 +28,7 @@ shopt -s checkwinsize
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
-#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
@@ -37,7 +37,7 @@ fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
- xterm-color) color_prompt=yes;;
+ xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
@@ -72,25 +72,14 @@ xterm*|rxvt*)
;;
esac
-# enable color support of ls and also add handy aliases
-if [ -x /usr/bin/dircolors ]; then
- test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
- alias ls='ls --color=auto'
- #alias dir='dir --color=auto'
- #alias vdir='vdir --color=auto'
-
- #alias grep='grep --color=auto'
- #alias fgrep='fgrep --color=auto'
- #alias egrep='egrep --color=auto'
-fi
-
-# colored GCC warnings and errors
-#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
-
# some more ls aliases
-#alias ll='ls -l'
-#alias la='ls -A'
-#alias l='ls -CF'
+alias ll='ls -alF'
+alias la='ls -A'
+alias l='ls -CF'
+
+# Add an "alert" alias for long running commands. Use like so:
+# sleep 10; alert
+alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
@@ -112,21 +101,27 @@ if ! shopt -oq posix; then
fi
fi
-export EDITOR="/usr/bin/mg"
+# added by Miniconda3 installer
+if [ -d "$HOME/miniconda3" ]
+then
+ export PATH="/home/kyle/miniconda3/bin:$PATH"
+fi
+export CXX=clang++-5.0
+export CC=clang-5.0
-# The next line updates PATH for the Google Cloud SDK.
-if [ -f '/home/kyle/.local/google-cloud-sdk/path.bash.inc' ]; then source '/home/kyle/.local/google-cloud-sdk/path.bash.inc'; fi
+if [ -d "$HOME/.cargo" ]
+then
+ source $HOME/.cargo/env
+fi
-# The next line enables shell command completion for gcloud.
-if [ -f '/home/kyle/.local/google-cloud-sdk/completion.bash.inc' ]; then source '/home/kyle/.local/google-cloud-sdk/completion.bash.inc'; fi
+keychain -q
+source $HOME/.keychain/$(hostname -s)-sh
-# set up kubectl completions
-alias kubecomplete='source <(kubectl completion bash)'
+alias kp='kpcli --kdb ~/Default.kdbx'
+alias prb='git pull --rebase'
+alias commit='git commit'
-export GOPATH=$HOME
-export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/cuda-8.0/bin:$PATH
+pcommit () {
+ git commit $@ && git push
+}
-# added by Anaconda3 4.4.0 installer
-export PATH="/home/kyle/anaconda3/bin:$PATH"
-export SBCL_HOME=/usr/lib/sbcl
-export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
diff --git a/.gitignore_global b/.gitignore_global
index 5a62b5a..93d91d9 100644
--- a/.gitignore_global
+++ b/.gitignore_global
@@ -1,3 +1,5 @@
*~
*#
.#*
+.*.sw?
+tags
diff --git a/.profile b/.profile
index c346e4f..545c0b0 100644
--- a/.profile
+++ b/.profile
@@ -16,9 +16,7 @@ if [ -n "$BASH_VERSION" ]; then
fi
fi
-# set PATH so it includes user's private bin if it exists
-if [ -d "$HOME/bin" ] ; then
- PATH="$HOME/bin:$PATH"
-fi
+# set PATH so it includes user's private bin directories
+PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
diff --git a/.stumpwmrc b/.stumpwmrc
index 3169502..95cdbaf 100644
--- a/.stumpwmrc
+++ b/.stumpwmrc
@@ -1,62 +1,184 @@
-(setf *frame-number-map* "1234567890")
- (run-commands
- "gnewbg G2"
- "gnewbg G3"
- "gnewbg G4"
- "gnewbg G5"
-)
-(loop for i from 0 to 5
- do
- (define-key *top-map*
- (kbd (format nil "M-~a" i))
- (format nil "gselect ~a" i)))
-
-;;; (let ((server-running nil))
-;;; (defcommand swank () ()
-;;; "Toggle the swank server on/off"
-;;; (if server-running
-;;; (progn
-;;; (swank:stop-server 4005)
-;;; (echo-string
-;;; (current-screen)
-;;; "Stopping swank.")
-;;; (setf server-running nil))
-;;; (progn
-;;; (swank:create-server :port 4005
-;;; :style swank:*communication-style*
-;;; :dont-close t)
-;;; (echo-string
-;;; (current-screen)
-;;; "Starting swank. M-x slime-connect RET RET, then (in-packqage stumpwm).")
-;;; (setf server-running t)))))
+;; -*-lisp-*-
+
+;; Load swank.
+;; *prefix-key* ; swank will kick this off
+(ql:quickload :swank)
+(ql:quickload :manifest)
+
+(defvar *manifest-url*
+ (manifest:start))
+
+(defparameter *default-browser* "google-chrome")
+
+(let ((server-running nil))
+ (defcommand swank () ()
+ "Toggle the swank server on/off"
+ (if server-running
+ (progn
+ (swank:stop-server 4005)
+ (echo-string
+ (current-screen)
+ "Stopping swank.")
+ (setf server-running nil))
+ (progn
+ (swank:create-server :port 4005
+ :style swank:*communication-style*
+ :dont-close t)
+ (echo-string
+ (current-screen)
+ "Starting swank. M-x slime-connect RET RET, then (in-packqage stumpwm).")
+ (setf server-running t)))))
(define-key *root-map* (kbd "C-s") "swank")
-(defparameter *xscreensaver* "/usr/bin/xscreensaver-command")
-(defcommand lock () ()
- "Lock the screen using xscreensaver."
- (stumpwm:echo-string (current-screen) "Locking screen...")
- (sb-ext:run-program *xscreensaver* '("-lock")))
+;; make frames 1-numbered (i.e. for getting with ALT-FN)
+(setf *frame-number-map* "1234567890")
+' (setf *window-number-map* "1234567890") ; This doesn't actually do anything
+
+(run-commands
+ "gnewbg Browse" ;; F2
+ "gnewbg IRC" ;; F3
+ "gnewbg Pidgin" ;; F4
+ "gnewbg G5" ;; F5
+ "gnewbg G6" ;; F6
+ "gnewbg G7" ;; F7
+ "gnewbg G8" ;; F8
+ "gnewbg G9" ;; F9
+ "gnewbg G10" ;; F10
+ "gnewbg G11" ;; F11
+ "gnewbg G12"
+ "gnewbg G13"
+ "gnewbg G14"
+ "gnewbg G15"
+ "gnewbg G16"
+ "gnewbg G17"
+ "gnewbg G18"
+ "gnewbg G19")
+
+
+;; Fluxbox-style Alt-F# virtual desktop (group in StumpWM-speak) switching. Modified from:
+;; http://hcl-club.lu/svn/development/lisp/.stumpwmrc
+(loop for i from 1 to 9
+ do
+ (progn
+ (format t "Key: ~A~%" i)
+ (define-key *top-map*
+ (kbd (format nil "M-~a" i))
+ (format nil "gselect ~a" i))))
+
+(define-key *top-map* (kbd "M-!") "gselect 10")
+(define-key *top-map* (kbd "M-@") "gselect 11")
+(define-key *top-map* (kbd "M-#") "gselect 12")
+(define-key *top-map* (kbd "M-$") "gselect 13")
+(define-key *top-map* (kbd "M-%") "gselect 14")
+(define-key *top-map* (kbd "M-^") "gselect 15")
+(define-key *top-map* (kbd "M-&") "gselect 16")
+(define-key *top-map* (kbd "M-*") "gselect 17")
+(define-key *top-map* (kbd "M-\(") "gselect 18")
+(define-key *top-map* (kbd "M-\)") "gselect 19")
+
+
+(defvar *scratchpad* nil)
+(defcommand scratch-pad () ()
+ "Create or destroy a new scratchpad group."
+ (if *scratchpad*
+ (progn
+ (gselect *scratchpad*)
+ (dolist (window (group-windows (current-group)))
+ (delete-window window))
+ (gkill)
+ (setf *scratchpad* nil)
+ (echo "nerfed scratchpad"))
+ (progn
+ (setf *scratchpad* (gnew "scratchpad"))
+ (echo "scratchpad created"))))
+
+(defvar *scratchpad-float* nil)
+(defcommand scratch-pad-float () ()
+ "Create or destroy a new floating scratchpad group."
+ (if *scratchpad-float*
+ (progn
+ (gselect *scratchpad-float*)
+ (dolist (window (group-windows (current-group)))
+ (delete-window window))
+ (gkill)
+ (setf *scratchpad-float* nil)
+ (echo "nerfed floating scratchpad"))
+ (progn
+ (setf *scratchpad-float* (gnew "scratchpad-float"))
+ (echo "floating scratchpad created"))))
-(defparameter *acpi-program* "/usr/bin/acpi")
-(defun get-acpi-status ()
- (with-output-to-string (stream)
- (sb-ext:run-program *acpi-program* nil :output stream)))
(defcommand acpi-status () ()
"Print ACPI status in the StumpWM message box."
- (stumpwm:echo-string (current-screen) (get-acpi-status)))
+ (stumpwm:echo-string (current-screen)
+ (with-output-to-string (stream)
+ (sb-ext:run-program
+ "/usr/bin/acpitool"
+ nil
+ :output stream))))
+
+(defcommand lock () ()
+ "Lock the screen by invoking xscreensaver."
+ (stumpwm:echo-string (current-screen) "Locking screen...")
+ (sb-ext:run-program "/usr/local/bin/xscreensaver-command"
+ '("-lock")))
+
+(defun exec-for-status (path &rest args)
+ "Run the path with args and return the status code."
+ (sb-ext:process-exit-code
+ (sb-ext:run-program path args :wait t)))
+
+(defun exec-ok (path &rest args)
+ "Returns true if path with args ran without error."
+ (zerop (exec-for-status path args)))
+
+(defun daemon-is-running (daemon)
+ (zerop (exec-for-status "/usr/bin/pgrep" daemon)))
+(defun start-daemon-if-not-running (path &rest args)
+ "If the program specified at path isn't running, start it."
+ (when (not (daemon-is-running (pathname-name path)))
+ (run-shell-command (if (null args)
+ path
+ (format nil "~A~{ ~A~}" path args)))))
+
+(defun start-program-if-not-running (program &rest args)
+ (format t "WOULD RUN: nohup ~A~{ ~A~}" program args)
+ (when (not (exec-ok "/usr/bin/pgrep" program))
+ (run-shell-command (format nil "nohup ~A~{ ~A~}"
+ program args))))
+
+(defun browse-manifest ()
+ (format nil "exec ~A ~A" *default-browser* *manifest-url*))
+(run-shell-command "ssh-add")
+(define-key stumpwm:*root-map* (kbd "B") "run-shell-command conkeror")
(define-key *root-map* (kbd "b") "acpi-status")
-(define-key *root-map* (kbd "c") "exec xfce4-terminal")
+(define-key *root-map* (kbd "RET") "exec xterm -e zsh -c fish")
(define-key *root-map* (kbd "d") "exec dmenu_run")
-(define-key *root-map* (kbd "e") "exec emacsclient -c -a ''")
+(define-key *root-map* (kbd "e") "exec emacsclient -c -a \"\"")
+(define-key *root-map* (kbd "E") "exec xterm -e emacsclient -c -nw -a \"\"")
(define-key *root-map* (kbd "l") "lock")
-(define-key *root-map* (kbd "C-i") "exec xfce4-terminal -x /home/kyle/bin/aipy")
-;;; for now, use the AIND conda env
-;; (define-key *root-map* (kbd "C-i") "exec xfce4-terminal -x tmux new-session /home/kyle/anaconda3/bin/ipython3")
+(define-key *root-map* (kbd "w") "exec xterm -e wicd-curses")
+(define-key *root-map* (kbd "C-r") "exec xterm -e racket")
+(define-key *root-map* (kbd "g") "exec xterm -e ghci")
+(define-key *root-map* (kbd "C-i") "exec xterm -e ipython")
+(define-key *root-map* (kbd "C-l") "exec SBCL_HOME=/usr/local/lib/sbcl xterm -e rlwrap sbcl --load /home/kyle/.sbcl-repl-util.lisp")
+(define-key *root-map* (kbd "C-d") (browse-manifest))
+(define-key *root-map* (kbd "`") "scratch-pad")
+(define-key *root-map* (kbd "~") "scratch-pad-float")
(define-key *root-map* (kbd "M") "exec xterm -e htop")
-(define-key *root-map* (kbd "P") "exec xfce4-terminal -x kpcli --kdb /home/kyle/Default.kdbx")
-(define-key *root-map* (kbd "RET") "exec xterm")
+(define-key *root-map* (kbd "C-v") "exec pavucontrol")
+
+;; set FFM
(setf *mouse-focus-policy* :sloppy)
+
+;; show input bar in centre of screen
(setf *input-window-gravity* :center)
+
+(sb-ext:run-program "/usr/bin/xsetroot"
+ '("-solid" "black")))
+(message "Ready.")
+
+;; add ssh keys
+;;LISP=sbcl