Commits

Toby Davies committed 4f7809c

work-related changes

  • Participants
  • Parent commits 479d4c0

Comments (0)

Files changed (11)

 
 URxvt.perl-ext-common:  default,matcher
 URxvt.urlLauncher:      /usr/bin/sensible-browser
-URxvt.matcher.button:   1
+URxvt.matcher.button:   1
+
+URxvt.searchable-scrollback: CM-~
 (require 'flymake-cursor)
 (require 'mediawiki)
 (require 'autopair)
+(require 'desktop)
+
 
 (defvar autopair-modes '(python-mode))
 (defun turn-on-autopair-mode () (autopair-mode 1))
 (dolist (mode autopair-modes) (add-hook (intern (concat (symbol-name mode) "-hook")) 'turn-on-autopair-mode))
 
+(add-hook 'c++-mode-hook
+          (lambda ()
+            (gtags-mode)))
 
+(setq-default tab-width 8)
 (setq-default indent-tabs-mode nil)
+(setq-default tab-stop-list (loop for i upto 100 collecting (* 4 i)))
+
 (setq column-number-mode t)
+(setq auto-save-mode-default t)
 (show-paren-mode t)
 
 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
 (add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode))
+(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
+
 (global-set-key "\C-cl" 'org-store-link)
 (global-set-key "\C-ca" 'org-agenda)
 (global-set-key "\C-cb" 'org-iswitchb)
   ;; If there is more than one, they won't work right.
  '(browse-url-browser-function (quote browse-url-generic))
  '(browse-url-generic-program "sensible-browser")
+ '(comment-multi-line t)
+ '(desktop-dirname "~/" t)
+ '(desktop-load-locked-desktop t)
+ '(desktop-save-mode t)
+ '(ecb-options-version "2.32")
  '(inhibit-startup-screen t)
- '(initial-buffer-choice t)
- '(ispell-dictionary "british")
+ ;;'(initial-buffer-choice t)
+ '(ispell-dictionary "british" t)
  '(org-agenda-files (quote ("~/org.d/")))
  '(pop-up-frames nil))
 
 (add-to-list 'flymake-allowed-file-name-masks
              '("\\.py\\'" flymake-pyflakes-init))
 
-(add-hook 'python-mode-hook
-	  (lambda ()
-	    (unless (eq buffer-file-name nil)
-	      (flymake-mode 1)
-	      (local-set-key [f2] 'flymake-goto-prev-error)
-	      (local-set-key [f3] 'flymake-goto-next-error))))
 
 (defun woman-at-point ()
   (interactive)
   (global-set-key [mouse-5] '(lambda ()
                                (interactive)
                                (scroll-up 1))))
+
+(defun auto-save-desktop ()
+    (interactive)
+    ;; Don't call desktop-save-in-desktop-dir, as it prints a message.
+    (if (eq (desktop-owner) (emacs-pid))
+        (desktop-save desktop-dirname)))
+(add-hook 'auto-save-hook 'auto-save-desktop)
+
+
+;;; This was installed by package-install.el.
+;;; This provides support for the package system and
+;;; interfacing with ELPA, the package archive.
+;;; Move this code earlier if you want to reference
+;;; packages in your .emacs.
+(when
+    (load
+     (expand-file-name "~/.emacs.d/elpa/package.el"))
+  (package-initialize))
+
+
+
+(autoload 'semantic-mode "semantic" nil t)
+(autoload 'company-mode "company" nil t)
+(custom-set-faces
+  ;; custom-set-faces was added by Custom.
+  ;; If you edit it by hand, you could mess it up, so be careful.
+  ;; Your init file should contain only one such instance.
+  ;; If there is more than one, they won't work right.
+ )
+
+(push "~/.emacs.d/" load-path)
+(push "~/.emacs.d/icicles/" load-path)
+(require 'el-swank-fuzzy)
+(require 'icicles)
 syntax:glob
 *~
-#*#
-.#*#
+\#*
+.\#*
 *.elc
 .emacs.d/elpa/*
 *.o
-*.hi
+*.hi

File .xmonad/hooks

 #!/bin/bash
 
-run-parts ~/.xmonad/"$1.d"
+for f in ~/.xmonad/"$1.d/"* ; do
+    if [ -x "$f" ] ; then
+	"$f" &
+    fi
+done
 
+wait

File .xmonad/xmonad.hs

 import XMonad.Layout.NoBorders
 import XMonad.Layout.Tabbed
 import XMonad.Layout.Grid
+import XMonad.Layout.OneBig
 import XMonad.Layout.ShowWName
 import XMonad.Hooks.UrgencyHook
+import XMonad.Hooks.EwmhDesktops
 
 myModMask = mod4Mask               -- "windows key"
 myNormalBorderColor  = "#4f4fff"
 myTerminal = "urxvt"
 
 main :: IO ()
-main = xmonad $ withUrgencyHookC myUrgentHook myUrgentConfig $ config
+main = xmonad $ withUrgencyHookC myUrgentHook myUrgentConfig $ ewmh config
        where config = defaultConfig {
                normalBorderColor  = myNormalBorderColor,
                focusedBorderColor = myFocusedBorderColor,
   ("M1-<F4>", kill),
   ("M-x", spawn "visit"),
   ("M-z", safeSpawn "zsh" ["-c", "sensible-browser"]),
+  ("M-S-z", spawn "zsh -c sensible-browser \"$(xsel)\""),
   ("M-0", spawn "popup-notify"),
   --  ("M-S-0", spawn "notify-send \"`date '+%A %Y-%m-%d %T'`\" \"`cal`\""),
   ("M-S-0", spawn "zenity --calendar --text=\"Now: `date`\""),
   ("M-g", spawn "sensible-browser --app=http://www.gmail.com"),
   ("M-o", spawn "nautilus --no-desktop"),
   ("M-;", focusUrgent),
+  ("M-S-`", spawn "user-shutdown"),
   ("<XF86AudioLowerVolume>", spawn "amixer sset -- Master playback 10-"),
   ("<XF86AudioRaiseVolume>", spawn "amixer sset -- Master playback 10+"),
   ("S-<XF86AudioRaiseVolume>", spawn "amixer sset -- Master playback 100%"),
   ("<XF86AudioMute>", spawn "amixer sset -- Master playback 0%"),
   ("M-<F3>", spawn "xbacklight -inc 20"),
-  ("M-<F2>", spawn "xbacklight -dec 20")
+  ("M-<F2>", spawn "xbacklight -dec 20"),
+  ("M-S-q", saveAndShutdown)
   ]
 
+saveAndShutdown = do execScriptHook "shutdown" ; io (exitWith ExitSuccess)
+  
+
 manageHooks = [
-  className =? "XClock" --> doFloat,
-  className =? "Xmessage" -->doFloat,
-  className =? "Zenity" -->doFloat,
+  className =? "XClock"    -->doFloat,
+  className =? "Xmessage"  -->doFloat,
+  className =? "Zenity"    -->doFloat,
   className =? "Rhythmbox" -->doShift "music",
-  className =? "trayer" -->doShift "misc",
-  className =? "skype" -->doShift "skype"
+  className =? "trayer"    -->doShift "misc",
+  className =? "skype"     -->doShift "skype"
   ]
               
-myLayoutHook = showWName $ smartBorders $ (tiled (9/15) ||| Grid ||| Mirror (tiled (13/15)) ||| simpleTabbedBottom ||| Full)
-  where tiled      = Tall nmaster inc 
+myLayoutHook = showWName $ smartBorders $ (Mirror spiral) ||| myTabbed ||| Full
+  where tiled      = Tall nmaster inc splitFrac
         nmaster    = 1
+        spiral     = OneBig splitFrac splitFrac
+        myTabbed   = simpleTabbed
+        inc::(Fractional t)=>t
         inc        = 1/15
+        splitFrac::(Fractional t)=>t
+        splitFrac  = 10*inc
 
 myWorkspaces = [
   "web",
 export GUROBI_HOME="/opt/gurobi400/linux64"
 export PATH="${PATH}:${GUROBI_HOME}/bin"
 export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
+#Boost
+export BOOST_BUILT_LIBS="/usr/include/boost_1_47_0/stage/lib"
+export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BOOST_BUILT_LIBS}"
+
 ###
 
 if [[ -n "$DISPLAY" ]]; then
 
 export uni=~/subjects/
 
-export brit=~/.purple/logs/jabber/tobyodavies@chat.facebook.com/-100000799571942@chat.facebook.com/
-
 if [ -d ~/py-src ] ; then
     export PYTHONPATH=~/py-src/
 fi
 
-if [[ -d /mnt/tg/commons/ ]] ; then
-    hash -d IT="/mnt/tg/commons/Information Technology/"
-    hash -d src="/mnt/tg/commons/Information Technology/Source Code"
+if [[ -d /vol/ ]] ; then
+    hash -d workbench="/vol/workbench"
 fi
 
-if [[ -d /var/www ]] ; then
-    hash -d www="/var/www"
-fi
-if [[ -d /var/www/test ]] ; then
-    hash -d test="/var/www/test"
-fi
 
-if [[ -d /var/www/new ]] ; then
-    hash -d new="/var/www/new"
-fi
+export PATH="$PATH:$HOME/minizinc-1.5.1/bin"
+export MANPATH="$MANPATH:$HOME/minizinc-1.5.1/doc/man"
 
 autoload -U colors ~/fbin/*[^~#](:t)
 
-alias visit='noglob visit'
+#alias visit='noglob visit'
 alias ll='ls -lh --color=auto '
 alias la='ll -A'
 alias can-has='sudo aptitude install '
 #!/usr/bin/zsh
 
 X=()
-if (nmcli -t -f name con status | grep -q "UniWireless") ; then
-    X=("--proxy-pac-url=http://www.unimelb.edu.au/cgi-bin/proxy.pac")
-    echo "foo" >> ~/foo.bar
-else
-    echo "bar" >> ~/foo.bar
-fi
+#if (nmcli -t -f name con status | grep -q "UniWireless") ; then
+#   X=("--proxy-pac-url=http://www.ubnimelb.edu.au/cgi-bin/proxy.pac")
+#   echo "foo" >> ~/foo.bar
+#else
+#    echo "bar" >> ~/foo.bar
+#fi
 
-echo chromium-browser $X $@
+urlify (){
+    grep '^http\(s\|\)://'
+}
 
-chromium-browser $X $@
+searchify (){
+    sed -e '/http\(s\|\):/ ! s|^\(.*\)$|http://www.google.com/search?q=\1|'
+}
+
+URLS=()
+while getopts ':xc' OPTNAME ; do
+    case "$OPTNAME" in
+        x)
+            if 
+            URLS+=("$(xsel -p | searchify)")
+            ;;
+        c)
+            URLS+=("$(xsel -b | searchify)")
+            ;;
+        *)  echo "-$OPTNAME not yet implemented" >&2
+            ;;
+        [?])
+            echo >&2 "Usage: $0 "
+            exit 1
+            ;;
+    esac
+done
+shift $((OPTIND-1))
+
+
+
+echo chromium-browser $X $@ $URLS >> ~/foo.bar
+chromium-browser $X $@ $URLS
+
+

File bin/popup-notify

 TIME=$(date '+%I:%M %p %A')
 DATE=$(date '+%Y-%m-%d')
 BATT=$(acpi | sed 's/,\s*rate information unavailable//')
+MSG=$(echo "$DATE\n\n$BATT")
 
-notify-send $TIME "$DATE\n\n$BATT"
+
+notify-send $TIME $MSG
 
 apt-get install aptitude
 
-aptitude install xmonad notification-daemon libnotify-bin zsh ipython chromium-browser emacs23 mercurial pyflakes pep8 pylint rxvt-unicode dmenu gmrun trayer vim zenity xclip xsel skype
+aptitude install xmonad notification-daemon libnotify-bin zsh ipython chromium-browser emacs23 mercurial pyflakes pep8 pylint rxvt-unicode dmenu gmrun trayer vim zenity xclip xsel skype python-mode
 
 sed -i -e '/^Exec/d' -e '$ a Exec=/usr/lib/notification-daemon/notification-daemon' \
     /usr/share/dbus-1/services/org.freedesktop.Notifications.service

File tasks.org

-* TODO [#A] Pro Rata multi-licence renewals
-  ** Test on [[file:/plink:tdavies@isenguard:/var/www/new][isenguard]]
-
-[[file:.emacs][.emacs]]