Permalink
Browse files

Merge branch 'master' of github.com:foobacca/dotfiles

* 'master' of github.com:foobacca/dotfiles: (21 commits)
  add dockerfile syntax for vim
  mux work tweaks
  add more idea vim settings
  add more ideavim mappings
  vim - add :Md for quick markdown set up
  update path for link
  add paths to start of $PATH
  fix zsh-syntax-highlighting plugin inclusion
  add extra actions to ideavimrc
  ideavim doesn't like comment on same line as map
  move some vim mappings to vim/mappings-safe.vim
  add linguamatics email set up
  vim: add plugins for ansible and jinja
  add ideavimrc
  add hg stuff to zsh set up
  update mux for linguamatics
  update mbsync for linguamatics
  add gitconfig for linguamatics
  add bin scripts for devjournal and redshift
  start playing with scripts to control web browser stuff
  ...
  • Loading branch information...
Hamish Downer
Hamish Downer committed Jul 30, 2016
2 parents 54fe872 + f0d04e5 commit 0edde14e32b727b97a25a39ec0ea91456fee8277
View
@@ -3,7 +3,7 @@
# on the path, then add to $PATH
pathadd() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="${PATH:+"$PATH:"}$1"
PATH="$1${PATH:+":$PATH"}"
fi
}
@@ -13,14 +13,14 @@ ldlibrarypathadd() {
fi
}
pathadd $HOME/bin
pathadd $HOME/.local/bin
pathadd $HOME/.linuxbrew/bin
pathadd $HOME/.wp-cli/bin
pathadd $HOME/Dropbox/tech/bin
pathadd $HOME/lib/pebble/bin
pathadd /var/lib/gems/1.8/bin/
pathadd /var/lib/gems/1.9.1/bin/
pathadd $HOME/.local/bin
pathadd $HOME/.linuxbrew/bin
pathadd $HOME/bin
ldlibrarypathadd $HOME/.linuxbrew/lib
View
@@ -0,0 +1,5 @@
#!/bin/bash
# modified from https://github.com/bitterjug/vim-notebook
NOTEFILE=$HOME/tasks/devjournal.md
COMMAND="call Note_add()"
vim -c"$COMMAND" "$NOTEFILE" -c"$" +Wrap
View
@@ -0,0 +1,3 @@
#!/bin/sh
redshift-gtk -l geoclue || redshift-gtk -l manual
View
@@ -0,0 +1,54 @@
#!/bin/bash
save_active () {
# get current workspace
ActiveDesktop="$(xdotool get_desktop)"
# get current active window ID
ActiveWindowID="$(xdotool getactivewindow)"
# get current active window name
ActiveWindowName="$(xdotool getwindowname "$ActiveWindowID")"
}
restore_active(){
xdotool set_desktop "$ActiveDesktop"
# Activating the root window (Desktop) results in an error message, so we
# try to avoid it
[[ "$ActiveWindowName" != "Desktop" ]] && xdotool windowactivate "$ActiveWindowID"
}
toggle_mute_hangout(){
# select the Firefox window
wmctrl -a Firefox
sleep 0.1
# :b hangouts<return> selects the hangouts tab (using vimperator)
# Ctrl+d toggles mute in hangouts
xdotool getactivewindow key : b ' ' h a n g o u t s "Return" "ctrl+d"
}
play_pause_youtube(){
# select the Firefox window
wmctrl -a Firefox
sleep 0.1
# :b hangouts<return> selects the hangouts tab (using vimperator)
# Ctrl+d toggles mute in hangouts
xdotool getactivewindow key b " " y o u t u b e "Tab" "Return" k
}
unknown_arg(){
echo "unknown argument $1"
exit 2
}
arg="$1"
if [ $arg = 'toggle_mute_hangout' ]; then
save_active
toggle_mute_hangout
restore_active
elif [ $arg = 'play_pause_youtube' ]; then
save_active
play_pause_youtube
restore_active
else
unknown_arg
fi
View
@@ -7,6 +7,10 @@
;("marmalade" . "http://marmalade-repo.org/packages/")
;("melpa" . "http://melpa.milkbox.net/packages/")))
; use files from brew emacs install
(let ((default-directory "/opt/hamish/.linuxbrew/share/emacs/site-lisp/"))
(normal-top-level-add-subdirs-to-load-path))
; don't show the start up screen
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
@@ -5,7 +5,7 @@
(require 'notmuch)
; notmuch runs on a server, we use this script
(setq notmuch-command "~/bin/remote-notmuch.sh")
(setq notmuch-command "~/bin/notmuch")
; bcc emails to self, as the emails live on a different machine
(setq notmuch-fcc-dirs nil)
@@ -24,21 +24,18 @@
("flagged" :foreground "green")))
(setq notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :sort-order 'newest-first)
(:name "unreadinbox" :query "tag:inbox AND tag:unread" :sort-order 'newest-first)
(:name "unread" :query "tag:unread AND NOT tag:nagios AND NOT tag:carers" :sort-order 'newest-first)
(:name "nagios" :query "tag:nagios" :sort-order 'newest-first)
(:name "carers" :query "tag:carers AND NOT tag:logwatch" :sort-order 'newest-first)))
(:name "unreadinbox" :query "tag:inbox AND tag:unread" :sort-order 'newest-first)))
; message-mode stuff
;(setq message-send-mail-function 'message-send-mail-with-sendmail)
;(setq sendmail-program "/usr/sbin/sendmail")
;(setq sendmail-program "/home/hamish/bin/sendmail-ssh")
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-default-smtp-server "mail.aptivate.org"
smtpmail-smtp-server "mail.aptivate.org"
smtpmail-default-smtp-server "mail.linguamatics.com"
smtpmail-smtp-server "mail.linguamatics.com"
smtpmail-stream-type 'ssl
;smtpmail-smtp-service 587)
smtpmail-smtp-service 465)
smtpmail-smtp-service 587)
;smtpmail-smtp-service 465)
(setq message-from-style 'angles)
;(setq smtpmail-debug-info t)
View
20 freshrc
@@ -22,8 +22,8 @@ fresh freshshell/fresh contrib/completion/fresh-completion.zsh --file=~/.zshrc
fresh zsh/foobacca.zsh-theme --file=~/.oh-my-zsh/custom/themes/foobacca.zsh-theme
fresh zsh/mosh.plugin.zsh --file=~/.oh-my-zsh/custom/mosh.plugin.zsh
fresh zsh/tmuxinator.plugin.zsh --file=~/.oh-my-zsh/custom/plugins/tmuxinator.plugin.zsh
fresh zsh-users/zsh-syntax-highlighting zsh-syntax-highlighting.zsh --file=vendor/zsh-syntax-highlighting.zsh
fresh zsh-users/zsh-syntax-highlighting highlighters --file=vendor/highlighters/
fresh zsh/tmuxinator.plugin.zsh --file=~/.oh-my-zsh/custom/plugins/tmuxinator.plugin.zsh
fresh zsh-users/zsh-syntax-highlighting . --file=~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/
# general shell stuff for both bash and zsh
fresh 'shell/*'
@@ -46,6 +46,7 @@ fresh vimperatorrc --file
# note vimrc sources files from .dotfiles/vim in particular order
fresh vimrc --file=~/.vimrc
fresh vimrc --file=~/.nvimrc
fresh ideavimrc --file=~/.ideavimrc
# if we copy in blindly we might stuff up the vundle installation
# so only copy in once the directory exists
if [ -d "$HOME/.vim/bundle/vim-airline/autoload/airline/themes" ]; then
@@ -114,6 +115,21 @@ if [ $(hostname) = "foobacca.co.uk" ] || [ $(hostname) = "lap-e330" ] || [ $(hos
fi
if [ $(hostname) = "steelcommando" ]; then
fresh mail/signature.linguamatics --file=~/.signature
fresh mail/mbsyncrc.linguamatics --file=~/.mbsyncrc
fresh mail/checkworkmail --bin
fresh mail/mail-pass --bin
# fresh mail/offlineimaprc --file=~/.offlineimaprc
# notmuch filtering
fresh mail/notmuch-config-linguamatics --file=~/.notmuch-config
fresh mail/notmuch-post-new.linguamatics --bin=~/local/mail/.notmuch/hooks/post-new
fresh afew/config.linguamatics --file=~/.config/afew/config
fresh mail/notmuch-work-abook-ignore --file=/opt/hdowner/.notmuch-work-abook-ignore
fi
# foobacca only stuff
if [ $(hostname) = "foobacca.co.uk" ]; then
fresh mail/mailcap.server --file=~/.mailcap
@@ -0,0 +1,5 @@
[user]
email = hamish.downer@linguamatics.com
# vi: ft=gitconfig
View
@@ -0,0 +1,37 @@
source ~/.dotfiles/vim/abbrev.vim
source ~/.dotfiles/vim/autocmds.vim
source ~/.dotfiles/vim/mappings-safe.vim
source ~/.dotfiles/vim/settings.vim
" mappings just for ideavim
set incsearch
set surround
" others, from http://stackoverflow.com/a/33988035/3189
map <leader>a :action Annotate<CR>
map <leader>b :action Back<CR>
" map <leader>c :action $Copy<CR>
" map <leader>d :action EditorDuplicate<CR>
map <leader>e :action RecentFiles<CR>
map <leader>f :action Find<CR>
map <leader>g :action GotoDeclaration<cr>
" map <leader>h :action TypeHierarchy<CR>
" map <leader>i :action ImplementMethods<CR>
" map <leader>m :action EditorScrollToCenter<CR>
" map <leader>n :action FileChooser.NewFolder<CR>
" map <leader>o :action MethodHierarchy.OverrideMethodAction<CR>
" map <leader>p :action ParameterInfo<CR>
" map <leader>q :action GuiDesigner.QuickJavadoc<CR>
map <leader>r :action Refactorings.QuickListPopupAction<CR>
" map <leader>s :action SaveAll<CR>
" map <leader>t :action Vcs.UpdateProject<CR>
map <leader>u :action PublishGroup.Upload<CR>
" map <leader>v :action $Paste<CR>
" map <leader>w :action EditorSelectWord<CR>
" map <leader>x :action $Cut<CR>
" map <leader>y :action EditorDeleteLine<CR>
" map <leader>[ :action EditorCodeBlockStart<CR>
" map <leader>] :action EditorCodeBlockEnd<CR>
command! -nargs=* Usages action FindUsages
View
@@ -0,0 +1,35 @@
#!/usr/bin/env python
# from https://bloerg.net/2013/10/09/syncing-mails-with-mbsync-instead-of-offlineimap.html
import argparse
import getpass
import keyring
import sys
SERVICE = 'mbsync'
def get_pass(user):
return keyring.get_password(SERVICE, user)
def main():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--set', '-s', type=str, help='Account to save password')
group.add_argument('--get', '-g', type=str, help='Account to get password')
args = parser.parse_args()
if args.set:
password = getpass.getpass()
keyring.set_password(SERVICE, args.set, password)
else:
print(get_pass(args.get))
return 0
if __name__ == '__main__':
sys.exit(main())
# vi: ft=python
File renamed without changes.
View
@@ -0,0 +1,60 @@
# default values
Sync Full
Expunge Both
Create Both
# imap account
IMAPAccount linguamatics
Host mail.linguamatics.com
User hdowner
PassCmd "mail-pass -g hamish.downer@linguamatics.com"
UseIMAPS yes
RequireSSL yes
# imap store
IMAPStore lingumatics-remote
Account linguamatics
# local store
MaildirStore lingumatics-local
Path ~/local/mail/
Inbox ~/local/mail/INBOX
Flatten .
Channel linguamatics-channel
Master :lingumatics-remote:
Slave :lingumatics-local:
Patterns INBOX *
Create Both
Expunge Both
Sync All
SyncState *
# Channel linguamatics-inbox-channel
# Master :lingumatics-remote:
# Slave :lingumatics-local:
# Patterns general_inbox
# Create Both
# Expunge Slave
# Sync All
# Channel linguamatics-sentspam-channel
# Master :lingumatics-remote:
# Slave :lingumatics-local:
# Patterns Sent spam
# Create Both
# Expunge Slave
# Sync All
# Channel linguamatics-auto-channel
# Master :lingumatics-remote:
# Slave :lingumatics-local:
# Patterns INBOX.carers INBOX.nagios INBOX.django_error
# Create Both
# Expunge Slave
# Sync All
Group linguamatics
Channels linguamatics-channel
Oops, something went wrong.

0 comments on commit 0edde14

Please sign in to comment.