Cleaning up dotfiles

master
Dustin Swan 9 years ago
parent 386330f1a5
commit 47c4b01d5a

@ -1,371 +0,0 @@
#!/usr/bin/perl
use strict;
use utf8;
use Getopt::Long;
use Pod::Usage;
use Data::Dumper;
binmode(STDOUT, ":utf8");
#command line options
my ( $help, $period, $author, $filepath );
GetOptions(
'help|?' => \$help,
'period|p=n' => \$period,
'author=s' => \$author,
) or pod2usage(2);
pod2usage(1) if $help;
$filepath = shift @ARGV;
# also tried to use unicode chars instead of colors, the exp did not go well
#qw(⬚ ⬜ ▤ ▣ ⬛)
#qw(⬚ ▢ ▤ ▣ ⬛)
my @colors = ( 237, 157, 155, 47, 2 );
my @months = qw (Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
process();
# 53 X 7 grid
# consists of 0 - 370 blocks
my ( @grid, @timeline, %pos_month, %month_pos, $jan1, $cur_year, $max_epoch, $min_epoch, $max_commits, $q1, $q2, $q3 );
my ( $first_block, $last_block, $start_block, $end_block, $row_start, $row_end );
my ( $total_commits, $max_streak, $cur_streak, $max_streak_weekdays, $cur_streak_weekdays );
my ( $cur_start, $max_start, $max_end, $cur_weekdays_start, $max_weekdays_start, $max_weekdays_end );
#loads of global variables
sub process {
#try to exit gracefully when the terminal doesn't support enough colors
no warnings; #dont warn if tput command fails
my $colors_supported = qx/tput colors/;
if ($colors_supported && $colors_supported < 256) {
chomp $colors_supported;
print "fatal: 'tput colors' returned < 256 (" . $colors_supported . ") , cannot plot the calendar as the terminal doesn't support enough colors\n"; #will try to hack around this soon
exit(1);
}
init_cal_stuff();
my $extra_args = "";
$extra_args = " --author=" . $author if $author;
if ($filepath) {
if ( -e $filepath ) {
$extra_args .= " -- " . $filepath;
}
else {
print "fatal: $filepath do not exists\n";
exit(2);
}
}
my $git_command = "git log --pretty=format:\"%at\" --since=\"13 months\"" . $extra_args; #commits might not be in strict time order, check some past too
my $epochs = qx/$git_command/;
if ($?) {
print "fatal: git-cal failed to get the git log\n";
exit(2);
}
my @epochs = split /\n/, $epochs;
if (! @epochs) {
print "git-cal: got empty log, nothing to do\n";
exit(1);
}
my $status;
foreach (@epochs) {
$status = add_epoch($_);
last if !$status;
}
compute_stats();
print_grid();
}
sub init_cal_stuff {
my ( $wday, $yday, $month, $year ) = ( localtime(time) )[ 6, 7, 4, 5 ];
$cur_year = $year;
$jan1 = 370 - ( $yday + 6 - $wday );
$last_block = $jan1 + $yday + 1;
$first_block = $last_block - 365;
$max_commits = 0;
push @timeline, $jan1;
$month_pos{0} = $jan1;
my $cur = $jan1;
foreach ( 0 .. $month - 1 ) {
$cur += number_of_days( $_, $year );
push @timeline, $cur;
$month_pos{ $_ + 1 } = $cur;
}
$cur = $jan1;
for ( my $m = 11; $m > $month; $m-- ) {
$cur -= number_of_days( $m, $year - 1 );
unshift @timeline, $cur;
$month_pos{$m} = $cur;
}
$pos_month{ $month_pos{$_} } = $months[$_] foreach keys %month_pos;
die "period can only be between -11 to -1 and 1 to 12" if ( defined $period && ( $period < -11 || $period > 12 || $period == 0 ) );
$period = 0 if !defined $period;
if ( $period == 0 ) {
$start_block = $first_block;
$end_block = $last_block;
}
elsif ( $period > 0 ) {
$start_block = $month_pos{ $period - 1 };
$end_block = $month_pos{ $period % 12 };
$end_block = $last_block if $start_block > $end_block;
}
else {
$start_block = $timeline[ 11 + $period ];
$start_block = $first_block if $period == -12;
$end_block = $last_block;
}
$row_start = int $start_block / 7;
$row_end = int $end_block / 7;
$max_epoch = time - 86400 * ( $last_block - $end_block );
$min_epoch = time - 86400 * ( $last_block - $start_block );
( $total_commits, $max_streak, $cur_streak, $max_streak_weekdays, $cur_streak_weekdays ) = (0) x 5;
( $cur_start, $max_start, $max_end, $cur_weekdays_start, $max_weekdays_start, $max_weekdays_end ) = (0) x 6;
}
sub add_epoch {
my $epoch = shift;
if ( $epoch > $max_epoch || $epoch < $min_epoch ) {
return 1;
}
my ( $month, $year, $wday, $yday ) = ( localtime($epoch) )[ 4, 5, 6, 7 ];
my $pos;
if ( $year == $cur_year ) {
$pos = ( $jan1 + $yday );
}
else {
my $total = ( $year % 4 ) ? 365 : 366;
$pos = ( $jan1 - ( $total - $yday ) );
}
return 0 if $pos < 0; #just in case
add_to_grid( $pos, $epoch );
return 1;
}
sub add_to_grid {
my ( $pos, $epoch ) = @_;
my $r = int $pos / 7;
my $c = $pos % 7;
$grid[$r][$c]->{commits}++;
$grid[$r][$c]->{epoch} = $epoch;
$max_commits = $grid[$r][$c]->{commits} if $grid[$r][$c]->{commits} > $max_commits;
}
sub compute_stats {
my %commit_counts;
foreach my $r ( $row_start .. $row_end ) {
foreach my $c ( 0 .. 6 ) {
my $cur_block = ( $r * 7 ) + $c;
if ( $cur_block >= $start_block && $cur_block < $end_block ) {
my $count = $grid[$r][$c]->{commits} || 0;
$total_commits += $count;
if ($count) {
$commit_counts{$count} = 1;
$cur_streak++;
$cur_start = $grid[$r][$c]->{epoch} if $cur_start == 0;
if ( $cur_streak > $max_streak ) {
$max_streak = $cur_streak;
$max_start = $cur_start;
$max_end = $grid[$r][$c]->{epoch};
}
#count++ if you work on weekends and streak will not be broken otherwise :)
$cur_streak_weekdays++;
$cur_weekdays_start = $grid[$r][$c]->{epoch} if $cur_weekdays_start == 0;
if ( $cur_streak_weekdays > $max_streak_weekdays ) {
$max_streak_weekdays = $cur_streak_weekdays;
$max_weekdays_start = $cur_weekdays_start;
$max_weekdays_end = $grid[$r][$c]->{epoch};
}
}
else {
$cur_streak = 0;
$cur_start = 0;
if ( $c > 0 && $c < 6 ) {
$cur_streak_weekdays = 0;
$cur_weekdays_start = 0;
}
}
}
}
}
#now compute quartiles
my @commit_counts = sort { $a <=> $b } ( keys %commit_counts );
$q1 = $commit_counts[ int( scalar @commit_counts ) / 4 ];
$q2 = $commit_counts[ int( scalar @commit_counts ) / 2 ];
$q3 = $commit_counts[ int( 3 * ( scalar @commit_counts ) / 4 ) ];
#print "commit counts: " . (scalar @commit_counts) . " - " . (join ",",@commit_counts) . "\n\n";
#print "quartiles: $q1 $q2 $q3\n";
}
sub print_grid {
my $space = 6;
print_month_names($space);
foreach my $c ( 0 .. 6 ) {
printf "\n%" . ( $space - 2 ) . "s", "";
if ( $c == 1 ) {
print "M ";
}
elsif ( $c == 3 ) {
print "W ";
}
elsif ( $c == 5 ) {
print "F ";
}
else {
print " ";
}
foreach my $r ( $row_start .. $row_end ) {
my $cur_block = ( $r * 7 ) + $c;
if ( $cur_block >= $start_block && $cur_block < $end_block ) {
my $val = $grid[$r][$c]->{commits} || 0;
my $index = 0;
#$index = ( int( ( $val - 4 ) / $divide ) ) + 1 if $val > 0; #too dumb and bad
if ($val) {
if ( $val <= $q1 ) {
$index = 1;
}
elsif ( $val <= $q2 ) {
$index = 2;
}
elsif ( $val <= $q3 ) {
$index = 3;
}
else {
$index = 4;
}
}
print_block($index);
}
else {
print " ";
}
}
}
print "\n\n";
printf "%" . ( 2 * ( $row_end - $row_start ) + $space - 10 ) . "s", "Less "; #such that the right borders align
print_block($_) foreach ( 0 .. 4 );
print " More\n";
printf "%4d: Total commits\n", $total_commits;
print_message( $max_streak_weekdays, $max_weekdays_start, $max_weekdays_end, "Longest streak excluding weekends" );
print_message( $max_streak, $max_start, $max_end, "Longest streak including weekends" );
print_message( $cur_streak_weekdays, $cur_weekdays_start, time, "Current streak" );
}
sub print_block {
my $index = shift;
$index = 4 if $index > 4;
my $c = $colors[$index];
#always show on a black background, else it looks different (sometimes really bad ) with different settings.
#print "\e[40;38;5;${c}m⬛ \e[0m";
print "\e[40;38;5;${c}m\x{25fc} \e[0m";
}
sub print_month_names {
#print month labels, printing current month in the right position is tricky
my $space = shift;
if ( defined $period && $period > 0 ) {
printf "%" . $space . "s %3s", "", $months[ $period - 1 ];
return;
}
my $label_printer = 0;
my $timeline_iter = 11 + ( $period || -11 );
if ( $start_block == $first_block && $timeline[0] != 0 ) {
my $first_pos = int $timeline[0] / 7;
if ( $first_pos == 0 ) {
printf "%" . ( $space - 2 ) . "s", "";
print $pos_month{ $timeline[-1] } . " ";
print $pos_month{ $timeline[0] } . " ";
$timeline_iter++;
}
elsif ( $first_pos == 1 ) {
printf "%" . ( $space - 2 ) . "s", "";
print $pos_month{ $timeline[-1] } . " ";
}
else {
printf "%" . $space . "s", "";
printf "%-" . ( 2 * $first_pos ) . "s", $pos_month{ $timeline[-1] };
}
$label_printer = $first_pos;
}
else {
printf "%" . $space . "s", "";
$label_printer += ( int $start_block / 7 );
}
while ( $label_printer < $end_block / 7 && $timeline_iter <= $#timeline ) {
while ( ( int $timeline[$timeline_iter] / 7 ) != $label_printer ) { print " "; $label_printer++; }
print " " . $pos_month{ $timeline[$timeline_iter] } . " ";
$label_printer += 3;
$timeline_iter++;
}
}
sub print_message {
my ( $days, $start_epoch, $end_epoch, $message ) = @_;
if ($days) {
my @range;
foreach my $epoch ( $start_epoch, $end_epoch ) {
my ( $mday, $mon, $year ) = ( localtime($epoch) )[ 3, 4, 5 ];
my $s = sprintf( "%3s %2d %4d", $months[$mon], $mday, ( 1900 + $year ) );
push @range, $s;
}
printf "%4d: Days ( %-25s ) - %-40s\n", $days, ( join " - ", @range ), $message;
}
else {
printf "%4d: Days - %-40s\n", $days, $message;
}
}
sub number_of_days {
my ( $month, $year ) = @_;
return 30 if $month == 3 || $month == 5 || $month == 8 || $month == 10;
return 31 if $month != 1;
return 28 if $year % 4;
return 29;
}
__END__
=head1 NAME
git-cal - A simple tool to view commits calendar (similar to github contributions calendar) on command line
=head1 SYNOPSIS
"git-cal" is a tool to visualize the git commit history in github's contribution calendar style.
The calendar shows how frequently the commits are made over the past year or some choosen period
git-cal
git-cal --author=<author> -- <filepath>
=head2 OPTIONS
--author view commits of a particular author (passed to git log --author= )
--period|p Do not show the entire year, p=1 to 12 shows only one month (1 = Jan .. 12 = Dec), p=-1 to -11 shows last p months and the current month
--help|? help me
=head2 ADDITIONAL OPTIONS
-- filename to view the logs of a particular file or directory
=head1 AUTHOR
Karthik katooru <karthikkatooru@gmail.com>
=head1 COPYRIGHT AND LICENSE
This program is free software; you can redistribute it and/or modify it under the MIT License

@ -1,230 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf8 -*-
##############################
# ____ ___ ____ ______ #
# | \ / _] / T| T #
# | o )/ [_ Y o || | #
# | _/Y _]| |l_j l_j #
# | | | [_ | _ | | | #
# | | | T| | | | | #
# l__j l_____jl__j__j l__j #
# #
##### #####
# Repeat commands! #
##################
import errno, os, subprocess, sys, time
from optparse import OptionParser
interval = 1.0
command = 'true'
clear = True
get_paths = lambda: set()
verbose = True
dynamic = False
paths_command = None
USAGE = """\
usage: %prog [options] COMMAND
COMMAND should be given as a single argument using a shell string.
A list of paths to watch should be piped in on standard input.
For example:
find . | peat './test.sh'
find . -name '*.py' | peat 'rm *.pyc'
find . -name '*.py' -print0 | peat -0 'rm *.pyc'
If --dynamic is given, a command to generate the list should be piped in
on standard input instead. It will be used to generate the list of files
to check before each run.
This command must be quoted properly, and this can be tricky. Make sure
you know what you're doing.
For example:
echo find . | peat --dynamic './test.sh'
echo find . -name '*.py' | peat --dynamic 'rm *.pyc'
"""
def log(s):
if verbose:
print s
def die(s):
sys.stderr.write('ERROR: ' + s + '\n')
sys.exit(1)
def check(paths):
cutoff = int(time.time() - interval)
for p in paths:
try:
if os.stat(p).st_mtime >= cutoff:
return True
except OSError, e:
# If the file has been deleted since we started watching, don't
# worry about it.
if e.errno == errno.ENOENT:
pass
else:
raise
return False
def run():
log("running: " + command)
subprocess.call(command, shell=True)
def build_option_parser():
p = OptionParser(USAGE)
# Main options
p.add_option('-i', '--interval', default=None,
help='interval between checks in milliseconds',
metavar='N')
p.add_option('-I', '--smart-interval', dest='interval',
action='store_const', const=None,
help='determine the interval based on number of files watched (default)')
p.add_option('-d', '--dynamic', default=False,
action='store_true',
help='take a command on standard input to generate the list of files to watch')
p.add_option('-D', '--no-dynamic', dest='dynamic',
action='store_false',
help='take a list of files to watch on standard in (default)')
p.add_option('-c', '--clear', default=True,
action='store_true', dest='clear',
help='clear screen before runs (default)')
p.add_option('-C', '--no-clear',
action='store_false', dest='clear',
help="don't clear screen before runs")
p.add_option('-v', '--verbose', default=True,
action='store_true', dest='verbose',
help='show extra logging output (default)')
p.add_option('-q', '--quiet',
action='store_false', dest='verbose',
help="don't show extra logging output")
p.add_option('-w', '--whitespace', default=None,
action='store_const', dest='sep', const=None,
help="assume paths on stdin are separated by whitespace (default)")
p.add_option('-n', '--newlines',
action='store_const', dest='sep', const='\n',
help="assume paths on stdin are separated by newlines")
p.add_option('-s', '--spaces',
action='store_const', dest='sep', const=' ',
help="assume paths on stdin are separated by spaces")
p.add_option('-0', '--zero',
action='store_const', dest='sep', const='\0',
help="assume paths on stdin are separated by null bytes")
return p
def _main():
if dynamic:
log("Running the following command to generate watch list:")
log(' ' + paths_command)
log('')
log("Watching the following paths:")
for p in get_paths():
log(' ' + p)
log('')
log('Checking for changes every %d milliseconds.' % int(interval * 1000))
log('')
run()
while True:
time.sleep(interval)
if check(get_paths()):
if clear:
subprocess.check_call('clear')
run()
def smart_interval(count):
"""Return the smart interval to use in milliseconds."""
if count >= 50:
return 1000
else:
sq = lambda n: n * n
return int(1000 * (1 - (sq(50.0 - count) / sq(50))))
def _parse_interval(options):
global get_paths
if options.interval:
i = int(options.interval)
elif options.dynamic:
i = 1000
else:
i = smart_interval(len(get_paths()))
return i / 1000.0
def _parse_paths(sep, data):
if not sep:
paths = data.split()
else:
paths = data.split(sep)
paths = [p.rstrip('\n') for p in paths if p]
paths = map(os.path.abspath, paths)
paths = set(paths)
return paths
def main():
global interval, command, clear, get_paths, verbose, dynamic, paths_command
(options, args) = build_option_parser().parse_args()
if len(args) != 1:
die("exactly one command must be given")
command = args[0]
clear = options.clear
verbose = options.verbose
sep = options.sep
dynamic = options.dynamic
if dynamic:
paths_command = sys.stdin.read().rstrip()
if not paths_command:
die("no command to generate watch list was given on standard input")
def _get_paths():
data = subprocess.check_output(paths_command, shell=True)
return _parse_paths(sep, data)
get_paths = _get_paths
else:
data = sys.stdin.read()
paths = _parse_paths(sep, data)
if not paths:
die("no paths to watch were given on standard input")
for path in paths:
if not os.path.exists(path):
die('path to watch does not exist: ' + repr(path))
get_paths = lambda: paths
interval = _parse_interval(options)
_main()
if __name__ == '__main__':
import signal
def sigint_handler(signal, frame):
sys.stdout.write('\n')
sys.exit(130)
signal.signal(signal.SIGINT, sigint_handler)
main()

@ -1,2 +0,0 @@
#!/bin/bash
offlineimap -q; notmuch new

@ -1,240 +0,0 @@
;;; mu4e-multi.el --- Multiple account facilities for mu4e
;; Copyright (C) 2013 Free Software Foundation, Inc.
;; Authors: Fabián Ezequiel Gallina <fgallina@gnu.org>
;; This file is NOT part of mu4e.
;; mu4e-multi.el is free software; you can redistribute it
;; and/or modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3, or
;; (at your option) any later version.
;; mu4e-multi.el is distributed in the hope that it will be
;; useful, but WITHOUT ANY WARRANTY; without even the implied warranty
;; of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with mu4e-multi.el; see the file COPYING. If not,
;; write to the Free Software Foundation, Inc., 51 Franklin St, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;; Commentary:
;; See the README.md file for details on how to install and use this
;; package.
;;; Code:
(require 'cl-lib)
(require 'message)
(require 'mu4e-actions)
(require 'mu4e-headers)
(require 'thingatpt)
(defvar mu4e-multi-last-read-account ""
"Holds the last selected account from minibuffer.
This is just for `mu4e-multi-minibuffer-read-account' to prompt
always the latest used account as default.")
(defvar mu4e-multi-account-alist nil
"Alist containing all information of email accounts.
Here's an example for two accounts:
'((\"account-1\"
(user-mail-address . \"user1@server.com\")
(mu4e-sent-folder . \"/account-1/Sent Mail\")
(mu4e-drafts-folder . \"/account-1/Drafts\")
(mu4e-refile-folder . \"/account-1/Archive\")
(mu4e-trash-folder . \"/account-1/Trash\"))
(\"account-2\"
(user-mail-address . \"user2@server.com\")
(mu4e-sent-folder . \"/account-2/Sent Mail\")
(mu4e-drafts-folder . \"/account-2/Drafts\")
(mu4e-refile-folder . \"/account-2/Archive\")
(mu4e-trash-folder . \"/account-2/Trash\")))
The names \"account-1\" and \"account-2\" are used as identifiers
to access an account's data. IMPORTANT: maildirs must match
their prefix with the identifier given, as in the example
above.")
(defvar mu4e-multi-standard-folders '(mu4e-drafts-folder
mu4e-refile-folder
mu4e-sent-folder
mu4e-trash-folder)
"List of standard mu4e folders.")
(defun mu4e-multi-account-name-list (&optional account-alist)
"Return account names from ACCOUNT-ALIST.
When ACCOUNT-ALIST is nil, the value of
`mu4e-multi-account-alist' is used."
(mapcar #'car (or account-alist mu4e-multi-account-alist)))
(defun mu4e-multi-minibuffer-read-account ()
"Read account name from minibuffer."
(let ((account-list (mu4e-multi-account-name-list)))
(setq
mu4e-multi-last-read-account
(completing-read
(format "Compose with account: (%s) "
(mapconcat
#'(lambda (acc)
(if (string= acc mu4e-multi-last-read-account)
(format "[%s]" acc)
acc))
account-list "/"))
account-list nil t nil nil mu4e-multi-last-read-account))))
(defun mu4e-multi-get-msg-account (msg &optional account)
"Get account from MSG.
If no account can be found from MSG then use ACCOUNT as default."
(let ((maildir (when msg (mu4e-msg-field msg :maildir)))
(account-list (mu4e-multi-account-name-list)))
(cond ((and maildir
(string-match
(concat
"/\\("
(regexp-opt account-list)
"\\)/?")
maildir))
(match-string-no-properties 1 maildir))
((and account (car (member account account-list)))))))
(defun mu4e-multi-set-folder (folder msg)
"Set FOLDER using MSG as detection element."
(let ((varval (assoc
folder
(cdr
(assoc (or (mu4e-multi-get-msg-account msg)
mu4e-multi-last-read-account)
mu4e-multi-account-alist)))))
(if varval
(set (make-local-variable folder) (cdr varval))
(mu4e-error "Cannot set folder %s, account for MSG %s not detected"
folder msg))))
(defmacro mu4e-multi-make-set-folder-fn (folder)
"Make a setter for FOLDER.
This is just a wrapper over `mu4e-multi-set-folder' and can be
used to set you mu4e-*-folder vars. Example:
(setq mu4e-sent-folder
(mu4e-multi-make-folder-fn mu4e-sent-folder))
Normally used to set `mu4e-sent-folder', `mu4e-drafts-folder',
`mu4e-trash-folder' and `mu4e-refile-folder'."
`(apply-partially #'mu4e-multi-set-folder ',folder))
(defmacro mu4e-multi-make-mark-for-command (folder)
"Generate command to mark current message to move to FOLDER.
The command is named after the prefix \"mu4e-multi-mark-for-\"
and what's in between of \"mu4e-\" and \"-folder\" parts of the
FOLDER symbol. Here's an example on how to use this:
(mu4e-multi-make-mark-for-command mu4e-hold-folder)
(define-key 'mu4e-headers-mode-map \"h\" 'mu4e-multi-mark-for-hold)
OR:
(define-key 'mu4e-headers-mode-map \"h\"
(mu4e-multi-make-mark-for-command mu4e-hold-folder))"
(let ((name (mapconcat
'identity
(butlast
(cdr (split-string
(symbol-name folder) "-")))
"-")))
`(defun ,(intern (format "mu4e-multi-mark-for-%s" name)) ()
,(format "Mark message to be moved to `%s'." ',folder)
(interactive)
(mu4e-mark-set
'move
(cdr (assoc ',folder
(cdr (assoc (mu4e-multi-get-msg-account
(mu4e-message-at-point))
mu4e-multi-account-alist)))))
(mu4e-headers-next))))
(defun mu4e-multi-compose-set-account (&optional account)
"Set the ACCOUNT for composing.
With Optional Argument ACCOUNT, set all variables for that given
identifier, else it tries to retrieve the message in context and
detect ACCOUNT from it."
(interactive)
(let* ((msg (or mu4e-compose-parent-message
(ignore-errors (mu4e-message-at-point))))
(account (or account
(mu4e-multi-get-msg-account msg)))
(account-vars (cdr (assoc account mu4e-multi-account-alist))))
(when account-vars
(mapc #'(lambda (var)
(set (make-local-variable (car var)) (cdr var)))
account-vars))
(when (memq major-mode '(mu4e-compose-mode message-mode))
(message-remove-header "from")
(message-add-header (format "From: %s\n" (message-make-from)))
(message "Using account %s" account))))
;;;###autoload
(defun mu4e-multi-compose-new ()
"Start writing a new message.
This is a simple wrapper over `mu4e-compose-new' that asks for an
account to be used to compose the new message."
(interactive)
(let ((account (mu4e-multi-minibuffer-read-account)))
(mu4e-compose-new)
(mu4e-multi-compose-set-account account)))
(defun mu4e-multi-smtpmail-set-msmtp-account ()
"Set the account for msmtp.
This function is intended to added in the
`message-send-mail-hook'. Searches for the account in the
`mu4e-multi-account-alist' variable by matching the email given
in the \"from\" field. Note that all msmtp accounts should
defined in the ~/.msmtprc file and names should be matching the
keys of the `mu4e-multi-account-alist'."
(setq message-sendmail-extra-arguments
(list
"-a"
(catch 'exit
(let* ((from (message-fetch-field "from"))
(email (and from
(string-match thing-at-point-email-regexp from)
(match-string-no-properties 0 from))))
(if email
(cl-dolist (alist mu4e-multi-account-alist)
(when (string= email (cdr (assoc 'user-mail-address (cdr alist))))
(throw 'exit (car alist))))
(catch 'exit (mu4e-multi-minibuffer-read-account))))))))
(defun mu4e-multi-enable ()
"Enable mu4e multiple account setup."
(setq mu4e-sent-folder (mu4e-multi-make-set-folder-fn mu4e-sent-folder)
mu4e-drafts-folder (mu4e-multi-make-set-folder-fn mu4e-drafts-folder)
mu4e-trash-folder (mu4e-multi-make-set-folder-fn mu4e-trash-folder)
mu4e-refile-folder (mu4e-multi-make-set-folder-fn mu4e-refile-folder))
(add-hook 'message-mode-hook 'mu4e-multi-compose-set-account))
(defun mu4e-multi-disable ()
"Disable mu4e multiple account setup."
(cl-dolist (variable mu4e-multi-standard-folders)
(let* ((sv (get variable 'standard-value))
(origval (and (consp sv)
(condition-case nil
(eval (car sv))
(error :help-eval-error)))))
(when (not (equal (symbol-value variable) origval))
(set variable origval))))
(remove-hook 'message-mode-hook 'mu4e-multi-compose-set-account))
(provide 'mu4e-multi)
;; Local Variables:
;; coding: utf-8
;; indent-tabs-mode: nil
;; End:
;;; mu4e-multi.el ends here

694
osx

@ -1,694 +0,0 @@
#!/usr/bin/env bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
# Menu bar: hide the Time Machine, Volume, User, and Bluetooth icons
for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
defaults write "${domain}" dontAutoLoad -array \
"/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
"/System/Library/CoreServices/Menu Extras/Volume.menu" \
"/System/Library/CoreServices/Menu Extras/User.menu"
done
defaults write com.apple.systemuiserver menuExtras -array \
"/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
"/System/Library/CoreServices/Menu Extras/AirPort.menu" \
"/System/Library/CoreServices/Menu Extras/Battery.menu" \
"/System/Library/CoreServices/Menu Extras/Clock.menu"
# Set sidebar icon size to medium
# defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
# Always show scrollbars
# defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
# Possible values: `WhenScrolling`, `Automatic` and `Always`
# Disable smooth scrolling
# (Uncomment if youre on an older Mac that messes up the animation)
#defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false
# Disable opening and closing window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Display ASCII control characters using caret notation in standard text views
# Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
# Disable Resume system-wide
# defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false
# Disable automatic termination of inactive apps
# defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
# Disable the crash reporter
#defaults write com.apple.CrashReporter DialogType -string "none"
# Set Help Viewer windows to non-floating mode
defaults write com.apple.helpviewer DevMode -bool true
# Fix for the ancient UTF-8 bug in QuickLook (http://mths.be/bbo)
# Commented out, as this is known to cause problems in various Adobe apps :(
# See https://github.com/mathiasbynens/dotfiles/issues/237
#echo "0x08000100:0" > ~/.CFUserTextEncoding
# Reveal IP address, hostname, OS version, etc. when clicking the clock
# in the login window
# sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# Restart automatically if the computer freezes
systemsetup -setrestartfreeze on
# Never go into computer sleep mode
# systemsetup -setcomputersleep Off > /dev/null
# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Disable Notification Center and remove the menu bar icon
# launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null
# Disable smart quotes as theyre annoying when typing code
#defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes as theyre annoying when typing code
#defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
###############################################################################
# SSD-specific tweaks #
###############################################################################
# Disable local Time Machine snapshots
#sudo tmutil disablelocal
# Disable hibernation (speeds up entering sleep mode)
#sudo pmset -a hibernatemode 0
# Remove the sleep image file to save disk space
#sudo rm /Private/var/vm/sleepimage
# Create a zero-byte file instead…
#sudo touch /Private/var/vm/sleepimage
# …and make sure it cant be rewritten
#sudo chflags uchg /Private/var/vm/sleepimage
# Disable the sudden motion sensor as its not useful for SSDs
#sudo pmset -a sms 0
###############################################################################
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Trackpad: map bottom right corner to right-click
#defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
#defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
#defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
#defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
# Disable “natural” (Lion-style) scrolling
#defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Use scroll gesture with the Ctrl (^) modifier key to zoom
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Follow the keyboard focus while zoomed in
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0
# Automatically illuminate built-in MacBook keyboard in low light
defaults write com.apple.BezelServices kDim -bool true
# Turn off keyboard illumination when computer is not used for 5 minutes
defaults write com.apple.BezelServices kDimTime -int 300
# Set language and text formats
# Note: if youre in the US, replace `EUR` with `USD`, `Centimeters` with
# `Inches`, `en_GB` with `en_US`, and `true` with `false`.
#defaults write NSGlobalDomain AppleLanguages -array "en" "nl"
#defaults write NSGlobalDomain AppleLocale -string "en_GB@currency=EUR"
#defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
#defaults write NSGlobalDomain AppleMetricUnits -bool true
# Set the timezone; see `systemsetup -listtimezones` for other values
#systemsetup -settimezone "Europe/Brussels" > /dev/null
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Stop iTunes from responding to the keyboard media keys
#launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null
###############################################################################
# Screen #
###############################################################################
# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Save screenshots to the desktop
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Enable subpixel font rendering on non-Apple LCDs
defaults write NSGlobalDomain AppleFontSmoothing -int 2
# Enable HiDPI display modes (requires restart)
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
###############################################################################
# Finder #
###############################################################################
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true
# Finder: disable window animations and Get Info animations
defaults write com.apple.finder DisableAllAnimations -bool true
# Set Desktop as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
defaults write com.apple.finder NewWindowTarget -string "PfDe"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Desktop/"
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Finder: show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Finder: show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Enable spring loading for directories
defaults write NSGlobalDomain com.apple.springing.enabled -bool true
# Remove the spring loading delay for directories
defaults write NSGlobalDomain com.apple.springing.delay -float 0
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable disk image verification
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
# Automatically open a new Finder window when a volume is mounted
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
# Show item info near icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# Show item info to the right of the icons on the desktop
/usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
# Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Increase grid spacing for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
# Increase the size of icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Empty Trash securely by default
defaults write com.apple.finder EmptyTrashSecurely -bool true
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Enable the MacBook Air SuperDrive on any Mac
sudo nvram boot-args="mbasd=1"
# Show the ~/Library folder
chflags nohidden ~/Library
# Remove Dropboxs green checkmark icons in Finder
#file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns
#[ -e "${file}" ] && mv -f "${file}" "${file}.bak"
# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Privileges -bool true
###############################################################################
# Dock, Dashboard, and hot corners #
###############################################################################
# Enable highlight hover effect for the grid view of a stack (Dock)
defaults write com.apple.dock mouse-over-hilite-stack -bool true
# Set the icon size of Dock items to 36 pixels
defaults write com.apple.dock tilesize -int 36
# Minimize windows into their applications icon
defaults write com.apple.dock minimize-to-application -bool true
# Enable spring loading for all Dock items
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true
# Wipe all (default) app icons from the Dock
# This is only really useful when setting up a new Mac, or if you dont use
# the Dock to launch apps.
defaults write com.apple.dock persistent-apps -array
# Dont animate opening applications from the Dock
defaults write com.apple.dock launchanim -bool false
# Speed up Mission Control animations
defaults write com.apple.dock expose-animation-duration -float 0.1
# Dont group windows by application in Mission Control
# (i.e. use the old Exposé behavior instead)
defaults write com.apple.dock expose-group-by-app -bool false
# Disable Dashboard
defaults write com.apple.dashboard mcx-disabled -bool true
# Dont show Dashboard as a Space
defaults write com.apple.dock dashboard-in-overlay -bool true
# Dont automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false
# Remove the auto-hiding Dock delay
defaults write com.apple.dock autohide-delay -float 0
# Remove the animation when hiding/showing the Dock
defaults write com.apple.dock autohide-time-modifier -float 0
# Enable the 2D Dock
#defaults write com.apple.dock no-glass -bool true
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Reset Launchpad
find ~/Library/Application\ Support/Dock -name "*.db" -maxdepth 1 -delete
# Add iOS Simulator to Launchpad
sudo ln -sf /Applications/Xcode.app/Contents/Applications/iPhone\ Simulator.app /Applications/iOS\ Simulator.app
# Add a spacer to the left side of the Dock (where the applications are)
#defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Add a spacer to the right side of the Dock (where the Trash is)
#defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Hot corners
# Possible values:
# 0: no-op
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# 12: Notification Center
# Top left screen corner → Mission Control
#defaults write com.apple.dock wvous-tl-corner -int 2
#defaults write com.apple.dock wvous-tl-modifier -int 0
# Top right screen corner → Desktop
#defaults write com.apple.dock wvous-tr-corner -int 4
#defaults write com.apple.dock wvous-tr-modifier -int 0
# Bottom left screen corner → Start screen saver
#defaults write com.apple.dock wvous-bl-corner -int 5
#defaults write com.apple.dock wvous-bl-modifier -int 0
###############################################################################
# Safari & WebKit #
###############################################################################
# Set Safaris home page to `about:blank` for faster loading
#defaults write com.apple.Safari HomePage -string "about:blank"
# Prevent Safari from opening safe files automatically after downloading
#defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
# Allow hitting the Backspace key to go to the previous page in history
#defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
# Hide Safaris bookmarks bar by default
#defaults write com.apple.Safari ShowFavoritesBar -bool false
# Hide Safaris sidebar in Top Sites
#defaults write com.apple.Safari ShowSidebarInTopSites -bool false
# Disable Safaris thumbnail cache for History and Top Sites
#defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
# Enable Safaris debug menu
#defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Make Safaris search banners default to Contains instead of Starts With
#defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
# Remove useless icons from Safaris bookmarks bar
#defaults write com.apple.Safari ProxiesInBookmarksBar "()"
# Enable the Develop menu and the Web Inspector in Safari
#defaults write com.apple.Safari IncludeDevelopMenu -bool true
#defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
#defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
###############################################################################
# Mail #
###############################################################################
# Disable send and reply animations in Mail.app
defaults write com.apple.mail DisableReplyAnimations -bool true
defaults write com.apple.mail DisableSendAnimations -bool true
# Copy email addresses as `foo@example.com` instead of `Foo Bar <foo@example.com>` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Add the keyboard shortcut ⌘ + Enter to send an email in Mail.app
defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" -string "@\\U21a9"
# Display emails in threaded mode, sorted by date (oldest at the top)
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
# Disable inline attachments (just show the icons)
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
# Disable automatic spell checking
defaults write com.apple.mail SpellCheckingBehavior -string "NoSpellCheckingEnabled"
###############################################################################
# Spotlight #
###############################################################################
# Hide Spotlight tray-icon (and subsequent helper)
#sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
# Disable Spotlight indexing for any volume that gets mounted and has not yet
# been indexed before.
# Use `sudo mdutil -i off "/Volumes/foo"` to stop indexing any volume.
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
# Change indexing order and disable some file types
defaults write com.apple.spotlight orderedItems -array \
'{"enabled" = 1;"name" = "APPLICATIONS";}' \
'{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
'{"enabled" = 1;"name" = "DIRECTORIES";}' \
'{"enabled" = 1;"name" = "PDF";}' \
'{"enabled" = 1;"name" = "FONTS";}' \
'{"enabled" = 0;"name" = "DOCUMENTS";}' \
'{"enabled" = 0;"name" = "MESSAGES";}' \
'{"enabled" = 0;"name" = "CONTACT";}' \
'{"enabled" = 0;"name" = "EVENT_TODO";}' \
'{"enabled" = 0;"name" = "IMAGES";}' \
'{"enabled" = 0;"name" = "BOOKMARKS";}' \
'{"enabled" = 0;"name" = "MUSIC";}' \
'{"enabled" = 0;"name" = "MOVIES";}' \
'{"enabled" = 0;"name" = "PRESENTATIONS";}' \
'{"enabled" = 0;"name" = "SPREADSHEETS";}' \
'{"enabled" = 0;"name" = "SOURCE";}'
# Load new settings before rebuilding the index
killall mds > /dev/null 2>&1
# Make sure indexing is enabled for the main volume
sudo mdutil -i on / > /dev/null
# Rebuild the index from scratch
sudo mdutil -E / > /dev/null
###############################################################################
# Terminal & iTerm 2 #
###############################################################################
# Only use UTF-8 in Terminal.app
defaults write com.apple.terminal StringEncodings -array 4
# Use a modified version of the Pro theme by default in Terminal.app
#open "${HOME}/init/Mathias.terminal"
#sleep 1 # Wait a bit to make sure the theme is loaded
#defaults write com.apple.terminal "Default Window Settings" -string "Mathias"
#defaults write com.apple.terminal "Startup Window Settings" -string "Mathias"
# Enable “focus follows mouse” for Terminal.app and all X11 apps
# i.e. hover over a window and start typing in it without clicking first
#defaults write com.apple.terminal FocusFollowsMouse -bool true
#defaults write org.x.X11 wm_ffm -bool true
# Install pretty iTerm colors
#open "${HOME}/init/Mathias.itermcolors"
# Dont display the annoying prompt when quitting iTerm
#defaults write com.googlecode.iterm2 PromptOnQuit -bool false
###############################################################################
# Time Machine #
###############################################################################
# Prevent Time Machine from prompting to use new hard drives as backup volume
#defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Disable local Time Machine backups
#hash tmutil &> /dev/null && sudo tmutil disablelocal
###############################################################################
# Activity Monitor #
###############################################################################
# Show the main window when launching Activity Monitor
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
# Visualize CPU usage in the Activity Monitor Dock icon
defaults write com.apple.ActivityMonitor IconType -int 5
# Show all processes in Activity Monitor
defaults write com.apple.ActivityMonitor ShowCategory -int 0
# Sort Activity Monitor results by CPU usage
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
###############################################################################
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
###############################################################################
# Enable the debug menu in Address Book
defaults write com.apple.addressbook ABShowDebugMenu -bool true
# Enable Dashboard dev mode (allows keeping widgets on the desktop)
defaults write com.apple.dashboard devmode -bool true
# Enable the debug menu in iCal (pre-10.8)
defaults write com.apple.iCal IncludeDebugMenu -bool true
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
# Open and save files as UTF-8 in TextEdit
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
# Enable the debug menu in Disk Utility
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
defaults write com.apple.DiskUtility advanced-image-options -bool true
###############################################################################
# Mac App Store #
###############################################################################
# Enable the WebKit Developer Tools in the Mac App Store
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
# Enable Debug Menu in the Mac App Store
defaults write com.apple.appstore ShowDebugMenu -bool true
###############################################################################
# Messages #
###############################################################################
# Disable automatic emoji substitution (i.e. use plain text smileys)
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes as its annoying for messages that contain code
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
# Disable continuous spell checking
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
###############################################################################
# Google Chrome & Google Chrome Canary #
###############################################################################
# Allow installing user scripts via GitHub or Userscripts.org
defaults write com.google.Chrome ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*"
defaults write com.google.Chrome.canary ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*"
###############################################################################
# GPGMail 2 #
###############################################################################
# Disable signing emails by default
#defaults write ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault -bool false
###############################################################################
# SizeUp.app #
###############################################################################
# Start SizeUp at login
#defaults write com.irradiatedsoftware.SizeUp StartAtLogin -bool true
# Dont show the preferences window on next start
#defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false
###############################################################################
# Sublime Text #
###############################################################################
# Install Sublime Text settings
#cp -r init/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null
###############################################################################
# Transmission.app #
###############################################################################
# Use `~/Documents/Torrents` to store incomplete downloads
defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"
# Dont prompt for confirmation before downloading
defaults write org.m0k.transmission DownloadAsk -bool false
# Trash original torrent files
defaults write org.m0k.transmission DeleteOriginalTorrent -bool true
# Hide the donate message
defaults write org.m0k.transmission WarningDonate -bool false
# Hide the legal disclaimer
defaults write org.m0k.transmission WarningLegal -bool false
###############################################################################
# Twitter.app #
###############################################################################
# Disable smart quotes as its annoying for code tweets
#defaults write com.twitter.twitter-mac AutomaticQuoteSubstitutionEnabled -bool false
# Show the app window when clicking the menu bar icon
#defaults write com.twitter.twitter-mac MenuItemBehavior -int 1
# Enable the hidden Develop menu
#defaults write com.twitter.twitter-mac ShowDevelopMenu -bool true
# Open links in the background
#defaults write com.twitter.twitter-mac openLinksInBackground -bool true
# Allow closing the new tweet window by pressing `Esc`
#defaults write com.twitter.twitter-mac ESCClosesComposeWindow -bool true
# Show full names rather than Twitter handles
#defaults write com.twitter.twitter-mac ShowFullNames -bool true
# Hide the app in the background if its not the front-most window
#defaults write com.twitter.twitter-mac HideInBackground -bool true
###############################################################################
# Kill affected applications #
###############################################################################
for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "Dock" \
"Finder" "Mail" "Messages" "Safari" "SizeUp" "SystemUIServer" "Terminal" \
"Transmission" "Twitter" "iCal"; do
killall "${app}" > /dev/null 2>&1
done
echo "Done. Note that some of these changes require a logout/restart to take effect."

@ -1 +0,0 @@
ruby-2.1.3

@ -1,43 +0,0 @@
var pushLeftHalf = slate.operation("push", {
"direction" : "left",
"style" : "bar-resize:screenSizeX/2"
});
var pushLeftThird = slate.operation("push", {
"direction" : "left",
"style" : "bar-resize:2 * screenSizeX/3"
});
var pushRightHalf = slate.operation("push", {
"direction" : "right",
"style" : "bar-resize:screenSizeX/2"
});
var pushRightThird = slate.operation("push", {
"direction" : "right",
"style" : "bar-resize:screenSizeX/3"
});
var pushUpHalf = slate.operation("push", {
"direction" : "up",
"style" : "bar-resize:screenSizeY/2"
});
var pushDownHalf = slate.operation("push", {
"direction" : "down",
"style" : "bar-resize:screenSizeY/2"
});
var pushFull = slate.operation("push", {
"direction" : "up",
"style" : "bar-resize:screenSizeX"
});
slate.bind("left:ctrl,alt,cmd", pushLeftHalf);
slate.bind("left:ctrl,alt,cmd,shift", pushLeftThird);
slate.bind("right:ctrl,alt,cmd", pushRightHalf);
slate.bind("right:ctrl,alt,cmd,shift", pushRightThird);
slate.bind("up:ctrl,alt,cmd", pushUpHalf);
slate.bind("down:ctrl,alt,cmd", pushDownHalf);
slate.bind("up:shift,ctrl,alt,cmd", pushFull);

@ -46,7 +46,81 @@ values."
finance finance
dash dash
emoji emoji
(elfeed :variables rmh-elfeed-org-files (list "/Users/dustinswan/dotfiles/elfeed.org")) (elfeed :variables
elfeed-feeds '(
("http://www.autoblog.com/rss.xml" vehicles)
("http://www.bikeexif.com/feed" vehicles)
("http://silodrome.com/feed/" vehicles)
("http://prollyisnotprobably.com/atom.xml" vehicles)
("http://touringtunes.com/feed/" vehicles)
("http://www.engadget.com/rss.xml" computers)
("http://feeds.feedburner.com/arabesqueblog" computers)
("http://feeds.feedburner.com/thechangelog" computers)
("https://github.com/blog.atom" computers)
("http://www.hackerfactor.com/blog/index.php?/feeds/index.rss2" computers)
("http://www.archdaily.com/feed/" design)
("http://www.desiretoinspire.net/blog/atom.xml" design)
("http://typesetinthefuture.com/feed/" design)
("http://feeds.feedburner.com/BlessThisStuff" materialism)
("http://www.coolhunting.com/atom.xml" materialism)
("http://www.acontinuouslean.com/feed/" materialism)
("http://www.atimetoget.com/feeds/posts/default" materialism)
("http://www.carryology.com/feed/" materialism)
("http://coolmaterial.com/feed/" materialism)
("http://www.thecoolhunter.net/rss/view/latest_articles/" materialism)
("http://corkgrips.wordpress.com/feed/" materialism)
("http://everydaycarryblog.com/rss" materialism)
("http://www.everydaycommentary.com/feeds/posts/default" materialism)
("http://gearpatrol.com/blog/feed/" materialism)
("http://feeds.feedburner.com/GearCulture" materialism)
("http://www.rawrdenim.com/feed/atom/" materialism fashion)
("http://feeds.feedburner.com/selectism/rss" materialism fashion)
("http://www.hodinkee.com/blog/atom.xml" materialism fashion)
("http://feeds.feedburner.com/Huckberry" materialism fashion)
("http://www.them-thangs.com/feed/" materialism fashion)
;; ("http://feeds.feedburner.com/toolsandtoys" materialism)
("http://feeds.feedburner.com/uncrate" materialism)
("http://snyderp.tumblr.com/rss" friend blog)
("http://feeds.feedburner.com/PeterESnyder" friend blog)
("http://stumpedbymypreschooler.weebly.com/1/feed" friend blog)
("http://www.tudorsdownblog.com/feeds/posts/default" friend blog)
("http://what-if.xkcd.com/feed.atom" comic science)
("http://xkcd.com/atom.xml" comic)
("http://feeds.gawker.com/lifehacker/vip" blog)
("http://feeds.boingboing.net/boingboing/iBag" blog)
("https://medium.com/feed/editors-picks" blog)
("http://feeds.gawker.com/io9/vip" blog scifi)
("http://www.kottke.org/remainder/index.rdf" blog)
("http://feeds.laughingsquid.com/laughingsquid" blog)
("http://feeds2.feedburner.com/TheArtOfManliness" blog)
("http://feeds.feedburner.com/feedburner/oicv" blog)
("http://blag.xkcd.com/feed/" blog comic)
("http://daviddfriedman.blogspot.com/feeds/posts/default" blog politics)
("http://lesswrong.com/.rss" blog philosophy)
("http://windytan.blogspot.com/feeds/posts/default" blog)
("http://itre.cis.upenn.edu/~myl/languagelog/index.rdf" blog linguistics)
("http://robrhinehart.com/?feed=rss2" blog science)
("http://www.space.com/syn/space.xml" science space)
("http://restlesstransplant.blogspot.com/feeds/posts/default" travel fashion)
("http://feeds.feedburner.com/Departful" travel)
("http://indefinitelywild.gizmodo.com/rss" travel)
("http://feeds.feedburner.com/MagicTravelBlog" travel)
("http://marketofeden.blogspot.com/feeds/posts/default" travel)
("http://feeds.feedburner.com/MinimalStudent" travel minimalism)
("http://feeds.feedburner.com/NomadSpirit" travel)
("http://www.theanswerisalwaysyes.co/welcome?format=rss" travel)
("http://restlessglobetrotter.com/feed/" travel)
("http://feeds.feedburner.com/ThisWorldRocks" travel)
("http://touringtunes.com/feed/" travel)
("http://sailingaroundtheglobe.blogspot.com/feeds/posts/default" travel sailing)
("http://pitchfork.com/rss/reviews/best/albums/" music)
("http://pitchfork.com/rss/news/" music)
("http://www.toothpastefordinner.com/rss/rss.php" comics)
("https://groups.google.com/forum/feed/lojban/msgs/atom.xml?num=15" linguestics lojban)
("https://groups.google.com/forum/feed/lojban-beginners/msgs/atom.xml?num=15" linguestics lojban)
("http://motherboard.vice.com/rss?trk_source=motherboard" computers)
("http://feeds.feedburner.com/theatlantic/infocus" photos)
))
;; (geolocation :variables ;; (geolocation :variables
;; geolocation-enable-osx-location-service-support t ;; geolocation-enable-osx-location-service-support t
;; geolocation-enable-weather-forecast t) ;; geolocation-enable-weather-forecast t)
@ -73,14 +147,16 @@ values."
markdown markdown
yaml yaml
extra-langs extra-langs
latex) latex
tumblesocks
)
;; List of additional packages that will be installed without being ;; List of additional packages that will be installed without being
;; wrapped in a layer. If you need some configuration for these ;; wrapped in a layer. If you need some configuration for these
;; packages, then consider creating a layer. You can also put the ;; packages, then consider creating a layer. You can also put the
;; configuration in `dotspacemacs/user-config'. ;; configuration in `dotspacemacs/user-config'.
dotspacemacs-additional-packages '() dotspacemacs-additional-packages '(hackernews twittering-mode el-pocket chess wttrin)
;; A list of packages and/or extensions that will not be install and loaded. ;; A list of packages and/or extensions that will not be install and loaded.
dotspacemacs-excluded-packages '() dotspacemacs-excluded-packages '(toxi-theme)
;; If non-nil spacemacs will delete any orphan packages, i.e. packages that ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
;; are declared in a layer which is not a member of ;; are declared in a layer which is not a member of
;; the list `dotspacemacs-configuration-layers'. (default t) ;; the list `dotspacemacs-configuration-layers'. (default t)
@ -394,16 +470,133 @@ layers configuration. You are free to put any user code."
ranger-parent-depth 4 ranger-parent-depth 4
ranger-max-preview-size 10) ranger-max-preview-size 10)
(spacemacs|define-custom-layout "Mail" (spacemacs|define-custom-layout "Mail" :binding "m" :body (mu4e))
:binding "m" (spacemacs|define-custom-layout "Elfeed" :binding "f" :body (elfeed))
:body (spacemacs|define-custom-layout "Twitter" :binding "t" :body (twit))
(mu4e))
;; TODO remove after Spacemacs gets twittering-mode
(require 'twittering-mode)
(setq twittering-use-master-password t)
(eval-after-load 'twittering-mode
'(progn
(define-key twittering-mode-map (kbd "g") nil)
(define-key twittering-mode-map (kbd "g g") 'twittering-goto-first-status)
(define-key twittering-mode-map (kbd "c") 'twittering-current-timeline)
(define-key twittering-mode-map (kbd "C-d") 'twittering-scroll-up)
(define-key twittering-mode-map (kbd "C-u") 'twittering-scroll-down)
(define-key twittering-mode-map (kbd "/") 'evil-search-forward)
(define-key twittering-mode-map (kbd "?") 'evil-search-backward)
(define-key twittering-mode-map (kbd "n") 'evil-search-next)
(define-key twittering-mode-map (kbd "N") 'evil-search-previous)
(define-key twittering-edit-mode-map [escape] 'twittering-edit-cancel-status)
(define-key twittering-mode-map (kbd "<tab>") 'twittering-goto-next-uri)
;; make evil leader key work in twittering-mode
;; (add-to-list 'evil-leader/no-prefix-mode-rx "twittering-mode")
;; display icons
(setq twittering-icon-mode t)
;; the default size is 48 which I find too large
;; this requires imagemagick to be installed
(if (executable-find "convert")
(setq twittering-convert-fix-size 32))
;; This requires gzip. The icons are saved on ~/.twittering-mode-icons.gz,
;; which can be changed by the variable twittering-icon-storage-file
(if (executable-find "gzip")
(setq twittering-use-icon-storage t))
;; requires GnuPG to be installed
(if (executable-find "gpg")
(setq twittering-use-master-password t))))
;; (require 'tumblesocks)
;; (setq tumblesocks-blog "dustinswan.tumblr.com")
;; (eval-after-load 'tumblesocks-view-mode
;; '(progn
;; ;; (define-key twittering-mode-map (kbd "g") nil)
;; (define-key tumblesocks-view-mode-map (kbd "j") 'tumblesocks-view-next-post)
;; (define-key tumblesocks-view-mode-map (kbd "k") 'tumblesocks-view-prev-post)
;; ))
(defun better-elfeed-keys ()
(message "Better elfeed keys")
(define-key elfeed-show-mode-map (kbd "j") 'elfeed-show-next))
(add-hook 'elfeed-show-mode-hook 'better-elfeed-keys)
;; Org Publish stuff
(require 'ox-html)
(require 'ox-rss)
(require 'ox-publish)
(spacemacs|define-custom-layout "Elfeed" (setq web-bio
:binding "f" "<div class='bio'>
:body <img src='static/avatar.png'></img>
(elfeed)) <h1>Dustin Swan</h1>
<p>Software Engineer at IOCOM. JavaScript, Haskell, functional programming, design, piano, motorcycles, languages, games, bikes, books, fashion, minimalism, spreadsheets, travel, etc.</p>
<h5>Moriarty, NM | Chicago, IL</h5>
<a href='mailto://dustin@dustinswan.com'><i class='fa fa-envelope'></i></a>
<a href='https://twitter.com/dustinswan'><i class='fa fa-twitter'></i></a>
<a href='http://github.com/dustinswan'><i class='fa fa-github'></i></a>
<a href='http://facebook.com/dustinswan'><i class='fa fa-facebook-official'></i></a>
<a href='http://instagram.com/dustinswan'><i class='fa fa-instagram'></i></a>
<a href='http://dustinswan.tumblr.com'><i class='fa fa-tumblr'></i></a>
<a href='http://pinterest.com/dustinswan'><i class='fa fa-pinterest'></i></a>
<a href='http://reddit.com/user/dustinswan'><i class='fa fa-reddit-square'></i></a>
<a href='https://www.coinbase.com/dustinswan'><i class='fa fa-bitcoin'></i></a>
<a href='https://keybase.io/dustinswan'><i class='fa fa-key'></i></a>
</div>"
)
(setq org-publish-project-alist
`(("web"
:components ("blog" "pages" "static"))
("pages"
:base-directory "~/Sync/Web/pages/"
:base-extension "org"
:html-extension "html"
:publishing-directory "~/Desktop/Web"
:publishing-function org-html-publish-to-html
:html-head-include-default-style nil
:html-head-include-scripts nil
:with-toc nil
:section-numbers nil
:html-head "<link rel=\"stylesheet\" href=\"static/style.css\" /><link rel=\"stylesheet\" href=\"http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css\">"
:html-head-extra ""
:html-preamble ,web-bio
:html-postamble nil
)
("blog"
:base-directory "~/Sync/Web/blog"
:base-extension "org"
:html-extension "html"
:publishing-directory "~/Desktop/Web/blog"
:publishing-function org-html-publish-to-html
:recursive t
:html-head-include-default-style nil
:html-head-include-scripts nil
:with-toc nil
:section-numbers nil
;; :with-latex t ; do use MathJax for awesome formulas!
:html-head "<link rel=\"stylesheet\" href=\"../static/style.css\" /><link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css\">"
:html-head-extra ""
:html-preamble ,web-bio
:html-postamble nil
:auto-sitemap t
:sitemap-filename "archive.org"
:sitemap-title "Archive"
:sitemap-sort-files anti-chronologically
:sitemap-style list
)
("static"
:base-directory "~/Sync/Web/static"
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|otf"
:publishing-directory "~/Desktop/Web/static"
:recursive t
:publishing-function org-publish-attachment
)))
(setq wttrin-default-cities '("Moriarty NM" "Albuquerque" "Chicago"))
) )
;; Do not write anything past this comment. This is where Emacs will ;; Do not write anything past this comment. This is where Emacs will
@ -419,7 +612,7 @@ layers configuration. You are free to put any user code."
'(ahs-idle-interval 0.25) '(ahs-idle-interval 0.25)
'(ahs-idle-timer 0 t) '(ahs-idle-timer 0 t)
'(ahs-inhibit-face-list nil) '(ahs-inhibit-face-list nil)
'(elfeed-goodies/entry-pane-position (quote bottom)) '(elfeed-goodies/entry-pane-position (quote right))
'(erc-modules '(erc-modules
(quote (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))) (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)))

@ -1,119 +0,0 @@
(eval-after-load 'mu4e
'(progn
(require 'mu4e-multi)
(require 'mu4e-contrib)
(setq mu4e-multi-account-alist
'(("Gmail"
(user-mail-address . "dustinswan@gmail.com")
(mu4e-drafts-folder . "/Gmail/[Gmail].Drafts")
(mu4e-refile-folder . "/Gmail/[Gmail].All Mail")
(mu4e-sent-folder . "/Gmail/[Gmail].Sent Mail")
(mu4e-trash-folder . "/Gmail/[Gmail].Trash"))
("IOCOM"
(user-mail-address . "dswan@iocom.com")
(mu4e-drafts-folder . "/IOCOM/INBOX.Drafts")
(mu4e-refile-folder . "/IOCOM/INBOX.Archive")
(mu4e-sent-folder . "/IOCOM/INBOX.Sent")
(mu4e-trash-folder . "/IOCOM/INBOX.Trash"))))
(mu4e-multi-enable)
(global-set-key (kbd "C-x m") 'mu4e-multi-compose-new)
;; (add-hook 'message-send-mail-hook 'mu4e-multi-smtpmail-set-msmtp-account)
(setq
mu4e-maildir "~/Mail"
mu4e-user-mail-address-list '("dustinswan@gmail.com"
"dswan@iocom.com"
"dswan@insors.com"
"dustin@dustinswan.com")
user-full-name "Dustin Swan"
mu4e-attachment-dir "~/Downloads"
message-signature "Dustin Swan"
mu4e-compose-signature "Dustin Swan"
mail-host-address "gmail.com"
mu4e-get-mail-command "offlineimap -q"
mu4e-update-interval 120
;; mu4e-use-fancy-chars t
;; mu4e-html2text-command "html2text -nobs"
;; mu4e-html2text-command "w3m -T text/html"
mu4e-html2text-command 'mu4e-shr2text
mu4e-view-prefer-html t ;; sorryboutit
mu4e-view-show-images t ;; doesn't work with shr2text
message-send-mail-function 'message-send-mail-with-sendmail
message-sendmail-extra-arguments '("--read-envelope-from")
message-sendmail-f-is-evil t
message-kill-buffer-on-exit t
sendmail-program "/usr/local/bin/msmtp"
;; just Gmail at first
;; user-mail-address "dustinswan@gmail.com"
;; mu4e-sent-folder "/Gmail/[Gmail].Sent Mail"
;; mu4e-drafts-folder "/Gmail/[Gmail].Drafts"
;; mu4e-trash-folder "/Gmail/[Gmail].Trash"
;; mu4e-refile-folder "/Gmail/[Gmail].All Mail"
;; mu4e-sent-messages-behavior 'delete
;; mail-host-address "gmail.com"
)
; multiple accounts
;; (defvar my-mu4e-account-alist
;; '(("Gmail"
;; (user-mail-address "dustinswan@gmail.com")
;; (mu4e-sent-folder "/Gmail/[Gmail].Sent Mail")
;; (mu4e-drafts-folder "/Gmail/[Gmail].Drafts")
;; (mu4e-trash-folder "/Gmail/[Gmail].Trash")
;; ;; (mu4e-refile-folder "/Gmail/[Gmail].All Mail")
;; (mu4e-sent-messages-behavior 'delete)
;; (mail-host-address "gmail.com")
;; ("IOCOM"
;; (user-mail-address "dswan@iocom.com")
;; (mu4e-sent-folder "/IOCOM/INBOX.Sent")
;; (mu4e-drafts-folder "/IOCOM/INBOX.Drafts")
;; (mu4e-trash-folder "/IOCOM/INBOX.Trash")
;; ;; (mu4e-refile-folder "/IOCOM/INBOX.Archive")
;; (mu4e-sent-messages-behavior 'sent)
;; (mail-host-address "iocom.com")))))
(add-to-list 'mu4e-bookmarks '("maildir:/IOCOM/INBOX OR maildir:/Gmail/INBOX" "All Inboxes" ?I))
(add-to-list 'mu4e-bookmarks '("maildir:/IOCOM/INBOX" "IOCOM Inbox" ?i))
(add-to-list 'mu4e-bookmarks '("maildir:/Gmail/INBOX" "Gmail Inbox" ?g))
;; refile
;; (setq mu4e-refile-folder
;; (lambda (msg)
;; (cond
;; ((mu4e-message-contact-field-matches msg :to "dustinswan@gmail.com")
;; "/Gmail/[Gmail].All Mail")
;; ((mu4e-message-contact-field-matches msg :to "dswan@iocom.com")
;; "/IOCOM/INBOX.Archive")
;; ;; messages sent by me go to the sent folder
;; ;; ((find-if
;; ;; (lambda (addr)
;; ;; (mu4e-message-contact-field-matches msg :from addr))
;; ;; mu4e-user-mail-address-list)
;; ;; mu4e-sent-folder)
;; (t "/Gmail/[Gmail].All Mail"))))
(add-to-list 'mu4e-view-actions '("ViewInBrowser" . mu4e-action-view-in-browser) t)
(add-hook 'mu4e-index-updated-hook
(lambda ()
(shell-command (concat "youve_got_mail "
(number-to-string mu4e-update-interval)))))
;; use imagemagick, if available
(when (fboundp 'imagemagick-register-types)
(imagemagick-register-types))))

@ -1,39 +0,0 @@
;;; extensions.el --- mu4e Layer extensions File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defvar mu4e-pre-extensions
'(
;; pre extension mu4es go here
)
"List of all extensions to load before the packages.")
(defvar mu4e-post-extensions
'(
;; post extension mu4es go here
mu4e
mu4e-multi
)
"List of all extensions to load after the packages.")
;; For each extension, define a function mu4e/init-<extension-mu4e>
;;
(defun mu4e/init-mu4e ()
"Initialize my extension"
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
(add-to-list 'load-path "~/dotfiles/")
(require 'mu4e)
(require 'mu4e-multi)
)
;;
;; Often the body of an initialize function uses `use-package'
;; For more info on `use-package', see readme:
;; https://github.com/jwiegley/use-package

@ -1,37 +0,0 @@
;;; packages.el --- mu4e Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defvar mu4e-packages
'(
;; package mu4es go here
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
(defvar mu4e-excluded-packages '()
"List of packages to exclude.")
;; For each package, define a function mu4e/init-<package-mu4e>
;;
;; (defun mu4e/init-mu4e-maildirs-extension ()
"Initialize my package"
;; (use-package mu4e-maildirs-extension
;; :config
;; (require 'mu4e-maildirs-extension)
;; (require 'mu4e-multi)
;; (mu4e-maildirs-extension)
;; )
;; )
;;
;; Often the body of an initialize function uses `use-package'
;; For more info on `use-package', see readme:
;; https://github.com/jwiegley/use-package

@ -1,33 +0,0 @@
;;; extensions.el --- twittering-mode Layer extensions File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defvar twittering-mode-pre-extensions
'(
;; pre extension twittering-modes go here
)
"List of all extensions to load before the packages.")
(defvar twittering-mode-post-extensions
'(
;; post extension twittering-modes go here
)
"List of all extensions to load after the packages.")
;; For each extension, define a function twittering-mode/init-<extension-twittering-mode>
;;
;; (defun twittering-mode/init-my-extension ()
;; "Initialize my extension"
;; )
;;
;; Often the body of an initialize function uses `use-package'
;; For more info on `use-package', see readme:
;; https://github.com/jwiegley/use-package

@ -1,35 +0,0 @@
;;; packages.el --- twittering-mode Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defvar twittering-mode-packages
'(
epg
twittering-mode
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
(defvar twittering-mode-excluded-packages '()
"List of packages to exclude.")
;; For each package, define a function twittering-mode/init-<package-twittering-mode>
;;
(defun twittering-mode/init-epg ())
(defun twittering-mode/init-twittering-mode ()
(require 'twittering-mode)
)
; (setq twittering-use-master-password t))
;;
;; Often the body of an initialize function uses `use-package'
;; For more info on `use-package', see readme:
;; https://github.com/jwiegley/use-package

@ -1 +0,0 @@
/Users/dustinswan/dotfiles/spacemacs_private/twittering-mode

@ -4,7 +4,6 @@ rm ~/.zshrc; ln -s ~/dotfiles/zshrc ~/.zshrc
rm ~/.gemrc; ln -s ~/dotfiles/gemrc ~/.gemrc rm ~/.gemrc; ln -s ~/dotfiles/gemrc ~/.gemrc
rm -rf ~/.ghc; mkdir ~/.ghc; ln -s ~/dotfiles/ghci.conf ~/.ghc/ghci.conf rm -rf ~/.ghc; mkdir ~/.ghc; ln -s ~/dotfiles/ghci.conf ~/.ghc/ghci.conf
rm ~/.gitconfig; ln -s ~/dotfiles/gitconfig ~/.gitconfig rm ~/.gitconfig; ln -s ~/dotfiles/gitconfig ~/.gitconfig
rm -rf ~/.tmux; ln -s ~/dotfiles/tmux ~/.tmux
rm ~/.tmux.conf; ln -s ~/dotfiles/tmux.conf ~/.tmux.conf rm ~/.tmux.conf; ln -s ~/dotfiles/tmux.conf ~/.tmux.conf
rm -rf ~/.config/khal; mkdir -p ~/.config/khal; ln -s ~/dotfiles/khal.conf ~/.config/khal/khal.conf rm -rf ~/.config/khal; mkdir -p ~/.config/khal; ln -s ~/dotfiles/khal.conf ~/.config/khal/khal.conf
rm -rf ~/.vdirsyncer; mkdir ~/.vdirsyncer; ln -s ~/dotfiles/vdirsyncer/config ~/.vdirsyncer/config rm -rf ~/.vdirsyncer; mkdir ~/.vdirsyncer; ln -s ~/dotfiles/vdirsyncer/config ~/.vdirsyncer/config
@ -18,7 +17,6 @@ rm ~/.msmtprc; ln -s ~/dotfiles/msmtprc ~/.msmtprc
rm ~/.muttrc; ln -s ~/dotfiles/muttrc ~/.muttrc rm ~/.muttrc; ln -s ~/dotfiles/muttrc ~/.muttrc
# mac only # mac only
rm ~/.slate.js; ln -s ~/dotfiles/slate.js ~/.slate.js
rm ~/Library/KeyBindings/DefaultKeyBinding.dict; cp ~/dotfiles/DefaultKeyBinding.dict ~/Library/KeyBindings/DefaultKeyBinding.dict rm ~/Library/KeyBindings/DefaultKeyBinding.dict; cp ~/dotfiles/DefaultKeyBinding.dict ~/Library/KeyBindings/DefaultKeyBinding.dict
# linux only # linux only

Loading…
Cancel
Save