From bb5320b9d27b8957176790bfbae6b1390403fe4c Mon Sep 17 00:00:00 2001 From: Dustin Swan Date: Wed, 16 Nov 2016 11:29:07 -0500 Subject: [PATCH] Various dotfile changes. Emacs, mail, music, etc. --- Emacs Client.scpt | Bin 0 -> 3118 bytes bitbar/mu_count.5s.js | 34 ++++++++++++++++++++++++++++++++ karabiner.json | 15 ++++++++++++++ ncmpcpp | 8 ++++++++ spacemacs | 44 +++++++++++++++++++++++++++++++----------- ssh/config | 6 +++++- symlinks.sh | 1 + vdirsyncer/config | 42 ++++++++++++++++++++-------------------- zshrc | 11 +++-------- 9 files changed, 120 insertions(+), 41 deletions(-) create mode 100644 Emacs Client.scpt create mode 100755 bitbar/mu_count.5s.js create mode 100644 ncmpcpp diff --git a/Emacs Client.scpt b/Emacs Client.scpt new file mode 100644 index 0000000000000000000000000000000000000000..a6d7241a9ba54ae50b63540551113b570fad9a06 GIT binary patch literal 3118 zcmb_e&2tn*6#va^B4m@o)gL`6hIP{D6e0Y&Bcdp(H}G_lHJx90Wh?$@v1$FE=aZa*D) zY{y>HTkT!1UkN}{y9gY(C^%%`k#`PoTz^e2nmE&p>pYS|NFJzQkzAHPJS;-tVJlX_ zVzi*>v9U`FxCyN;S}EQJ&m-Yd2L%-5ca+fXu;E|{2l1>q7??1Q517$7Fi1LJ-@HI>SUAB@M5NrPZKHCb%@@Ss1PnlXPWFn(l$C`+bIBQjHsv@zTWgUV>) zj|Y{ok!B{C3L?`OHQ88@1g4QjU77ko8{oW-C1otZDHz%jkcNo)KR|AjZNhddwvqPn z8>U1ZJ|>Y`*#V5RS7*;KAQghZ07K$>yK zX-YQi$Q0X@-!Q+Bk`>yNaMifwLpz&MI&_NR-oxAE^H-) zZ^TVW(}(L?^mRL;@}CE;Hx%{cl9oX;lT0E9U@Leo}G~aO8q=zbHCd zPt*5}U0~ zbjr8rLB(OiZ1rFlwwsv()<|u#lF2A)MEiS8n)yklshkz?qY)ENuweOl9*zF;1XeUG z)iSDhp3YraZ1kAVr7y9miR`i4PXn|VWlUINlbfghY7JV1MkpC$!XC^V5OYa4oU?xy z>u666>pc=%I6BcK-=J5%F0xrD&AoY=iDdMZSW@ZFU1i*bXQ*ih_nok1LCZ!)+qI0Q zoS7@LRnDkX4Lj{@Hd8`W>LJe6F@(KWtoTP^cI9j45$pMFkgq&!$X)10MZUyFIa_42 zkP91g7rL4DO(kqn7dDr%`C1_LtOD#S1?goaf2f_;@w*#aJQ9M7=NOPP@`Zfv$Qc#- zLdoYUxrJXp?(s-03{~2(;stS~L>~!8* zoFCwxA%=MJ^lhfUR=n3z|5!HMQW zmxqoxy>HG634cI~neETCO??}yy?o!$|967oF^-m%KjJi43>oWXYD@D=uin^n^x{*_ zz720QAG*1he)J9Q>Yq%LeuQz|5Bsq*2t%LUK%ZlkiEuLQhpO(!oF66Lw=Ms2Slca# z2U!I>u$D?|R%b0&S)0>XQ-!rTeM{lgm|X?TDJ*1<#18nU!c0Qa>2rH z6i1HePVWLmIlRDOD9cf7S%#G-pJ{_LaCqqL)6OasKhxfmD2zRUj(z%|KcfRfXD$7* W1B=#@D?Zk)cOb#hcIm{4*Zu^?zprKh literal 0 HcmV?d00001 diff --git a/bitbar/mu_count.5s.js b/bitbar/mu_count.5s.js new file mode 100755 index 0000000..9c3427f --- /dev/null +++ b/bitbar/mu_count.5s.js @@ -0,0 +1,34 @@ +#!/usr/bin/env /usr/local/bin/node +const bitbar = require('bitbar'); +const exec = require('child_process').exec; + +let cmd = `/usr/local/bin/mu find flag:unread AND NOT flag:trashed AND \\(maildir:/Fastmail/INBOX OR maildir:/IOCOM/INBOX\\) --fields \"l f s\"`; + +exec(cmd, function(error, stdout, stderr) { + + let mails = stderr.match(/no matches/) + ? [] + : stdout.trim().split("\n").map(parseMailString); + + bitbar([ + ':envelope:' + mails.length || "", + bitbar.sep, + ...mails + ]); + +}); + +function parseMailString(m) { + const MAX = 80; + + let matches = m.match(/([^\s]+)\s(.*)/); + + let filename = matches[1]; + let text = matches[2].substring(0, MAX) + (matches[2].length > MAX ? "..." : ""); + + return { + text, + bash: "/usr/local/bin/emacsclient -n " + filename, + terminal: false + } +} diff --git a/karabiner.json b/karabiner.json index 00f9a43..7b853df 100644 --- a/karabiner.json +++ b/karabiner.json @@ -1,6 +1,21 @@ { "profiles": [ { + "devices": [], + "fn_function_keys": { + "f1": "vk_consumer_brightness_down", + "f10": "mute", + "f11": "volume_down", + "f12": "volume_up", + "f2": "vk_consumer_brightness_up", + "f3": "vk_mission_control", + "f4": "vk_launchpad", + "f5": "vk_consumer_illumination_down", + "f6": "vk_consumer_illumination_up", + "f7": "vk_consumer_previous", + "f8": "vk_consumer_play", + "f9": "vk_consumer_next" + }, "name": "Default profile", "selected": true, "simple_modifications": { diff --git a/ncmpcpp b/ncmpcpp new file mode 100644 index 0000000..d2bfe6d --- /dev/null +++ b/ncmpcpp @@ -0,0 +1,8 @@ +visualizer_fifo_path = "/tmp/mpd.fifo" +visualizer_output_name = "my_fifo" +visualizer_sync_interval = "30" +visualizer_in_stereo = "yes" +#visualizer_type = "wave" (spectrum/wave) +#visualizer_type = "spectrum" (spectrum/wave) +mpd_music_dir = "/Users/dustinswan/Music" +user_interface = alternative diff --git a/spacemacs b/spacemacs index e938a17..6a860ab 100644 --- a/spacemacs +++ b/spacemacs @@ -72,7 +72,7 @@ values." emacs-lisp common-lisp scheme - (haskell :variables haskell-enable-hindent-style "fundamental") + (haskell :variables haskell-enable-hindent-style "johan-tibell" haskell-completion-backend 'intero) idris purescript elm @@ -139,7 +139,10 @@ values." ;; with `:variables' keyword (similar to layers). Check the editing styles ;; section of the documentation for details on available variables. ;; (default 'vim) - dotspacemacs-editing-style 'vim + dotspacemacs-editing-style '(hybrid :variables + hybrid-mode-enable-evilified-state t + hybrid-mode-enable-hjkl-bindings t + hybrid-mode-default-state 'normal) ;; If non nil output loading progress in `*Messages*' buffer. (default nil) dotspacemacs-verbose-loading nil ;; Specify the startup banner. Default value is `official', it displays @@ -156,7 +159,8 @@ values." ;; List sizes may be nil, in which case ;; `spacemacs-buffer-startup-lists-length' takes effect. dotspacemacs-startup-lists '((recents . 5) - (projects . 7)) + (projects . 7) + (bookmarks . 5)) ;; True if the home buffer should respond to resize events. dotspacemacs-startup-buffer-responsive t ;; Default major mode of the scratch buffer (default `text-mode') @@ -337,6 +341,8 @@ in `dotspacemacs/user-config'." This function is called at the very end of Spacemacs initialization after layers configuration. You are free to put any user code." + (spacemacs/toggle-transparency) + (spacemacs|define-custom-layout "@Mail" :binding "m" :body @@ -390,11 +396,15 @@ layers configuration. You are free to put any user code." mu4e-html2text-command "w3m -dump -T text/html" w3m-command "/usr/local/bin/w3m" + org-mu4e-link-query-in-headers-mode nil + ;; Sending Mail message-send-mail-function 'message-send-mail-with-sendmail message-sendmail-extra-arguments '("--read-envelope-from") message-sendmail-f-is-evil 't sendmail-program "/usr/local/bin/msmtp" + + mu4e-hide-index-messages 't ) (when (fboundp 'imagemagick-register-types) @@ -478,11 +488,20 @@ layers configuration. You are free to put any user code." ;; Org (with-eval-after-load 'org + (setq org-startup-indented t) + (setq org-agenda-files '("~/Sync/Notes" "~/Sync/org.org" "~/Sync/IOCOM/IOCOM.org")) (setq org-directory "~/Sync/Notes/") + ;; Capture + (setq org-capture-templates + '(("t" "TODO" entry (file+headline "~/Sync/org.org" "Inbox") + "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n") + ("i" "IOCOM TODO" entry (file+headline "~/Sync/IOCOM/IOCOM.org" "Inbox") + "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n"))) + ;; Org Journal (setq org-journal-dir "~/Sync/Notes/" org-journal-file-format "%Y%m%d.org") @@ -509,8 +528,8 @@ layers configuration. You are free to put any user code." "

Dustin Swan

-

Software Engineer at IOCOM. JavaScript, Haskell, functional programming, design, piano, motorcycles, languages, games, bikes, books, fashion, minimalism, spreadsheets, travel, etc.

-
Moriarty, NM | Chicago, IL
+

Software Engineer at IOCOM. Interested in decentralization, pure functional programming, types, math, Emacs, design, piano, motorcycles, languages, games, bikes, books, fashion, spreadsheets, travel, climbing, speedcubing, etc.

+
Troy NY
@@ -576,7 +595,7 @@ layers configuration. You are free to put any user code." ))) ) - (setq wttrin-default-cities '("Moriarty NM" "Albuquerque" "Chicago")) + (setq wttrin-default-cities '("Troy NY" "Albuquerque" "Chicago")) (setq tramp-default-method "ssh") @@ -593,11 +612,11 @@ layers configuration. You are free to put any user code." ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(ac-ispell-requires 4 t) - '(ahs-case-fold-search nil) - '(ahs-default-range (quote ahs-range-whole-buffer)) - '(ahs-idle-interval 0.25) + '(ahs-case-fold-search nil t) + '(ahs-default-range (quote ahs-range-whole-buffer) t) + '(ahs-idle-interval 0.25 t) '(ahs-idle-timer 0 t) - '(ahs-inhibit-face-list nil) + '(ahs-inhibit-face-list nil t) '(erc-modules (quote (autoaway button completion list match move-to-prompt netsplit networks notify notifications readonly scrolltobottom services smiley spelling track completion autoaway autojoin button log match menu move-to-prompt netsplit notify notifications readonly ring scrolltobottom spelling track image hl-nicks networks services))) @@ -606,8 +625,11 @@ layers configuration. You are free to put any user code." '(mac-auto-operator-composition-mode t) '(org-journal-date-format "%A, %B %d, %Y") '(org-journal-time-format "%R %Z") + '(package-selected-packages + (quote + (auctex counsel smartparens go-mode haskell-mode flycheck magit with-editor yasnippet rake company ivy helm helm-core xterm-color auctex-latexmk yapfify yaml-mode xkcd wttrin ws-butler writeroom-mode wolfram-mode window-numbering which-key wgrep web-mode web-beautify volatile-highlights vi-tilde-fringe vdirel uuidgen use-package typit twittering-mode tumblesocks toml-mode toc-org thrift tagedit stan-mode spray spotify spacemacs-theme spaceline smex smeargle slime-company slim-mode shell-pop scss-mode scad-mode sass-mode rvm ruby-tools ruby-test-mode rubocop rspec-mode robe reveal-in-osx-finder restclient restart-emacs request rbenv ranger rainbow-mode rainbow-identifiers rainbow-delimiters racer quelpa qml-mode pyvenv pytest pyenv-mode py-isort pug-mode psci psc-ide projectile-rails popwin pip-requirements phpunit phpcbf php-extras php-auto-yasnippets persp-mode pbcopy paradox pandoc-mode pacmacs p4 ox-pandoc ox-gfm osx-trash osx-dictionary orgit org-projectile org-present org-pomodoro org-plus-contrib org-journal org-download org-bullets open-junk-file ob-http neotree mwim multi-term mu4e-maildirs-extension mu4e-alert move-text monokai-theme mmm-mode minitest mingus matlab-mode markdown-toc magit-gitflow magit-gh-pulls lorem-ipsum livid-mode live-py-mode linum-relative link-hint less-css-mode ledger-mode launchctl julia-mode json-mode js2-refactor js-doc ivy-hydra intero insert-shebang info+ indent-guide idris-mode ido-vertical-mode hy-mode hungry-delete hlint-refactor hl-todo hindent highlight-parentheses highlight-numbers highlight-indentation hide-comnt help-fns+ helm-make haskell-snippets hackernews google-translate golden-ratio go-guru go-eldoc gnuplot gitignore-mode github-search github-clone github-browse-file gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe git-gutter-fringe+ gist gh-md geiser flyspell-correct-ivy flycheck-rust flycheck-pos-tip flycheck-ledger flycheck-haskell flycheck-elm flx-ido fish-mode fill-column-indicator feature-mode fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-snipe evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-magit evil-lisp-state evil-indent-plus evil-iedit-state evil-exchange evil-escape evil-ediff evil-args evil-anzu eval-sexp-fu eshell-z eshell-prompt-extras esh-help erc-yt erc-view-log erc-terminal-notifier erc-social-graph erc-image erc-hl-nicks engine-mode emoji-cheat-sheet-plus emmet-mode elm-mode elisp-slime-nav dumb-jump drupal-mode disaster diff-hl deft cython-mode counsel-projectile company-web company-tern company-statistics company-shell company-go company-ghci company-ghc company-emoji company-cabal company-c-headers company-auctex company-anaconda common-lisp-snippets column-enforce-mode color-identifiers-mode coffee-mode cmm-mode cmake-mode clean-aindent-mode clang-format chruby chess cargo bundler bracketed-paste beacon auto-yasnippet auto-highlight-symbol auto-dictionary auto-compile arduino-mode aggressive-indent adaptive-wrap ace-window ace-link ac-ispell 2048-game))) '(paradox-github-token t) - '(ring-bell-function (quote ignore) t)) + '(ring-bell-function (quote ignore))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/ssh/config b/ssh/config index 4bf5ed3..8bd7e48 100644 --- a/ssh/config +++ b/ssh/config @@ -1,3 +1,7 @@ Host dswan - HostName dswan.insors.net + HostName dswan.iocom.com + User root + +Host dustinswan + HostName dustinswan.com User dustinswan diff --git a/symlinks.sh b/symlinks.sh index 2851dd0..4e98af5 100644 --- a/symlinks.sh +++ b/symlinks.sh @@ -21,6 +21,7 @@ rm ~/.muttrc; ln -s ~/dotfiles/muttrc ~/.muttrc # mac only rm ~/Library/KeyBindings/DefaultKeyBinding.dict; cp ~/dotfiles/DefaultKeyBinding.dict ~/Library/KeyBindings/DefaultKeyBinding.dict rm ~/.karabiner.d/configuration/karabiner.json; ln -s ~/dotfiles/karabiner.json ~/.karabiner.d/configuration/karabiner.json +touch ~/.hushlogin # linux only rm -rf ~/.i3; mkdir ~/.i3; ln -s ~/dotfiles/i3/config ~/.i3/config diff --git a/vdirsyncer/config b/vdirsyncer/config index 473700e..bc2df2f 100644 --- a/vdirsyncer/config +++ b/vdirsyncer/config @@ -1,39 +1,39 @@ [general] -status_path = ~/.vdirsyncer/status/ +status_path = "~/.vdirsyncer/status/" [pair fastmail_contacts] -a = fastmail_contacts_local -b = fastmail_contacts_remote +a = "fastmail_contacts_local" +b = "fastmail_contacts_remote" collections = ["from b"] -conflict_resolution = b wins +conflict_resolution = "b wins" [storage fastmail_contacts_local] -type = filesystem -path = ~/Contacts/ -fileext = .vcf +type = "filesystem" +path = "~/Contacts/" +fileext = ".vcf" [storage fastmail_contacts_remote] -type = carddav -url = https://carddav.messagingengine.com -auth = basic -username = dustinswan@fastmail.com +type = "carddav" +url = "https://carddav.messagingengine.com" +auth = "basic" +username = "dustinswan@fastmail.com" password.fetch = ["command", "~/dotfiles/bin/decrypt_password.sh", "dustinswan@fastmail.com"] [pair fastmail_calendar] -a = fastmail_calendar_local -b = fastmail_calendar_remote +a = "fastmail_calendar_local" +b = "fastmail_calendar_remote" collections = ["from b"] -conflict_resolution = b wins +conflict_resolution = "b wins" metadata = ["color", "displayname"] [storage fastmail_calendar_local] -type = filesystem -path = ~/Calendars/ -fileext = .ics +type = "filesystem" +path = "~/Calendars/" +fileext = ".ics" [storage fastmail_calendar_remote] -type = caldav -url = https://caldav.messagingengine.com/ -auth = basic -username = dustinswan@fastmail.com +type = "caldav" +url = "https://caldav.messagingengine.com/" +auth = "basic" +username = "dustinswan@fastmail.com" password.fetch = ["command", "~/dotfiles/bin/decrypt_password.sh", "dustinswan@fastmail.com"] diff --git a/zshrc b/zshrc index c0b5843..eba782f 100644 --- a/zshrc +++ b/zshrc @@ -18,18 +18,13 @@ alias vi=nvim alias vim=nvim alias l="ls -la" alias ta="tmux attach -d" -alias dustinswan="ssh dustinswan@dustinswan.com" -alias kill_offlineimap="ps aux | grep offlineimap | awk '{ print $2 }' | xargs kill -9" alias e='emacsclient -a "" -t -nw' alias weather='curl http://wttr.in' export EDITOR=nvim -export MOSH_TITLE_NOPREFIX=1 - export BROWSER=open # IOCOM stuff -alias dswan="ssh root@dswan.iocom.com" export P4USER=dswan export P4PORT="humu.iocom.com:1666" export P4CONFIG=p4.cfg @@ -40,7 +35,6 @@ alias er='rm -rf logs; unzip -o' export PATH=$HOME/.local/bin:$PATH # Stack export PATH=$HOME/dotfiles/bin:$PATH export PATH=$HOME/.npm-packages/bin:$PATH -# export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages # nix if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi @@ -51,10 +45,11 @@ if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc # export SSL_CERT_FILE=${OPENSSL_X509_CERT_FILE} # Keychain -eval `keychain --eval id_rsa` +export GPG_AGENT_INFO="~/.gnupg/S.gpg-agent:$(pgrep gpg-agent):1" # Take this out when keychain fixes this bug +eval `keychain --eval --inherit any --agents gpg,ssh --quiet id_rsa 2B3A6377` # Homebrew Github Token -export HOMEBREW_GITHUB_API_TOKEN=`gpg -d ~/.homebrew@github-password.gpg` +alias brew='[[ $HOMEBREW_GITHUB_API_TOKEN ]] || export HOMEBREW_GITHUB_API_TOKEN=`gpg -d ~/.homebrew@github-password.gpg`; brew' # Heroku Toolbelt export PATH="/usr/local/heroku/bin:$PATH"