git.fiddlerwoaroof.com
Browse code

Updates

fiddlerwoaroof authored on 09/05/2016 16:49:00
Showing 16 changed files
... ...
@@ -6,11 +6,11 @@ if has('vim_starting')
6 6
   set nocompatible               " Be iMproved
7 7
 
8 8
   " Required:
9
-  set runtimepath+=$HOME/.nvim/bundle/neobundle.vim/
9
+  set runtimepath+=$HOME/.config/nvim/bundle/neobundle.vim/
10 10
 endif
11 11
 
12 12
 " Required:
13
-call neobundle#begin(expand("$HOME/.nvim/bundle"))
13
+call neobundle#begin(expand("$HOME/.config/nvim/bundle"))
14 14
 
15 15
 " Let NeoBundle manage NeoBundle
16 16
 " Required:
17 17
new file mode 100644
... ...
@@ -0,0 +1,114 @@
1
+(in-package :stumpwm)
2
+
3
+(eval-when (:load-toplevel :compile-toplevel :execute)
4
+  (load "~/quicklisp/setup.lisp")
5
+  (ql:quickload :swank))
6
+
7
+(defcommand start-swank () ()
8
+  (swank:start-server :port 4587 :dont-close t))
9
+
10
+
11
+(set-prefix-key (kbd "s-space"))
12
+
13
+(defparameter *browser-command* "/usr/bin/google-chrome-beta")
14
+
15
+(defun cat (&rest strings)
16
+  (apply 'concatenate 'string strings))
17
+
18
+(defgeneric get-search-url (provider &rest strings)
19
+  (:method-combination append :most-specific-last)
20
+  (:method :around (provider &rest r)
21
+   (declare (ignore r))
22
+   (apply #'concatenate 'string (call-next-method)))
23
+
24
+  (:method append (provider &rest r)
25
+   (declare (ignore r))
26
+   (list "https://duckduckgo.com/?q="))
27
+  (:method append ((provider (eql nil)) &rest strings)
28
+   (list* (car strings) (loop for string in (cdr strings) nconcing (list "+" string))))
29
+
30
+  (:method append ((provider (eql :google)) &rest strings)
31
+   (list* "%21google" (loop for string in strings nconcing (list "+" string)))))
32
+
33
+(defmacro add-provider (name ddg-shortcut)
34
+  `(defmethod get-search-url append ((provider (eql ,name)) &rest strings)
35
+     (list* (concatenate 'string "%21" ,ddg-shortcut)
36
+            (loop for string in strings nconcing (list "+" string)))))
37
+
38
+(defmacro add-providers (&body definitions)
39
+  `(progn
40
+     ,@(loop for (name shortcut) in definitions
41
+             collect `(add-provider ,name ,shortcut))))
42
+
43
+
44
+(add-providers
45
+  (:amazon "a")
46
+  (:php "php")
47
+  (:python "python")
48
+  (:stack-overflow "sof")
49
+  (:lisp "lisp")
50
+  (:wikipedia "w"))
51
+
52
+(defcommand google (provider search-string) ((:string "Search Provider? ") (:string "Search Google for: "))
53
+  "Search google for a given string"
54
+  (check-type search-string (or null string))
55
+  (when search-string)
56
+  (run-shell-command (cat *browser-command* " "
57
+                          (get-search-url :google (substitute #\+ #\space search-string)))))
58
+
59
+
60
+(defcommand do-search (provider search-string) ((:string "Provider: ") (:string "Search for: "))
61
+  "Run a search against a specified provider"
62
+  (check-type provider (or null string))
63
+  (check-type search-string (or null string))
64
+  (when (and provider search-string)
65
+    (let ((provider (intern (string-upcase provider) :keyword)))
66
+      (run-shell-command (cat *browser-command* " "
67
+                              (get-search-url provider (substitute #\+ #\space search-string)))))))
68
+
69
+(defcommand google (search-string) ((:string "Search Google for: "))
70
+  "Search google for a given string"
71
+  (check-type search-string (or null string))
72
+  (when search-string
73
+    (run-shell-command (cat *browser-command* " "
74
+                            (get-search-url :google (substitute #\+ #\space search-string))))))
75
+
76
+(defcommand duckduckgo (search-string) ((:string "Search DDG for: "))
77
+  "Search duckduckgo gor a given string"
78
+  (check-type search-string (or null string))
79
+  (when search-string
80
+    (run-shell-command (cat *browser-command* " "
81
+                            (get-search-url nil (substitute #\+ #\space search-string))))))
82
+
83
+(defcommand search-for-selection (provider) ((:string "Search Provider?"))
84
+  "Search for the x selection with provider"
85
+  (do-search provider (get-x-selection)))
86
+
87
+(defparameter *selection-search-map* nil "selection search map")
88
+(fill-keymap *selection-search-map*
89
+             (kbd "g") "search-for-search google"
90
+             (kbd "/") "search-for-search google"
91
+             (kbd "s-/") "search-for-search google" 
92
+             (kbd "l") "search-for-selection lisp")
93
+
94
+(defparameter *search-map* nil "search map")
95
+(fill-keymap *search-map*
96
+             (kbd "a") "do-search amazon"
97
+             (kbd "h") "do-search php"
98
+             (kbd "p") "do-search python"
99
+             (kbd "o") "do-search stack-overflow"
100
+             (kbd "y") "do-search youtube"
101
+             (kbd "l") "do-search lisp"
102
+             (kbd "w") "do-search wikipedia"
103
+             (kbd "d") "do-search duckduckgo"
104
+             (kbd "g") "do-search google"
105
+             (kbd "s") *selection-search-map*
106
+             (kbd "/") "do-search google"
107
+             (kbd "Return") "search-for-selection google"
108
+             (kbd "s-/") "do-search google")
109
+
110
+(define-key *top-map* (kbd "s-/") *search-map*)
111
+(define-key *top-map* (kbd "s-TAB") "fnext")
112
+(define-key *top-map* (kbd "s-ISO_Left_Tab") "fother")
113
+
114
+; vim: set ft=lisp:
... ...
@@ -27,7 +27,7 @@ set -g message-fg colour16
27 27
 set -g message-bg colour221
28 28
 set -g message-attr bold
29 29
 set -g status-left '#[fg=colour235,bg=colour252,bold]  #S #[fg=colour252,bg=colour238,nobold]#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]'
30
-set -g window-status-format "#[fg=white,bg=colour234] #I #W"
30
+set -g window-status-format "#[fg=white,bg=colour234]#I #W"
31 31
 set -g window-status-current-format "#[fg=colour234,bg=colour39] #[fg=colour25,bg=colour39,noreverse,bold] #I  #W #[fg=colour39,bg=colour234,nobold]"
32 32
 
33 33
 set -sg escape-time 0
... ...
@@ -4,14 +4,13 @@ let g:sql_type_default = 'pgsql'
4 4
 let g:airline_theme="murmur"
5 5
 let g:haddock_browser_callformat = "%s %s"
6 6
 let g:haddock_browser = "open"
7
-let g:lisp_rainbow=1 
8
-let g:pandoc_no_empty_implicits=1
9
-let g:pandoc_use_hard_wraps = 1
10
-let g:pandoc#modules#enabled =  ["formatting", "folding", "completion", "metadata","menu"]
11
-let g:pandoc#modules#disabled =  ["command", "bibliographies"]
12
-let g:pandoc_formatting_settings = "h"
13
-let g:pandoc#filetypes#handled = ["markdown", "rst", "textile"]
14
-let g:slimv_disable_clojure=1
7
+let g:lisp_rainbow=1
8
+"let g:pandoc_no_empty_implicits=1
9
+"let g:pandoc_use_hard_wraps = 1
10
+"let g:pandoc#modules#enabled =  ["formatting", "folding", "completion", "metadata","menu"]
11
+"let g:pandoc#modules#disabled =  ["command", "bibliographies"]
12
+"let g:pandoc_formatting_settings = "h"
13
+"let g:pandoc#filetypes#handled = ["markdown", "rst", "textile"]
15 14
 let g:snips_author="Edward Langley"
16 15
 let g:solarized_termtrans=1
17 16
 let g:syntastic_python_checkers = ['python']
... ...
@@ -53,64 +52,72 @@ NeoBundleFetch 'Shougo/neobundle.vim'
53 52
 
54 53
 
55 54
 
56
-NeoBundle 'altercation/vim-colors-solarized'
57
-NeoBundle 'bitc/vim-hdevtools'
58
-NeoBundle 'Blackrush/vim-gocode'
59
-NeoBundle 'bling/vim-airline'
60
-NeoBundle 'burnettk/vim-angular'
61
-NeoBundle 'christoomey/vim-tmux-navigator'
62
-NeoBundle 'curist/vim-angular-template'
63
-NeoBundle 'eagletmt/ghcmod-vim'
64
-NeoBundle 'eagletmt/neco-ghc'
65
-NeoBundle 'edsono/vim-matchit'
66
-"NeoBundle 'enomsg/vim-haskellConcealPlus'
67
-NeoBundle 'exu/pgsql.vim'
68
-NeoBundle 'fiddlerwoaroof/htmljinja'
69
-NeoBundle 'fiddlerwoaroof/vim-jinja'
70
-NeoBundle 'godlygeek/tabular'
71
-NeoBundle 'groenewege/vim-less'
72
-NeoBundle 'guns/vim-clojure-static'
73
-NeoBundle 'ivanov/vim-ipython'
74
-NeoBundle 'jmcantrell/vim-virtualenv'
75
-NeoBundle 'kien/rainbow_parentheses.vim'
76
-NeoBundle 'kovisoft/slimv'
77
-NeoBundle 'lukerandall/haskellmode-vim'
78
-"NeoBundle 'm2mdas/phpcomplete-extended'
79
-NeoBundle 'markcornick/vim-vagrant'
80
-NeoBundle 'matthewsimo/angular-vim-snippets'
81
-NeoBundle 'mattn/emmet-vim.git'
82
-NeoBundle 'msanders/snipmate.vim'
83
-NeoBundle 'othree/javascript-libraries-syntax.vim'
84
-NeoBundle 'pangloss/vim-javascript'
85
-NeoBundle 'raichoo/haskell-vim'
86
-"NeoBundle 'rking/ag.vim' "Ag search utility
87
-NeoBundle 'rust-lang/rust.vim'
88
-NeoBundle 'scrooloose/nerdcommenter'
89
-NeoBundle 'scrooloose/nerdtree'
90
-NeoBundle 'scrooloose/syntastic'
91
-NeoBundle 'Shougo/unite-outline'
92
-NeoBundle 'Shougo/unite.vim'
93
-NeoBundle 'Shougo/vimfiler.vim'
94
-NeoBundle 'Shougo/vimproc'
95
-NeoBundle 'Shougo/vimshell.vim'
96
-NeoBundle 'sjl/gundo.vim'
97
-NeoBundle 'sjl/vitality.vim'
98
-NeoBundle 'sophacles/vim-bundle-mako'
99
-NeoBundle 'terryma/vim-multiple-cursors'
100
-NeoBundle 'tpope/vim-fireplace'
101
-NeoBundle 'tpope/vim-fugitive'
102
-NeoBundle 'tpope/vim-repeat'
103
-NeoBundle 'tpope/vim-surround'
104
-NeoBundle 'Twinside/vim-haskellFold'
105
-NeoBundle 'Twinside/vim-hoogle'
106
-"NeoBundle 'Valloric/YouCompleteMe'
107
-NeoBundle 'vim-pandoc/vim-pandoc'
108
-NeoBundle 'vim-scripts/dbext.vim'
109
-NeoBundle 'vim-scripts/php.vim--Garvin'
110
-NeoBundle 'vim-scripts/pydoc.vim'
111
-NeoBundle 'vim-scripts/VimClojure'
112
-NeoBundle 'vim-voom/VOoM'
113
-NeoBundle 'ytsunetsune/unite-outline-euslisp'
55
+ NeoBundle 'mustache/vim-mustache-handlebars'
56
+ NeoBundle 'davidoc/taskpaper.vim'
57
+ NeoBundle 'altercation/vim-colors-solarized'
58
+ NeoBundle 'bitc/vim-hdevtools'
59
+ NeoBundle 'Blackrush/vim-gocode'
60
+ NeoBundle 'bling/vim-airline'
61
+ NeoBundle 'bling/vim-airline-themes'
62
+ NeoBundle 'burnettk/vim-angular'
63
+ NeoBundle 'christoomey/vim-tmux-navigator'
64
+ NeoBundle 'curist/vim-angular-template'
65
+ NeoBundle 'eagletmt/ghcmod-vim'
66
+ NeoBundle 'eagletmt/neco-ghc'
67
+ NeoBundle 'edsono/vim-matchit'
68
+ "NeoBundle 'enomsg/vim-haskellConcealPlus'
69
+ NeoBundle 'exu/pgsql.vim'
70
+ NeoBundle 'fiddlerwoaroof/htmljinja'
71
+ NeoBundle 'fiddlerwoaroof/vim-jinja'
72
+ NeoBundle 'godlygeek/tabular'
73
+ NeoBundle 'groenewege/vim-less'
74
+ NeoBundle 'guns/vim-clojure-static'
75
+ NeoBundle 'ivanov/vim-ipython'
76
+ NeoBundle 'jmcantrell/vim-virtualenv'
77
+ NeoBundle 'kien/rainbow_parentheses.vim'
78
+ NeoBundle 'kovisoft/slimv'
79
+ NeoBundle 'lukerandall/haskellmode-vim'
80
+ "NeoBundle 'm2mdas/phpcomplete-extended'
81
+ NeoBundle 'markcornick/vim-vagrant'
82
+ NeoBundle 'matthewsimo/angular-vim-snippets'
83
+ NeoBundle 'mattn/emmet-vim.git'
84
+ NeoBundle 'msanders/snipmate.vim'
85
+ NeoBundle 'othree/javascript-libraries-syntax.vim'
86
+ NeoBundle 'pangloss/vim-javascript'
87
+ NeoBundle 'raichoo/haskell-vim'
88
+ "NeoBundle 'rking/ag.vim' "Ag search utility
89
+ NeoBundle 'rust-lang/rust.vim'
90
+ NeoBundle 'scrooloose/nerdcommenter'
91
+ NeoBundle 'scrooloose/nerdtree'
92
+ NeoBundle 'scrooloose/syntastic'
93
+ NeoBundle 'Shougo/unite.vim'
94
+ NeoBundle 'Shougo/unite-outline'
95
+ NeoBundle 'tsukkee/unite-tag'
96
+ NeoBundle 'Shougo/vimfiler.vim'
97
+ NeoBundle 'Shougo/vimproc'
98
+ NeoBundle 'Shougo/vimshell.vim'
99
+ NeoBundle 'sjl/gundo.vim'
100
+ NeoBundle 'sjl/vitality.vim'
101
+ NeoBundle 'sophacles/vim-bundle-mako'
102
+ NeoBundle 'terryma/vim-multiple-cursors'
103
+ NeoBundle 'tpope/vim-fireplace'
104
+ NeoBundle 'tpope/vim-fugitive'
105
+ NeoBundle 'tpope/vim-repeat'
106
+ NeoBundle 'tpope/vim-surround'
107
+ NeoBundle 'Twinside/vim-haskellFold'
108
+ NeoBundle 'Twinside/vim-hoogle'
109
+ "NeoBundle 'Valloric/YouCompleteMe'
110
+ "NeoBundle 'vim-pandoc/vim-pandoc'
111
+ NeoBundle 'vim-scripts/dbext.vim'
112
+ NeoBundle 'vim-scripts/php.vim--Garvin'
113
+ NeoBundle 'vim-scripts/pydoc.vim'
114
+ NeoBundle 'vim-scripts/VimClojure'
115
+ NeoBundle 'vim-voom/VOoM'
116
+ NeoBundle 'ytsunetsune/unite-outline-euslisp'
117
+ NeoBundle 'xolox/vim-misc'
118
+ NeoBundle 'xolox/vim-easytags'
119
+ NeoBundle 'majutsushi/tagbar'
120
+
114 121
 
115 122
 " Required:
116 123
 call neobundle#end()
... ...
@@ -124,28 +131,28 @@ NeoBundleCheck
124 131
 "End NeoBundle Scripts-------------------------
125 132
 
126 133
 let counter = 0
127
-let g:syntastic_auto_loc_list=1
128
-let g:sql_type_default = 'pgsql'
129 134
 let g:airline_theme="murmur"
130 135
 let g:haddock_browser_callformat = "%s %s"
131 136
 let g:haddock_browser = "open"
132
-let g:lisp_rainbow=1 
133
-let g:pandoc_no_empty_implicits=1
134
-let g:pandoc_use_hard_wraps = 1
135
-let g:pandoc#modules#enabled =  ["formatting", "folding", "completion", "metadata","menu"]
136
-let g:pandoc#modules#disabled =  ["command", "bibliographies"]
137
-let g:pandoc_formatting_settings = "h"
138
-let g:pandoc#filetypes#handled = ["markdown", "rst", "textile"]
137
+let g:lisp_rainbow=1
138
+"let g:pandoc#filetypes#handled = ["markdown", "rst", "textile"]
139
+"let g:pandoc_formatting_settings = "h"
140
+"let g:pandoc#modules#disabled =  ["command", "bibliographies"]
141
+"let g:pandoc#modules#enabled =  ["formatting", "folding", "completion", "metadata","menu"]
142
+"let g:pandoc_no_empty_implicits=1
143
+"let g:pandoc_use_hard_wraps = 1
139 144
 let g:slimv_disable_clojure=1
145
+let g:slimv_repl_split=3
146
+let g:slimv_browser_command_suffix='2>&1 > /dev/null'
140 147
 let g:snips_author="Edward Langley"
141 148
 let g:solarized_termtrans=1
149
+let g:sql_type_default = 'pgsql'
150
+let g:syntastic_auto_loc_list=1
142 151
 let g:syntastic_python_checkers = ['python']
143 152
 let g:Tex_CompileRule_pdf = 'xelatex -interaction=nonstopmode $*'
144 153
 let g:tex_flavor='xelatex'
145 154
 let g:unite_force_overwrite_statusline = 0
146 155
 let g:vimclojure#HighlightBuiltins = 1
147
-let g:vimclojure#HighlightBuiltins = 1
148
-let g:vimclojure#ParenRainbow = 1
149 156
 let g:vimclojure#ParenRainbow = 1
150 157
 let g:virtualenv_directory = "$HOME/python_envs"
151 158
 let maplocalleader=','
... ...
@@ -232,7 +239,7 @@ if &term =~ "xterm\\|rxvt"
232 239
 endif
233 240
 
234 241
 "SmartIndent for Python
235
-"autocmd BufEnter *.hs compiler ghc
242
+autocmd BufEnter *.hs compiler ghc
236 243
 au FocusLost * :wa
237 244
 
238 245
 function Checkft()
... ...
@@ -247,18 +254,18 @@ endfunction
247 254
 autocmd! BufNewFile * silent! 0r ~/.vim/skel/tmpl.%:e
248 255
 autocmd BufRead,BufNewFile *.twig set filetype=htmljinja
249 256
 autocmd BufRead,BufNewFile *.mako set ft=mako
250
-autocmd BufRead,BufNewFile *.md set dictionary+=/usr/share/dict/words
257
+autocmd BufRead,BufNewFile *.md set dictionary+=/usr/share/dict/words ft=markdown
251 258
 autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
252 259
 autocmd BufRead,BufNewFile *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
253 260
 autocmd BufRead,BufNewFile *.tac set ft=python
254 261
 autocmd bufwritepost * call Checkft()
255 262
 autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
256 263
 
257
-autocmd FileType haskell set omnifunc=necoghc#omnifunc
264
+"autocmd FileType haskell set omnifunc=necoghc#omnifunc
258 265
 autocmd FileType lisp set omnifunc=SlimvOmniComplete
259
-autocmd FileType markdown set linebreak tw=110 noexpandtab nosmartindent autoindent
260
-autocmd FileType pandoc set linebreak tw=110 noexpandtab nosmartindent autoindent
261
-autocmd FileType pantondoc set linebreak tw=110 noexpandtab nosmartindent autoindent
266
+autocmd FileType markdown set linebreak tw=110 noexpandtab nosmartindent autoindent spelllang=en spell
267
+"autocmd FileType pandoc set linebreak tw=110 noexpandtab nosmartindent autoindent
268
+"autocmd FileType pantondoc set linebreak tw=110 noexpandtab nosmartindent autoindent
262 269
 autocmd FileType python set complete+=k~/.vim/syntax/python.vim "isk+=.,(
263 270
 "Diable the anti-python smart indent of #
264 271
 inoremap  # X#
... ...
@@ -342,18 +349,18 @@ function! s:unite_my_settings()
342 349
 
343 350
   " exit with esc
344 351
   nmap <buffer> <ESC> <Plug>(unite_exit)
345
- 
352
+
346 353
   " exit with ctrl-c
347 354
   imap <buffer> <c-c> <Plug>(unite_exit)
348 355
   nmap <buffer> <c-c> <Plug>(unite_exit)
349 356
 endfunction
350 357
 
351 358
 if executable('ag')
352
-  let g:unite_source_file_async_command =
353
-            \ 'ag --follow --nocolor --nogroup --hidden -g "" --ignore ''.sass-cache'''
359
+  let g:unite_source_file_async_command = 'ag --follow --nocolor --nogroup --hidden -g "" --ignore ''.sass-cache'''
354 360
   "https://github.com/ggreer/the_silver_searcher
355 361
   "Use ag in unite grep source.
356 362
   let g:unite_source_rec_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '--hidden', '-g', '', '--ignore', '.git', '--ignore', '.sass-cache']
363
+  let g:unite_source_rec_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '--hidden', '-g', '', '--ignore', '.git', '--ignore', '.sass-cache']
357 364
   "let g:unite_source_grep_command = 'ag'
358 365
   "let g:unite_source_grep_default_opts =
359 366
   "      \ '--line-numbers --nocolor --nogroup --hidden --ignore ' .
... ...
@@ -386,6 +393,8 @@ nmap [unite]k :<C-u>Unite tab:no-current<C-m>
386 393
 nmap [unite]t :NERDTreeToggle<CR>
387 394
 nmap [unite]u :GundoToggle<CR>
388 395
 nmap [unite]r :!vagrant rsync<CR>
396
+nmap [unite]h :set hlsearch!<CR>
397
+nmap [unite]l :set list!<CR>
389 398
 
390 399
 " Reload
391 400
 map <silent> tu :call GHC_BrowseAll()<CR>
... ...
@@ -393,4 +402,4 @@ map <silent> tu :call GHC_BrowseAll()<CR>
393 402
 map <silent> tw :call GHC_ShowType(1)<CR>
394 403
 autocmd BufRead,BufNewFile *.css,*.scss,*.less setlocal foldmethod=marker foldmarker={,}
395 404
 
396
-
405
+command -nargs=+ Gadd Git add <q-args>
... ...
@@ -1,7 +1,7 @@
1 1
 Config { font = "xft:Source Code Pro:size=8:antialias=true"
2 2
        , bgColor = "black"
3 3
        , fgColor = "grey"
4
-       , position = TopW L 90
4
+       , position = TopW L 100
5 5
        , commands = [ Run Weather "EGPF" ["-t"," <tempF>F","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000
6 6
                     , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
7 7
                     , Run Memory ["-t","Mem: <usedratio>%"] 10
... ...
@@ -15,6 +15,7 @@ import XMonad.Actions.CopyWindow(copy,copyWindow,kill1,killAllOtherCopies)
15 15
 import XMonad.Actions.CycleWindows()
16 16
 import XMonad.Actions.DynamicWorkspaces
17 17
 import XMonad.Actions.GridSelect
18
+import XMonad.Actions.PhysicalScreens
18 19
 import XMonad.Actions.SpawnOn
19 20
 import XMonad.Core()
20 21
 import XMonad.Hooks.DynamicLog
... ...
@@ -50,9 +51,9 @@ import XMonad.StackSet as W
50 51
 import XMonad.Util.Dzen
51 52
 import XMonad.Util.EZConfig(additionalKeys)
52 53
 import XMonad.Util.Loggers
54
+import XMonad.Util.NamedScratchpad
53 55
 import XMonad.Util.Run(spawnPipe)
54 56
 import XMonad.Util.Scratchpad
55
-import XMonad.Util.NamedScratchpad
56 57
 
57 58
 nmaster :: Int
58 59
 nmaster = 1
... ...
@@ -82,48 +83,48 @@ imLayout = renamed [Replace "im"] $ withIM myRatio empathyRoster Accordion where
82 83
 base :: NewSelect
83 84
   (ModifiedLayout Rename (Mirror ThreeCol))
84 85
   (NewSelect (ModifiedLayout Rename (Mirror Tall))
85
-    (NewSelect Full
86
-      (NewSelect Accordion
87
-        (NewSelect Circle
88
-          (NewSelect SpiralWithDir
89
-            (NewSelect
90
-              (ModifiedLayout Rename
91
-                (ModifiedLayout (Decoration TabbedDecoration DefaultShrinker) Simplest))
92
-                (NewSelect
93
-                  (ModifiedLayout Rename (Mirror Accordion))
94
-                  (NewSelect
95
-                    (ModifiedLayout Rename (ModifiedLayout Gaps Full))
96
-                    (NewSelect
97
-                      (ModifiedLayout Rename DragPane)
98
-                      (NewSelect (ModifiedLayout Rename Grid)
99
-                      (NewSelect TwoPane OneBig))))))))))) Word64
100
-base =     mthree ||| wide ||| Full ||| Accordion ||| Circle ||| spiral (6/7)
101
-       ||| myTabbed ||| wideAccordion ||| writingLayout ||| rows ||| grid
102
-       ||| (TwoPane (3/100) (1/2)) ||| (OneBig (3/4) (3/4))
103
-   where
104
-      mthree = renamed [Replace "ThreeWide"] $ Mirror threeLayout
105
-      wide = renamed [Replace "Wide"] $ Mirror tiled
106
-      wideAccordion = renamed [Replace "WideAccordion"] $ Mirror Accordion
107
-      grid = renamed [Replace "Gridding"] $ GridRatio (1/2)
108
-      rows = renamed [Replace "WritingNew"] $ dragPane Vertical 1 0.5
109
-
110
-
111
-
112
-myLayout = avoidStruts $ smartBorders $
113
-   onWorkspace "web" (myTabbed ||| Full ||| (TwoPane (3/100) (1/2))) $
114
-   onWorkspace "terminal" (tiled ||| threeLayout ||| Full) $
115
-   onWorkspace "IM" imLayout $
116
-   onWorkspace "images" (gimpLayout ||| tiled ||| threeLayout ||| base) $
117
-   tiled ||| threeLayout ||| base
118
- where
119
-   gimpLayout = renamed [Replace "gimp"] $ withIM (11/64) (Role "gimp-toolbox") $ ResizableTall 2 (1/118) (11/20) [1]
86
+   (NewSelect Full
87
+    (NewSelect Accordion
88
+     (NewSelect Circle
89
+      (NewSelect SpiralWithDir
90
+       (NewSelect (ModifiedLayout Rename (ModifiedLayout (Decoration TabbedDecoration DefaultShrinker) Simplest))
91
+        (NewSelect (ModifiedLayout Rename (Mirror Accordion))
92
+         (NewSelect (ModifiedLayout Rename (ModifiedLayout Gaps Full))
93
+          (NewSelect (ModifiedLayout Rename DragPane)
94
+           (NewSelect (ModifiedLayout Rename Grid)
95
+            (NewSelect TwoPane OneBig))))))))))) Word64
96
+base = mthree ||| wide ||| Full ||| Accordion ||| Circle ||| spiral (6/7)
97
+   ||| myTabbed ||| wideAccordion ||| writingLayout ||| rows ||| grid
98
+   ||| TwoPane (3/100) (1/2) ||| OneBig (3/4) (3/4)
99
+  where
100
+    mthree = renamed [Replace "ThreeWide"] $ Mirror threeLayout
101
+    wide = renamed [Replace "Wide"] $ Mirror tiled
102
+    wideAccordion = renamed [Replace "WideAccordion"] $ Mirror Accordion
103
+    grid = renamed [Replace "Gridding"] $ GridRatio (1/2)
104
+    rows = renamed [Replace "WritingNew"] $ dragPane Vertical 1 0.5
105
+
106
+
107
+{-
108
+ -
109
+ -}
110
+
111
+tmp = onWorkspace "web" (myTabbed ||| Full ||| TwoPane (3/100) (1/2)) $
112
+      onWorkspace "terminal" (tiled ||| threeLayout ||| Full) $
113
+      onWorkspace "IM" imLayout $
114
+      --onWorkspace "images" (gimpLayout ||| tiled ||| threeLayout ||| base) $
115
+       tiled ||| threeLayout ||| base
116
+ --where
117
+ --  gimpLayout = renamed [Replace "gimp"] $ withIM (11/64) (Role "gimp-toolbox") $ ResizableTall 2 (1/118) (11/20) [1]
118
+
119
+myLayout = avoidStruts $ smartBorders tmp
120 120
 
121 121
 myDzenConfig :: DzenConfig
122
-myDzenConfig = (timeout 1 >=> (onCurr (vCenter 100)) >=> (onCurr (hCenter 300)) >=> XMonad.Util.Dzen.font "xft:Source Code Pro:size=20:antialias=true")
122
+myDzenConfig = timeout 1 >=> onCurr (vCenter 100)
123
+                         >=> onCurr (hCenter 300)
124
+                         >=> XMonad.Util.Dzen.font "xft:Source Code Pro:size=20:antialias=true"
123 125
 
124
-makeLayoutList :: [t] -> [(t,t)] 
125
-makeLayoutList [] = []
126
-makeLayoutList (l:ls) = (l,l):(makeLayoutList ls)
126
+makeLayoutList :: [t] -> [(t,t)]
127
+makeLayoutList = map (\ l -> (l, l))
127 128
 
128 129
 --changeLayout :: Maybe String -> X ()
129 130
 --changeLayout a =
... ...
@@ -138,7 +139,7 @@ makeLayoutList (l:ls) = (l,l):(makeLayoutList ls)
138 139
 nchooseLayout :: GSConfig String -> X ()
139 140
 nchooseLayout conf = do
140 141
    loName <- wrapped_loName
141
-   wsName <- wrapped_wsName 
142
+   wsName <- wrapped_wsName
142 143
 
143 144
    a <- gridselect conf $ makeLayoutList $
144 145
       cycleFront loName $ case wsName of
... ...
@@ -154,14 +155,14 @@ nchooseLayout conf = do
154 155
          dzenConfig myDzenConfig r
155 156
    return ()
156 157
  where
157
-   wrapped_loName :: X [Char]
158
+   wrapped_loName :: X String
158 159
    wrapped_loName =  liftM (fromMaybe "") logLayout
159 160
 
160
-   wrapped_wsName :: X [Char]
161
+   wrapped_wsName :: X String 
161 162
    wrapped_wsName =  liftM (fromMaybe "") logCurrent
162 163
 
163 164
    cycleFront :: String -> [String] -> [String]
164
-   cycleFront n l = n:(Data.List.delete n l)
165
+   cycleFront n l = n: Data.List.delete n l
165 166
 
166 167
    basicList = ["Accordion", "Full", "Tabbed", "Spiral", "Wide", "ThreeWide", "WideAccordion", "Writing", "WritingNew", "Gridding", "TwoPane", "OneBig"]
167 168
    defaultList = ["Tall", "ThreeCol"] ++ basicList
... ...
@@ -200,10 +201,9 @@ manageScratchPad = namedScratchpadManageHook scratchpads
200 201
 scratchpads :: [NamedScratchpad]
201 202
 scratchpads = [
202 203
   -- run htop in xterm, find it by title, use default floating window placement
203
-  NS "htop" "xterm -e htop" (title =? "htop") floatStyle ,
204
+  NS "glances" "xterm -e glances" (title =? "glances") floatStyle ,
204 205
   NS "mutt" "xterm -e mutt" (title =? "mutt") floatStyle ,
205 206
   NS "mcabber" "xterm -e mcabber" (title =? "mcabber") floatStyle ,
206
-  NS "irc" "xterm -e irssi" (title =? "irssi") floatStyle ,
207 207
   NS "mpc" "stterm -c mpc -e ncmpcpp" (className =? "ncmpcpp") floatStyle ,
208 208
 
209 209
   -- run gvim, find by role
... ...
@@ -232,18 +232,19 @@ copyNSwitch :: forall l a s sd a1. (Eq s, Eq a) => ((StackSet String l a s sd ->
232 232
                  -> String -> X ()
233 233
 copyNSwitch ws target = do
234 234
   ws $ copy target
235
-  ws $ W.greedyView target
235
+  ws $ W.view target
236 236
   dShow target
237 237
 
238 238
 shiftNSwitch :: forall l a s sd a1. (Eq s, Ord a) => ((StackSet String l a s sd -> StackSet String l a s sd) -> X a1)
239 239
                   -> String -> X ()
240 240
 shiftNSwitch ws target = do
241 241
   ws $ shift target
242
-  ws $ W.greedyView target
242
+  ws $ W.view target
243 243
   dShow target
244 244
 
245
-switchWorkspace :: WorkspaceId -> X ()
246
-switchWorkspace target = do
245
+switchWorkspace :: forall l a s sd a1. (Eq s, Ord a) => ((StackSet String l a s sd -> StackSet String l a s sd) -> X a1)
246
+                  -> String -> X ()
247
+switchWorkspace ws target = do
247 248
   windows $ W.greedyView target
248 249
   dShow target
249 250
 
... ...
@@ -257,6 +258,47 @@ maximizeFlop = do
257 258
   windows W.focusUp
258 259
   withFocused $ sendMessage . maximizeRestore
259 260
 
261
+makeSwitchComb mod keyList num action = ((getMod mod, keyList !! num), action)
262
+  where
263
+    getMod Nothing = mod4Mask
264
+    getMod (Just mod) = mod4Mask .|. mod
265
+
266
+workspaceNames = ["web", "2", "3", "4", "5", "6", "7", "terminal", "images"]
267
+
268
+numKeys :: [KeySym]
269
+numKeys = [xK_0, xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_9]
270
+
271
+numPadKeys :: [KeySym]
272
+numPadKeys = [xK_KP_Insert -- 0
273
+             , xK_KP_End,  xK_KP_Down,  xK_KP_Page_Down -- 1, 2, 3
274
+             , xK_KP_Left, xK_KP_Begin, xK_KP_Right     -- 4, 5, 6
275
+             , xK_KP_Home, xK_KP_Up,    xK_KP_Page_Up   -- 7, 8, 9
276
+             ]
277
+
278
+combForNum keyList action mod n = makeSwitchComb mod keyList n $ action windows $ workspaceNames !! (n-1)
279
+
280
+multiMap funs seq = concatMap (`map` seq) funs
281
+
282
+workspaceKeys =
283
+    bindWorkspaces [
284
+      bindNum copyNSwitch shiftMask,
285
+      bindNum shiftNSwitch controlMask,
286
+
287
+      bindNumPad copyNSwitch shiftMask,
288
+      bindNumPad shiftNSwitch controlMask,
289
+
290
+      combForNum numKeys switchWorkspace Nothing,
291
+      combForNum numPadKeys switchWorkspace Nothing
292
+      ] ++ [
293
+      ((mod4Mask, xK_0), withNthWorkspace greedyView 0),
294
+      ((mod4Mask .|. shiftMask, xK_0), withNthWorkspace copy 0),
295
+      ((mod4Mask, head numPadKeys), withNthWorkspace greedyView 0) 
296
+      ]
297
+    where
298
+      bindNum action = combForNum numKeys action . Just
299
+      bindNumPad action = combForNum numPadKeys action . Just
300
+      bindWorkspaces = flip multiMap [1..9]
301
+
260 302
 main :: IO ()
261 303
 main = do
262 304
    xmproc <- spawnPipe "/home/edwlan/.local/bin/xmobar /home/edwlan/.xmobarrc"
... ...
@@ -265,69 +307,24 @@ main = do
265 307
          manageHook = myManageHook <+> manageSpawn <+> manageHook defaultConfig,
266 308
          --handleEventHook = handleTimerEvent,
267 309
          layoutHook = maximize myLayout,
268
-         logHook = takeTopFocus >> (dynamicLogWithPP myPP {
269
-            ppOutput = hPutStrLn xmproc
270
-         }),
310
+         logHook = takeTopFocus >> dynamicLogWithPP myPP {
311
+           ppOutput = hPutStrLn xmproc
312
+         },
271 313
          modMask = mod4Mask,
272 314
          focusFollowsMouse = False,
273 315
          clickJustFocuses = False,
274
-         XMonad.workspaces = ["web", "terminal", "1", "2", "3", "4", "5", "6", "images", "IM"]
275
-      } `additionalKeys` (
316
+         XMonad.workspaces = ["web", "2", "3", "4", "5", "6", "7", "terminal", "images", "IM"]
317
+      } `additionalKeys` (workspaceKeys ++
276 318
       [
277
-         ((mod4Mask .|. controlMask, numPadKeys !! 1), shiftNSwitch windows "web" ),
278
-         ((mod4Mask .|. controlMask, numPadKeys !! 2), shiftNSwitch windows "terminal" ),
279
-         ((mod4Mask .|. controlMask, numPadKeys !! 3), shiftNSwitch windows "1" ),
280
-         ((mod4Mask .|. controlMask, numPadKeys !! 4), shiftNSwitch windows "2" ),
281
-         ((mod4Mask .|. controlMask, numPadKeys !! 5), shiftNSwitch windows "3" ),
282
-         ((mod4Mask .|. controlMask, numPadKeys !! 6), shiftNSwitch windows "4" ),
283
-         ((mod4Mask .|. controlMask, numPadKeys !! 7), shiftNSwitch windows "5" ),
284
-         ((mod4Mask .|. controlMask, numPadKeys !! 8), shiftNSwitch windows "6" ),
285
-         ((mod4Mask .|. controlMask, numPadKeys !! 9), shiftNSwitch windows "images" ),
286 319
          ((mod4Mask .|. controlMask .|. shiftMask, xK_h ), sendMessage $ Move L),
287 320
          ((mod4Mask .|. controlMask .|. shiftMask, xK_j ), sendMessage $ Move D),
288 321
          ((mod4Mask .|. controlMask .|. shiftMask, xK_k   ), sendMessage $ Move U),
289 322
          ((mod4Mask .|. controlMask .|. shiftMask, xK_l), sendMessage $ Move R),
290
-         ((mod4Mask .|. controlMask, xK_1), shiftNSwitch windows "web" ),
291
-         ((mod4Mask .|. controlMask, xK_2), shiftNSwitch windows "terminal" ),
292
-         ((mod4Mask .|. controlMask, xK_3), shiftNSwitch windows "1" ),
293
-         ((mod4Mask .|. controlMask, xK_4), shiftNSwitch windows "2" ),
294
-         ((mod4Mask .|. controlMask, xK_5), shiftNSwitch windows "3" ),
295
-         ((mod4Mask .|. controlMask, xK_6), shiftNSwitch windows "4" ),
296
-         ((mod4Mask .|. controlMask, xK_7), shiftNSwitch windows "5" ),
297
-         ((mod4Mask .|. controlMask, xK_8), shiftNSwitch windows "6" ),
298
-         ((mod4Mask .|. controlMask, xK_9), shiftNSwitch windows "images" ),
299 323
          ((mod4Mask .|. controlMask, xK_backslash), maximizeFlop),
300 324
          ((mod4Mask .|. controlMask, xK_grave), shiftNSwitch windows "IM" ),
301 325
          ((mod4Mask .|. controlMask, xK_m), withWorkspace defaultXPConfig (windows . shift)),
302
-         (((mod4Mask .|. controlMask, xK_q     ), spawn "if type xmonad; then xmonad --recompile && xmonad --restart; else xmessage xmonad not in \\$PATH: \"$PATH\"; fi")),
326
+         ((mod4Mask .|. controlMask, xK_q     ), spawn "if type xmonad; then xmonad --recompile && xmonad --restart; else xmessage xmonad not in \\$PATH: \"$PATH\"; fi"),
303 327
          ((mod4Mask .|. controlMask, xK_t), killAllOtherCopies),
304
-         ((mod4Mask, numPadKeys !! 1), switchWorkspace "web" ),
305
-         ((mod4Mask, numPadKeys !! 2), switchWorkspace "terminal" ),
306
-         ((mod4Mask, numPadKeys !! 3), switchWorkspace "1" ),
307
-         ((mod4Mask, numPadKeys !! 4), switchWorkspace "2" ),
308
-         ((mod4Mask, numPadKeys !! 5), switchWorkspace "3" ),
309
-         ((mod4Mask, numPadKeys !! 6), switchWorkspace "4" ),
310
-         ((mod4Mask, numPadKeys !! 7), switchWorkspace "5" ),
311
-         ((mod4Mask, numPadKeys !! 8), switchWorkspace "6" ),
312
-         ((mod4Mask, numPadKeys !! 9), switchWorkspace "images" ),
313
-         ((mod4Mask .|. shiftMask, numPadKeys !! 1), copyNSwitch windows "web" ),
314
-         ((mod4Mask .|. shiftMask, numPadKeys !! 2), copyNSwitch windows "terminal" ),
315
-         ((mod4Mask .|. shiftMask, numPadKeys !! 3), copyNSwitch windows "1" ),
316
-         ((mod4Mask .|. shiftMask, numPadKeys !! 4), copyNSwitch windows "2" ),
317
-         ((mod4Mask .|. shiftMask, numPadKeys !! 5), copyNSwitch windows "3" ),
318
-         ((mod4Mask .|. shiftMask, numPadKeys !! 6), copyNSwitch windows "4" ),
319
-         ((mod4Mask .|. shiftMask, numPadKeys !! 7), copyNSwitch windows "5" ),
320
-         ((mod4Mask .|. shiftMask, numPadKeys !! 8), copyNSwitch windows "6" ),
321
-         ((mod4Mask .|. shiftMask, numPadKeys !! 9), copyNSwitch windows "images" ),
322
-         ((mod4Mask .|. shiftMask, xK_1), copyNSwitch windows "web" ),
323
-         ((mod4Mask .|. shiftMask, xK_2), copyNSwitch windows "terminal" ),
324
-         ((mod4Mask .|. shiftMask, xK_3), copyNSwitch windows "1" ),
325
-         ((mod4Mask .|. shiftMask, xK_4), copyNSwitch windows "2" ),
326
-         ((mod4Mask .|. shiftMask, xK_5), copyNSwitch windows "3" ),
327
-         ((mod4Mask .|. shiftMask, xK_6), copyNSwitch windows "4" ),
328
-         ((mod4Mask .|. shiftMask, xK_7), copyNSwitch windows "5" ),
329
-         ((mod4Mask .|. shiftMask, xK_8), copyNSwitch windows "6" ),
330
-         ((mod4Mask .|. shiftMask, xK_9), copyNSwitch windows "images" ),
331 328
          ((mod4Mask .|. shiftMask, xK_backslash), maximizeSwitch),
332 329
          ((mod4Mask .|. shiftMask, xK_BackSpace), removeWorkspace),
333 330
          ((mod4Mask .|. shiftMask, xK_grave), shiftNSwitch windows "IM" ),
... ...
@@ -337,15 +334,6 @@ main = do
337 334
          ((mod4Mask .|. shiftMask, xK_r), renameWorkspace defaultXPConfig),
338 335
          ((mod4Mask .|. shiftMask, xK_t), kill1),
339 336
          ((mod4Mask .|. shiftMask, xK_w), gridselectWorkspace defaultGSConfig (\ws -> greedyView ws . shift ws)),
340
-         ((mod4Mask, xK_1), switchWorkspace "web" ),
341
-         ((mod4Mask, xK_2), switchWorkspace "terminal" ),
342
-         ((mod4Mask, xK_3), switchWorkspace "1" ),
343
-         ((mod4Mask, xK_4), switchWorkspace "2" ),
344
-         ((mod4Mask, xK_5), switchWorkspace "3" ),
345
-         ((mod4Mask, xK_6), switchWorkspace "4" ),
346
-         ((mod4Mask, xK_7), switchWorkspace "5" ),
347
-         ((mod4Mask, xK_8), switchWorkspace "6" ),
348
-         ((mod4Mask, xK_9), switchWorkspace "images" ),
349 337
          --((mod4Mask, xK_apostrophe), scratchpadSpawnActionTerminal "gvim"),
350 338
          ((mod4Mask, xK_backslash), withFocused (sendMessage . maximizeRestore)),
351 339
          ((mod4Mask, xK_b), sendMessage ToggleStruts),
... ...
@@ -357,31 +345,26 @@ main = do
357 345
          ((mod4Mask, xK_KP_Multiply), spawn "/usr/bin/zsh /home/edwlan/bin/dmenu_queue_mpd"),
358 346
          ((mod4Mask, xK_KP_Subtract), spawn "/usr/bin/zsh /home/edwlan/bin/dmenu_queueplay_mpd"),
359 347
          ((mod4Mask, xK_p), spawnHere "/home/edwlan/bin/yeganesh_run -f"),
360
-         ((mod4Mask, xK_q), ((withSelectedWindow $ windows . W.focusWindow) defaultGSConfig) >> (windows $ W.shiftMaster)),
348
+         ((mod4Mask, xK_q), (withSelectedWindow $ windows . W.focusWindow) defaultGSConfig >> windows W.shiftMaster),
361 349
          ((mod4Mask, xK_semicolon), nchooseLayout defaultGSConfig),
362
-         ((mod4Mask, xK_w), gridselectWorkspace defaultGSConfig (\ws -> greedyView ws))
350
+         ((mod4Mask, xK_w), gridselectWorkspace defaultGSConfig greedyView),
351
+
352
+         ((mod4Mask, xK_Left), onPrevNeighbour W.view), 
353
+         ((mod4Mask, xK_Right), onNextNeighbour W.view)
354
+
363 355
       ]
364
-      ++ zip (zip (repeat (mod4Mask)) ([xK_0])) (map (withNthWorkspace greedyView) [0..])
365
-      ++ zip (zip (repeat (mod4Mask .|. shiftMask)) ([xK_0])) (map (withNthWorkspace copy) [0..]) 
366
-      ++ zip (zip (repeat (mod4Mask)) (map (numPadKeys !!) ([0]))) (map (withNthWorkspace greedyView) [0..])
367 356
       ++ [
368 357
          ((mod4Mask .|. mod1Mask, xK_1), namedScratchpadAction scratchpads "notes"),
369 358
          ((mod4Mask .|. mod1Mask, numPadKeys !! 1), namedScratchpadAction scratchpads "notes"),
370 359
          ((mod4Mask .|. mod1Mask, xK_2), namedScratchpadAction scratchpads "mutt"),
371 360
          ((mod4Mask .|. mod1Mask, numPadKeys !! 2), namedScratchpadAction scratchpads "mutt"),
372
-         ((mod4Mask .|. mod1Mask, xK_3), namedScratchpadAction scratchpads "irc"),
373
-         ((mod4Mask .|. mod1Mask, numPadKeys !! 3), namedScratchpadAction scratchpads "irc"),
361
+         --((mod4Mask .|. mod1Mask, xK_3), namedScratchpadAction scratchpads "irc"),
362
+         --((mod4Mask .|. mod1Mask, numPadKeys !! 3), namedScratchpadAction scratchpads "irc"),
374 363
          ((mod4Mask .|. mod1Mask, xK_4), namedScratchpadAction scratchpads "htop"),
375 364
          ((mod4Mask .|. mod1Mask, numPadKeys !! 4), namedScratchpadAction scratchpads "htop"),
376 365
          ((mod4Mask .|. mod1Mask, xK_5), namedScratchpadAction scratchpads "mpc"),
377 366
          ((mod4Mask .|. mod1Mask, numPadKeys !! 5), namedScratchpadAction scratchpads "mpc"),
378 367
          ((mod4Mask .|. mod1Mask, xK_6), namedScratchpadAction scratchpads "mcabber"),
379 368
          ((mod4Mask .|. mod1Mask, numPadKeys !! 6), namedScratchpadAction scratchpads "mcabber")
380
-      ]) 
369
+      ])
381 370
 
382
-numPadKeys :: [KeySym]
383
-numPadKeys = [xK_KP_Insert -- 0
384
-             , xK_KP_End,  xK_KP_Down,  xK_KP_Page_Down -- 1, 2, 3
385
-             , xK_KP_Left, xK_KP_Begin, xK_KP_Right     -- 4, 5, 6
386
-             , xK_KP_Home, xK_KP_Up,    xK_KP_Page_Up   -- 7, 8, 9
387
-             ]
... ...
@@ -1,56 +1,56 @@
1
+#zmodload zsh/zprof
2
+
3
+cat <<'EOP'
4
+             :
5
+    `.       ;        .'
6
+      `.  .-'''-.   .'
7
+        ;'  __   _;'
8
+       /   '_    _`\
9
+      |  _( a (  a  |
10
+ '''''| (_)    >    |``````
11
+       \    \    / /
12
+        `.   `--'.'
13
+       .' `-,,,-' `.
14
+     .'      :      `.  hjw
15
+             :
16
+EOP
17
+
1 18
 echo "begin zshrc"
2
-echo ".zshrc loaded for $USER on $TTY at `date`" | logger
19
+echo "shell session started for $USER on $TTY at `date`" | logger
3 20
 source $HOME/.localzshrc.sh
4 21
 autoload -U colors && colors
22
+autoload zsh/parameter
23
+
24
+# Experimenting with disabling oh-my-zsh
25
+#
26
+# # Path to your oh-my-zsh configuration.
27
+# #export ZSH=$HOME/.oh-my-zsh
28
+# #export MPD_HOST=srv2.elangley.org
29
+# #
30
+# #fpath=(~/.zsh.d/completion ~/.zsh.d/functions $fpath)
31
+# #plugins=(git rails osx brew zsh-syntax-highlighting python git-extra git-flow battery)
32
+# #
33
+# #source $ZSH/oh-my-zsh.sh
34
+# #unsetopt correct_all
35
+# #
36
+# #echo "done oh-my-zsh"
37
+# unalias sp
5 38
 
6
-# Path to your oh-my-zsh configuration.
7
-export ZSH=$HOME/.oh-my-zsh
8
-export MPD_HOST=srv2.elangley.org
9
-
10
-# Set name of the theme to load.
11
-# Look in ~/.oh-my-zsh/themes/
12
-# Optionally, if you set this to "random", it'll load a random theme each
13
-# time that oh-my-zsh is loaded.
14
-
15
-# Set to this to use case-sensitive completion
16
-# export CASE_SENSITIVE="true"
17
-
18
-# Comment this out to disable weekly auto-update checks
19
-# export DISABLE_AUTO_UPDATE="true"
20
-
21
-# Uncomment following line if you want to disable colors in ls
22
-# export DISABLE_LS_COLORS="true"
23
-
24
-# Uncomment following line if you want to disable autosetting terminal title.
25
-#export DISABLE_AUTO_TITLE="true"
26
-
27
-# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
28
-# Example format: plugins=(rails git textmate ruby lighthouse)
29
-fpath=(~/.zsh.d/completion ~/.zsh.d/functions $fpath)
30
-plugins=(git rails osx brew zsh-syntax-highlighting python git-extra git-flow battery)
31
-
32
-source $ZSH/oh-my-zsh.sh
33
-unsetopt correct_all
34
-
35
-echo "done oh-my-zsh"
36
-unalias sp
37
-
38
-# Customize to your needs...
39 39
 export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin:/opt/local/bin:/sbin/usr/sbin:$PATH
40
-#source /usr/local/Cellar/coreutils/8.12/aliases
41
-#unalias kill
42 40
 
43 41
 if [[ -e /etc/sysconfig/zsh-prompt-$TERM ]]; then
44
-  . /etc/sysconfig/zsh-prompt-$TERM 
42
+  . /etc/sysconfig/zsh-prompt-$TERM
45 43
 elif [[ -e $HOME/.zsh-prompt-$TERM ]]; then
46 44
   . $HOME/.zsh-prompt-$TERM
47 45
 fi
48 46
 
49
-if [ -x /opt/local/bin/fortune ]; then export FORTUNE=/opt/local/bin/fortune
50
-elif [ -x /usr/local/bin/fortune ]; then export FORTUNE=/usr/local/bin/fortune
51
-elif [ -x /usr/games/fortune ]; then export FORTUNE=/usr/games/fortune
52
-else export FORTUNE=/usr/bin/fortune
53
-fi
47
+for p in $PATH; do
48
+  _FORTUNE="$PATH/fortune"
49
+  if [[ -x "$_FORTUNE" ]]; then
50
+    FORTUNE="$_FORTUNE"
51
+    break
52
+  fi
53
+done
54 54
 
55 55
 if [ -x "$FORTUNE" ]; then
56 56
   $FORTUNE
... ...
@@ -63,9 +63,9 @@ function battery_charge() {
63 63
 
64 64
 autoload -Uz vcs_info
65 65
 zstyle ':vcs_info:*' actionformats \
66
-    '%F{5}%f%s%F{5}%F{3}-%F{5}%F{2}%b%F{3}|%F{1}%a%F{5}%f'
66
+    '%F{5}%f%s%F{5}%F{3}->%F{5}%F{2}%b%F{3}|%F{1}%a%F{5}%f'
67 67
 zstyle ':vcs_info:*' formats       \
68
-  '%F{5}%f%s%F{5}%F{3}-%F{5}%F{2}%b%F{5}%f'
68
+  '%F{5}%f%s%F{5}%F{3}->%F{5}%F{2}%b%F{5}%f'
69 69
 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
70 70
 
71 71
 zstyle ':vcs_info:*' enable git cvs svn
... ...
@@ -80,7 +80,7 @@ vcs_info_wrapper() {
80 80
 export PYTHONSTARTUP=$HOME/Library/Python/2.7/site-packages/sitecustomize.py
81 81
 setopt promptsubst
82 82
 PROMPT='---
83
-(%?) %m:%n--%l ${PWD/$HOME/~} `vcs_info_wrapper` `battery_charge` 
83
+(%?) %m:%n--%l ${PWD/$HOME/~} `vcs_info_wrapper` `battery_charge`
84 84
 %!:%# '
85 85
 export PROMPT
86 86
 
... ...
@@ -88,7 +88,16 @@ HOSTNAME=`hostname -f`
88 88
 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
89 89
 
90 90
 cmdtermtitle() {
91
-   echo -ne "\033]0;${USER}@$HOSTNAME: $1\007"
91
+  cmd_name="${(V)1}"
92
+  if [ 'fg' = "${${(z)@}[1]}" ]; then
93
+    cmd_name="${(vV)jobtexts}"
94
+  fi
95
+
96
+  if [[ "${TERM%%-*}"x == "screen"x ]]; then
97
+    echo -ne "\033]0;${cmd_name}\007"
98
+  else
99
+    echo -ne "\033]0; ${cmd_name} : ${USER}@$HOSTNAME\007"
100
+  fi
92 101
 }
93 102
 
94 103
 if [[ $TERM != "linux" ]]; then
... ...
@@ -97,9 +106,13 @@ if [[ $TERM != "linux" ]]; then
97 106
 fi
98 107
 
99 108
 termtitle() {
100
-   npwd=${PWD/#$HOME/\~}
101
-   echo -ne "\033]0;${USER}@$HOSTNAME: ${npwd}\007"
102
-} 
109
+  npwd=${PWD/#$HOME/\~}
110
+  if [[ "${TERM%%-*}"x == "screen"x ]]; then
111
+    echo -ne "\033]0;${npwd}\007"
112
+  else
113
+    echo -ne "\033]0;${USER}@$HOSTNAME: ${npwd}\007"
114
+  fi
115
+}
103 116
 
104 117
 if [[ $TERM != "linux" ]]; then
105 118
    add-zsh-hook precmd termtitle
... ...
@@ -117,11 +130,7 @@ export PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
117 130
 
118 131
 export MANPATH="/opt/local/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:$MANPATH"
119 132
 
120
-#export PAGER="/bin/sh -c \"unset PAGER;col -b -x | \
121
-    #vim -R -c 'set ft=man nomod nolist' -c 'map q :q<CR>' \
122
-    #-c 'map <SPACE> <C-D>' -c 'map b <C-U>' \
123
-    #-c 'nmap K :Man <C-R>=expand(\\\"<cword>\\\")<CR><CR>' -\""
124
-export PAGER="less"
133
+export PAGER="less -SiemX"
125 134
 
126 135
 export RGBDEF='/opt/X11/share/X11/rgb.txt'
127 136
 export GREP_COLORS='ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36'
... ...
@@ -133,9 +142,6 @@ else
133 142
 fi
134 143
 export EDITOR=$VISUAL
135 144
 
136
-#alias run-help > /dev/null && unalias run-help
137
-#alias help=run-help
138
-#------------------
139 145
 autoload run-help
140 146
 autoload -U zfinit
141 147
 autoload -U tcp_proxy
... ...
@@ -146,11 +152,11 @@ autoload -U tcp_shoot
146 152
 zfinit
147 153
 
148 154
 if [[ $TERM != 'dumb' ]]; then
149
-  #eval `$DIRCOLORS $HOME/github_repos/dircolors-solarized/dircolors.256dark`
150
-  #   The above returns the below
155
+  # Solarized dircolors:
151 156
   LS_COLORS='no=00;38;5;244:rs=0:di=00;38;5;33:ln=00;38;5;37:mh=00:pi=48;5;230;38;5;136;01:so=48;5;230;38;5;136;01:do=48;5;230;38;5;136;01:bd=48;5;230;38;5;244;01:cd=48;5;230;38;5;244;01:or=48;5;235;38;5;160:su=48;5;160;38;5;230:sg=48;5;136;38;5;230:ca=30;41:tw=48;5;64;38;5;230:ow=48;5;235;38;5;33:st=48;5;33;38;5;230:ex=00;38;5;64:*.tar=00;38;5;61:*.tgz=00;38;5;61:*.arj=00;38;5;61:*.taz=00;38;5;61:*.lzh=00;38;5;61:*.lzma=00;38;5;61:*.tlz=00;38;5;61:*.txz=00;38;5;61:*.zip=00;38;5;61:*.z=00;38;5;61:*.Z=00;38;5;61:*.dz=00;38;5;61:*.gz=00;38;5;61:*.lz=00;38;5;61:*.xz=00;38;5;61:*.bz2=00;38;5;61:*.bz=00;38;5;61:*.tbz=00;38;5;61:*.tbz2=00;38;5;61:*.tz=00;38;5;61:*.deb=00;38;5;61:*.rpm=00;38;5;61:*.jar=00;38;5;61:*.rar=00;38;5;61:*.ace=00;38;5;61:*.zoo=00;38;5;61:*.cpio=00;38;5;61:*.7z=00;38;5;61:*.rz=00;38;5;61:*.apk=00;38;5;61:*.gem=00;38;5;61:*.jpg=00;38;5;136:*.JPG=00;38;5;136:*.jpeg=00;38;5;136:*.gif=00;38;5;136:*.bmp=00;38;5;136:*.pbm=00;38;5;136:*.pgm=00;38;5;136:*.ppm=00;38;5;136:*.tga=00;38;5;136:*.xbm=00;38;5;136:*.xpm=00;38;5;136:*.tif=00;38;5;136:*.tiff=00;38;5;136:*.png=00;38;5;136:*.PNG=00;38;5;136:*.svg=00;38;5;136:*.svgz=00;38;5;136:*.mng=00;38;5;136:*.pcx=00;38;5;136:*.dl=00;38;5;136:*.xcf=00;38;5;136:*.xwd=00;38;5;136:*.yuv=00;38;5;136:*.cgm=00;38;5;136:*.emf=00;38;5;136:*.eps=00;38;5;136:*.CR2=00;38;5;136:*.ico=00;38;5;136:*.tex=00;38;5;245:*.rdf=00;38;5;245:*.owl=00;38;5;245:*.n3=00;38;5;245:*.ttl=00;38;5;245:*.nt=00;38;5;245:*.torrent=00;38;5;245:*.xml=00;38;5;245:*Makefile=00;38;5;245:*Rakefile=00;38;5;245:*Dockerfile=00;38;5;245:*build.xml=00;38;5;245:*rc=00;38;5;245:*1=00;38;5;245:*.nfo=00;38;5;245:*README=00;38;5;245:*README.txt=00;38;5;245:*readme.txt=00;38;5;245:*.md=00;38;5;245:*README.markdown=00;38;5;245:*.ini=00;38;5;245:*.yml=00;38;5;245:*.cfg=00;38;5;245:*.conf=00;38;5;245:*.c=00;38;5;245:*.cpp=00;38;5;245:*.cc=00;38;5;245:*.sqlite=00;38;5;245:*.go=00;38;5;245:*.log=00;38;5;240:*.bak=00;38;5;240:*.aux=00;38;5;240:*.lof=00;38;5;240:*.lol=00;38;5;240:*.lot=00;38;5;240:*.out=00;38;5;240:*.toc=00;38;5;240:*.bbl=00;38;5;240:*.blg=00;38;5;240:*~=00;38;5;240:*#=00;38;5;240:*.part=00;38;5;240:*.incomplete=00;38;5;240:*.swp=00;38;5;240:*.tmp=00;38;5;240:*.temp=00;38;5;240:*.o=00;38;5;240:*.pyc=00;38;5;240:*.class=00;38;5;240:*.cache=00;38;5;240:*.aac=00;38;5;166:*.au=00;38;5;166:*.flac=00;38;5;166:*.mid=00;38;5;166:*.midi=00;38;5;166:*.mka=00;38;5;166:*.mp3=00;38;5;166:*.mpc=00;38;5;166:*.ogg=00;38;5;166:*.ra=00;38;5;166:*.wav=00;38;5;166:*.m4a=00;38;5;166:*.axa=00;38;5;166:*.oga=00;38;5;166:*.spx=00;38;5;166:*.xspf=00;38;5;166:*.mov=00;38;5;166:*.MOV=00;38;5;166:*.mpg=00;38;5;166:*.mpeg=00;38;5;166:*.m2v=00;38;5;166:*.mkv=00;38;5;166:*.ogm=00;38;5;166:*.mp4=00;38;5;166:*.m4v=00;38;5;166:*.mp4v=00;38;5;166:*.vob=00;38;5;166:*.qt=00;38;5;166:*.nuv=00;38;5;166:*.wmv=00;38;5;166:*.asf=00;38;5;166:*.rm=00;38;5;166:*.rmvb=00;38;5;166:*.flc=00;38;5;166:*.avi=00;38;5;166:*.fli=00;38;5;166:*.flv=00;38;5;166:*.gl=00;38;5;166:*.m2ts=00;38;5;166:*.divx=00;38;5;166:*.webm=00;38;5;166:*.axv=00;38;5;166:*.anx=00;38;5;166:*.ogv=00;38;5;166:*.ogx=00;38;5;166:';
152 157
   export LS_COLORS
153 158
 fi
159
+
154 160
 setopt autopushd
155 161
 setopt cdablevars
156 162
 setopt AUTO_LIST
... ...
@@ -164,6 +170,7 @@ setopt PUSHD_IGNORE_DUPS
164 170
 setopt autocd
165 171
 setopt chaselinks
166 172
 setopt markdirs
173
+
167 174
 # The following lines were added by compinstall
168 175
 zstyle ':completion:*' completer _expand _complete #_match _prefix
169 176
 zstyle ':completion:*' format 'Completing %D %d'
... ...
@@ -171,7 +178,7 @@ zstyle ':completion:*' group-name ''
171 178
 zstyle ':completion:*' insert-unambiguous true
172 179
 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
173 180
 zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
174
-zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._]=** r:|=**'
181
+zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._]=** r:|=**'
175 182
 zstyle ':completion:*' menu select=0
176 183
 zstyle ':completion:*' original false
177 184
 zstyle ':completion:*' prompt '%e errors:'
... ...
@@ -195,46 +202,32 @@ alias :e='vim'
195 202
 alias :w='cat >'
196 203
 
197 204
 alias "cd-"="cd -"
198
-#alias "ls"="gls --color=auto -F"
199
-#alias "lsa"="ls -AF"
200
-alias poty=port
201 205
 alias jmp=pushd
202 206
 alias ret=popd
203 207
 alias ..python="PYTHONPATH=.. python"
204 208
 alias .python="PYTHONPATH=. python"
205
-alias cvs="cvs -q"
206
-alias cvsu="cvs -q update -P"
207
-alias cvsud="cvs -q update -dP"
208 209
 alias grep="grep --color=auto -I"
209
-alias -g .cf="grep -r '<<<' * | grep \.py | grep -vi binary | cut -d: -f1"
210
-alias la="ls -A"
210
+alias la="ls -AF"
211 211
 alias ,=pydit
212 212
 alias tw=twitter_tool
213 213
 alias v=$VISUAL
214 214
 alias e=$EDITOR
215 215
 alias cvsdiff='cvs diff -wbB | colordiff'
216 216
 alias cp.='gcp --target-directory=.'
217
-alias notep='note post'
218 217
 alias bower='noglob bower'
219 218
 alias node='nodejs'
220 219
 alias find='noglob find'
221 220
 
222 221
 echo "done variables and options"
223 222
 
224
-noteg() {
225
-  note get "$*"
226
-}
227
-alias notel='note list'
228
-alias clipnote='pbpaste | note post'
229
-
230 223
 showspaces() {
231
-	python -c'import sys;print sys.stdin.read().replace(" ",".").replace("\t", "—---")'
224
+	python -c'import sys;print sys.stdin.read().replace(" ","_").replace("\t", "----")'
232 225
 }
233 226
 
234 227
 cvsc() {
235 228
     FN=$1
236 229
     shift
237
-    cvs -q commit -m "'$*'" $FN 
230
+    cvs -q commit -m "'$*'" $FN
238 231
 }
239 232
 alias cvsc.="cvsc ."
240 233
 
... ...
@@ -280,7 +273,7 @@ archive() {
280 273
 	if [ ! -d .bak ]; then
281 274
 		mkdir .bak
282 275
 	fi
283
-    FN=.bak/`despace $1`-`date +"%Y%m%d.%H%M%S"`.tbz 
276
+    FN=.bak/`despace $1`-`date +"%Y%m%d.%H%M%S"`.tbz
284 277
     echo -n archiving $FN...
285 278
     tar jhcf $FN $1
286 279
     echo done.
... ...
@@ -294,12 +287,13 @@ editrc() {
294 287
      source $HOME/.zshrc
295 288
   fi
296 289
 }
290
+
297 291
 rl() { source $HOME/.zshrc }
292
+
298 293
 getlink() { #gtdo
299 294
  curl "`pbpaste`" > $(basename `pbpaste`)
300
- #popd 
301
- #echo `pbpaste` --> $(basename `pbpaste`)
302 295
 }
296
+
303 297
 copypwd() { echo -n `pwd` | pbcopy }
304 298
 alias sdir='copypwd'
305 299
 
... ...
@@ -309,36 +303,6 @@ sshto() {
309 303
     ssh $USER@$TARGET
310 304
 }
311 305
 
312
-cvscmp() {
313
-    cvs status  | grep File | grep -v "Up-to-date"
314
-}
315
-
316
-cvsr() {
317
-	echo removing $1
318
-	rm $1
319
-	cvs remove $1
320
-}
321
-
322
-cvsm(){
323
-	echo moving $1 to $2
324
-	mv $1 $2
325
-	cvs remove $1
326
-	cvs add $2/$1
327
-}
328
-
329
-addrssitem() {
330
-    cd $HOME/Programming/dirrss
331
-    vi $1
332
-    cd $OLDPWD
333
-}
334
-
335
-pathswitch() {
336
-	REMOVE=$1
337
-	REPLACE=$2
338
-	cd ${PWD/$REMOVE/$REPLACE}
339
-}
340
-#debug
341
-
342 306
 dirsave() {
343 307
   pwd | ctext
344 308
 }
... ...
@@ -347,11 +311,13 @@ dirgo() {
347 311
 }
348 312
 
349 313
 ccwd() {
350
-    pwd | pbcopy
314
+    pwd | ucopy
351 315
 }
316
+
352 317
 gdir() {
353
-    cd `pbpaste`
318
+    cd `upaste`
354 319
 }
320
+
355 321
 ulimit -c unlimited
356 322
 autoload edit-command-line
357 323
 zle -N edit-command-line
... ...
@@ -376,7 +342,7 @@ add_to_sandbox() {
376 342
    git add `basename $1`
377 343
    git commit -a -m "added snippet $1"
378 344
    cd -
379
-} 
345
+}
380 346
 
381 347
 psc() {
382 348
    python -u -c "from __future__ import print_function; import sys;$1"
... ...
@@ -445,12 +411,12 @@ for line in sys.stdin:
445 411
 
446 412
 wiki() {
447 413
    pushd $HOME/mywiki > /dev/null
448
-   soywiki 
414
+   soywiki
449 415
    popd > /dev/null
450 416
 }
451 417
 
452 418
 dupfind() {
453
-   gfind \( \( -name .git -o -name CVS \) -prune \) -o  \( -type f \) -print0  | xargs -0 shasum | sort | guniq -w 20 -c | sort -nr
419
+   find \( \( -name .git -o -name CVS \) -prune \) -o  \( -type f \) -print0  | xargs -0 shasum | sort | uniq -w 20 -c | sort -nr
454 420
 }
455 421
 
456 422
 es() {
... ...
@@ -540,54 +506,10 @@ export CPATH=$CPATH:$HOME/include
540 506
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib
541 507
 export VIMCLOJURE_SERVER_JAR="$HOME/lib/vimclojure/server-2.3.6.jar"
542 508
 
543
-#set_colors()
544
-#{
545
-    #local base03="002b36"
546
-    #local base02="073642"
547
-    #local base01="586e75"
548
-    #local base00="657b83"
549
-    #local base0="839496"
550
-    #local base1="93a1a1"
551
-    #local base2="eee8d5"
552
-    #local base3="fdf6e3"
553
-    #local yellow="b58900"
554
-    #local orange="cb4b16"
555
-    #local red="dc322f"
556
-    #local magenta="d33682"
557
-    #local violet="6c71c4"
558
-    #local blue="268bd2"
559
-    #local cyan="2aa198"
560
-    #local green="859900"
561
-
562
-    #echo -en "\e]P0${base02}" #black
563
-    #echo -en "\e]P8${base03}" #brblack
564
-    #echo -en "\e]P1${red}" #red
565
-    #echo -en "\e]P9${orange}" #brred
566
-    #echo -en "\e]P2${green}" #green
567
-    #echo -en "\e]PA${base01}" #brgreen
568
-    #echo -en "\e]P3${yellow}" #yellow
569
-    #echo -en "\e]PB${base00}" #bryellow
570
-    #echo -en "\e]P4${blue}" #blue
571
-    #echo -en "\e]PC${base0}" #brblue
572
-    #echo -en "\e]P5${magenta}" #magenta
573
-    #echo -en "\e]PD${violet}" #brmagenta
574
-    #echo -en "\e]P6${cyan}" #cyan
575
-    #echo -en "\e]PE${base1}" #brcyan
576
-    #echo -en "\e]P7${base2}" #white
577
-    #echo -en "\e]PF${base3}" #brwhite
578
-    ##clear #for background artifacting
579
-#}
580
-
581
-#if [ "$TERM" = "linux" ]; then
582
-    #set_colors
583
-#fi
584
-
585
-#unset -f set_colors
586
-
587 509
 pmkdir() {
588 510
   mkdir $1
589 511
   touch $1/__init__.py
590
-  cd $1 
512
+  cd $1
591 513
 }
592 514
 
593 515
 mkcd() {
... ...
@@ -599,15 +521,12 @@ groot() {
599 521
   cd `git rev-parse --show-toplevel`
600 522
 }
601 523
 
602
-### load my plugins
603
-
604 524
 for x in `ls $HOME/.zsh.d/*.zsh`; do
605 525
   source "$x"
606 526
 done
607 527
 alias cn=current_news
608 528
 
609
-#chruby ruby-2.2.2
610
-# vim: set filetype=sh:
611
-
612 529
 #THIS MUST BE AT THE END OF THE FILE FOR GVM TO WORK!!!
613 530
 [[ -s "/Users/edwlan/.gvm/bin/gvm-init.sh" ]] && source "/Users/edwlan/.gvm/bin/gvm-init.sh"
531
+
532
+#zprof
... ...
@@ -1,3 +1,3 @@
1 1
 #!/usr/bin/zsh
2 2
 
3
-mpc status | dmenu -l 3
3
+mpc status | dzen2 -l 3 -xs 1 -p 2
... ...
@@ -1,2 +1,3 @@
1 1
 #!/bin/sh
2
-mpc -f '(%position%) [%artist%: ]%album%—[%disc%/]%track%. %title%' status | head -1 | dzen2 -x 0 -y 0 -l 0 -ta l -w 1920 -p 1 -ta c
2
+mpc -f '(%position%) [%artist%: ]%album%—[%disc%/]%track%. %title%' status | \
3
+  dzen2 -x 0 -y 0  -p 1 -ta c -xs 1 -l 3
... ...
@@ -15,11 +15,27 @@ base = os.path.join(os.environ.get("HOME"), "Dropbox", "secure_notes")
15 15
 print base
16 16
 
17 17
 import subprocess
18
+
19
+class Menu(object):
20
+    def __init__(self, choices):
21
+        self.choices = sorted(choices)
22
+    def choose(self, choice):
23
+        choice = int(choice)
24
+        return self.choices[choice-1]
25
+    def __str__(self):
26
+        return '\n'.join('%4d) %s' % x for x in  enumerate(self.choices, 1))
27
+
18 28
 if args.new:
19 29
     print args.name
20 30
     proc = subprocess.call([GPG, "-r", "Fiddlerwoaroof <fiddler.wo.a.roof@gmail.com>", "-o", os.path.join(base, args.name), "-e"])
21 31
 elif args.read:
22 32
     print args.name
33
+    if args.name is None:
34
+        menu = Menu(os.listdir(base))
35
+        print menu
36
+        choice = raw_input('choice? ').strip()
37
+        if choice.isdigit():
38
+            args.name = menu.choose(choice)
23 39
     proc = subprocess.call([GPG, "-r", "Fiddlerwoaroof <fiddler.wo.a.roof@gmail.com>", "-d", os.path.join(base, args.name)])
24 40
 elif args.list:
25 41
     files = os.listdir(base)
... ...
@@ -1,12 +1,17 @@
1 1
 #!/bin/zsh
2 2
 export PATH=$HOME/bin:$PATH
3
- 
3
+export LD_LIBRARY_PATH=/home/edwlan/gtk-git/inst/lib/:/home/edwlan/lib:$LD_LIBRARY_PATH
4
+#xrandr --output HDMI-0 --mode 1920x1200 --left-of VGA-0
5
+#xrandr --output HDMI-0 --primary
6
+#xrandr --output VGA-0 --mode 1024x768
7
+
4 8
 # Load resources
5
- 
9
+
6 10
 xrdb -merge $HOME/.Xresources
11
+xmodmap $HOME/.xmodmap
7 12
 
8 13
 # Set the background color<
9
- 
14
+
10 15
 xsetroot -solid black
11 16
 xsetbg $HOME/.xmonad/cheatsheet.png
12 17
 if [ -e $HOME/Pictures/backgrund.png ]; then
... ...
@@ -15,12 +20,12 @@ fi
15 20
 conky -bd
16 21
 
17 22
 xscreensaver -no-splash &
18
- 
23
+
19 24
 
20 25
 # Set up an icon tray
21 26
 trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 10 --transparent true --tint 0x000000 --height 17 &
22 27
 synergys
23
- 
28
+
24 29
 # notifications
25 30
 
26 31
 dunst &
... ...
@@ -33,21 +38,29 @@ btsync
33 38
 # notes
34 39
 
35 40
 tomboy &
36
- 
41
+
37 42
 # mixer
38 43
 
39 44
 qasmixer -t &
40 45
 
41 46
 # Fire up apps
42
- 
47
+
43 48
 
44 49
 $HOME/github_repos/shairport/shairport -a srv2 -o pulse -d | swap_variable SHAIRPORT_PID
45 50
 
46 51
 sonata --hidden &
47
- 
52
+
48 53
 if [[ -x /usr/bin/nm-applet ]] ; then
49 54
    nm-applet --sm-disable &
50 55
 fi
51
- 
52
-eval `ssh-agent`
53
-exec xmonad
56
+
57
+gnome-settings-daemon &
58
+eval `gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh`
59
+export GNOME_KEYRING_CONTROL
60
+export SSH_AUTH_SOCK
61
+export GPG_AGENT_INFO
62
+export GNOME_KEYRING_PID
63
+
64
+
65
+exec ssh-agent /home/edwlan/bin/stumpwm
66
+#exec xmonad
54 67
new file mode 100644
... ...
@@ -0,0 +1,35 @@
1
+# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration.html
2
+
3
+# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
4
+resolver: lts-4.0
5
+
6
+# Local packages, usually specified by relative directory name
7
+packages:
8
+- '.'
9
+
10
+# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
11
+extra-deps: []
12
+
13
+# Override default flag values for local packages and extra-deps
14
+flags: {}
15
+
16
+# Extra package databases containing global packages
17
+extra-package-dbs: []
18
+
19
+# Control whether we use the GHC we find on the path
20
+# system-ghc: true
21
+
22
+# Require a specific version of stack, using version ranges
23
+# require-stack-version: -any # Default
24
+# require-stack-version: >= 1.0.0
25
+
26
+# Override the architecture used by stack, especially useful on Windows
27
+# arch: i386
28
+# arch: x86_64
29
+
30
+# Extra directories used by stack for building
31
+# extra-include-dirs: [/path/to/dir]
32
+# extra-lib-dirs: [/path/to/dir]
33
+
34
+# Allow a newer minor version of GHC than the snapshot specifies
35
+# compiler-check: newer-minor
0 36
new file mode 100644
... ...
@@ -0,0 +1,41 @@
1
+name:                xmonad
2
+version:             0.1.0.0
3
+synopsis:            Initial project template from stack
4
+description:         Please see README.md
5
+homepage:            http://github.com/githubuser/xmonad#readme
6
+license:             BSD3
7
+license-file:        LICENSE
8
+author:              Author name here
9
+maintainer:          example@example.com
10
+copyright:           2016 Author Here
11
+category:            Web
12
+build-type:          Simple
13
+-- extra-source-files:
14
+cabal-version:       >=1.10
15
+
16
+library
17
+  hs-source-dirs:      src
18
+  exposed-modules:     Lib
19
+  build-depends:       base >= 4.7 && < 5
20
+  default-language:    Haskell2010
21
+
22
+executable xmonad-exe
23
+  hs-source-dirs:      app
24
+  main-is:             Main.hs
25
+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
26
+  build-depends:       base
27
+                     , xmonad
28
+  default-language:    Haskell2010
29
+
30
+test-suite xmonad-test
31
+  type:                exitcode-stdio-1.0
32
+  hs-source-dirs:      test
33
+  main-is:             Spec.hs
34
+  build-depends:       base
35
+                     , xmonad
36
+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
37
+  default-language:    Haskell2010
38
+
39
+source-repository head
40
+  type:     git
41
+  location: https://github.com/githubuser/xmonad
... ...
@@ -30,3 +30,11 @@ vman() {
30 30
   fi
31 31
 }
32 32
 
33
+tmux_ps() {
34
+  (for s in `tmux list-sessions -F '#{session_name}'` ; do
35
+    echo -e "\ntmux session name: $s\n--------------------"
36
+    for p in `tmux list-panes -s -F '#{pane_pid}' -t "$s"` ; do
37
+      pstree -p -a -A $p
38
+    done
39
+  done) | eval $PAGER
40
+}
... ...
@@ -12,8 +12,14 @@ alias html2man='2man html'
12 12
 alias md2man='2man markdown'
13 13
 alias latex2man='2man latex'
14 14
 
15
+man_fun="man -l -"
16
+_pandoc_view() {
17
+  2man $1 $2 | $man_fun
18
+}
19
+
15 20
 pandoc_view() {
16
-  2man $1 $2 | man -l -
21
+  man_fun="man -l -"
22
+  _pandoc_view $*
17 23
 }
18 24
 
19 25
 dump_html() {
... ...
@@ -24,4 +30,17 @@ dump_md() {
24 30
   pandoc_view markdown "$1"
25 31
 }
26 32
 
33
+vpandoc_view() {
34
+  man_fun=vman
35
+  _pandoc_view $*
36
+}
37
+
38
+vdump_html() {
39
+  vpandoc_view html "$1"
40
+}
41
+
42
+vdump_md() {
43
+  vpandoc_view markdown "$1"
44
+}
45
+
27 46
 
... ...
@@ -15,7 +15,8 @@ _secure_note() {
15 15
     file)
16 16
       case $words[2] in
17 17
         '-r')
18
-          pushd $HOME/Dropbox/secure_notes > /dev/null
18
+          pushd $HOME/Dropbox/secure_notes  > /dev/null
19
+          #echo *
19 20
           compadd "$@" *
20 21
           popd > /dev/null
21 22
           ;;