diff --git a/.conkerorrc b/.conkerorrc index 01ac1f6..1ad1b45 100644 --- a/.conkerorrc +++ b/.conkerorrc @@ -31,7 +31,7 @@ cwd = get_home_directory(); content_handlers.set("application/pdf", content_handler_save); // external programs for handling various mime types. -external_content_handlers.set("application/pdf", "xpdf"); +external_content_handlers.set("application/pdf", "zathura"); external_content_handlers.set("video/*", "urxvtc -e mplayer"); // use emacsclient as external editor. @@ -50,8 +50,67 @@ session_auto_save_auto_load = true; // Put history completion along side webjumps url_completion_use_history = true; +// Setup some handy web jumps +define_webjump("wolframalpha", "http://www.wolframalpha.com/input/?i=%s"); +define_webjump("duckduckgo", "https://duckduckgo.com/?q=%s"); + +// Create some shortcuts to the webjumps above +webjumps.ddg = webjumps.duckduckgo +webjumps.wa = webjumps.wolframalpha + +// START SECTION: thanks to http://conkeror.org/Webjumps +function chickadee_completer (input, cursor_position, conservative) { + var completions = []; + var content = yield send_http_request( + load_spec({uri: "http://api.call-cc.org/cdoc/ajax/prefix?q="+ + encodeURIComponent(input)})); + if (content.responseText) { + var parser = Cc["@mozilla.org/xmlextras/domparser;1"] + .createInstance(Ci.nsIDOMParser); + var doc = parser.parseFromString(content.responseText, "text/xml"); + var res = doc.getElementsByTagName("li") + for (let i = 0, n = res.length; i < n; ++i) { + completions.push(res[i].textContent); + } + } + yield co_return(prefix_completer($completions = completions) + (input, cursor_position, conservative)); +} + +define_webjump("chickadee", + "http://api.call-cc.org/cdoc?q=%s&query-name=Lookup", + $alternative = "http://api.call-cc.org/doc/", + $completer = chickadee_completer); + +define_webjump("eggref4", "http://wiki.call-cc.org/eggref/4/%s", + $alternative = "http://wiki.call-cc.org/chicken-projects/egg-index-4.html"); + +define_webjump("srfi", function (i) { + return "http://srfi.schemers.org/srfi-" + i + "/srfi-" + i + ".html"; +}); + +define_webjump("commandlinefu", + function(term) { + return 'http://www.commandlinefu.com/commands/matching/' + + term.replace(/[^a-zA-Z0-9_\-]/g, '') + .replace(/[\s\-]+/g, '-') + + '/' + btoa(term); + }, + $argument = 'optional', + $alternative = "http://www.commandlinefu.com/"); + +define_webjump("emacswiki", + "http://www.google.com/cse?cx=004774160799092323420%3A6-ff2s0o6yi"+ + "&q=%s&sa=Search&siteurl=emacswiki.org%2F", + $alternative="http://www.emacswiki.org/"); + +define_webjump("savannah", "https://savannah.gnu.org/search/?words=%s&type_of_search=soft"); + +define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&search=Search"); +// END SECTION + // Do a google search if a webjump is not recognized -read_url_handler_list = [read_url_make_default_webjump_handler("google")]; +read_url_handler_list = [read_url_make_default_webjump_handler("duckduckgo")]; // recognize urls a little diffently (allow one worded default webjumps) function possibly_valid_url (str) { @@ -94,8 +153,6 @@ define_browser_object_class( }, $hint = "choose url from history"); - - interactive("find-url-from-history", "Find a page from history in the current buffer", "find-url", @@ -116,4 +173,4 @@ interactive("history-clear", history_clear); // Disable whitelist (Causes extensions from unknown/unsigned sites to silently fail if not enabled!) -//session_pref("xpinstall.whitelist.required", false); +session_pref("xpinstall.whitelist.required", false); diff --git a/.emacs b/.emacs index f7fc3a2..3dc19ae 100644 --- a/.emacs +++ b/.emacs @@ -8,6 +8,15 @@ ;; fixes color output issues; see: http://wiki.archlinux.org/index.php/Emacs#Colored_output_issues (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) +;; Automatically open some config files with an associated major mode +;; Note: regexp's used to match buffer filenames are intentionally left +;; unbounded (without '$') to catch cases where the filename may +;; take the format: filename~ +(add-to-list 'auto-mode-alist '("\\.conkerorrc" . javascript-mode)) +(add-to-list 'auto-mode-alist '("\\.xmobarrc" . haskell-mode)) +(add-to-list 'auto-mode-alist '("\\.screenrc" . conf-mode)) +(add-to-list 'auto-mode-alist '("\\.stumpwmrc" . lisp-mode)) + ;; bind M-g to M-x goto-line (global-set-key "\M-g" 'goto-line) @@ -24,12 +33,6 @@ ,(make-char 'greek-iso8859-7 107)) nil)))))) -;; Make lambda appear as the greek character -(add-hook 'scheme-mode-hook 'pretty-lambdas) -(add-hook 'lisp-mode-hook 'pretty-lambdas) -(add-hook 'lisp-interaction-mode-hook 'pretty-lambdas) -(add-hook 'geiser-repl-mode-hook 'pretty-lambdas) - ;; adds the given function mode to each element of the given-hooks (defun activate-mode-with-hooks (mode given-hooks) (while given-hooks @@ -37,6 +40,9 @@ mode) (setq given-hooks (cdr given-hooks)))) +;; Make lambda appear as the greek character +(activate-mode-with-hooks 'pretty-lambdas '(scheme-mode-hook lisp-mode-hook lisp-interaction-mode geiser-repl-mode python-mode emacs-lisp-mode)) + ;; linum mode for pretty line numbering (require 'linum) @@ -50,21 +56,24 @@ line) 'face 'linum))) -;; linum-modes is a list of mode hooks to instantiate linum-mode on -(defvar linum-modes '(scheme-mode-hook emacs-lisp-mode-hook c-mode-hook c++-mode-hook python-mode-hook lua-mode-hook haskell-mode-hook php-mode-hook perl-mode-hook lisp-mode-hook ruby-mode-hook sh-mode-hook)) -(activate-mode-with-hooks (lambda () (linum-mode 1)) linum-modes) +;; code-modes is a list of mode hooks (for programming langs only) +(defvar code-modes '(scheme-mode-hook emacs-lisp-mode-hook c-mode-hook c++-mode-hook python-mode-hook lua-mode-hook haskell-mode-hook php-mode-hook perl-mode-hook lisp-mode-hook ruby-mode-hook sh-mode-hook)) +;; activate linum-mode in all buffers used for programming +(activate-mode-with-hooks (lambda () (linum-mode 1)) code-modes) + +;; activate flyspell-prog-mode for all buffers used for programming +(activate-mode-with-hooks 'flyspell-prog-mode code-modes) + +;; *DEPRECIATED* as of emacs24; when it goes live remove this as well as package emacs-color-theme ;; load color-theme and initialize -(require 'color-theme) -(color-theme-initialize) - +;;(require 'color-theme) +;;(color-theme-initialize) ;; use a global color theme -(color-theme-tty-dark) - +;;(color-theme-tty-dark) ;; make color-theme not applied globally and not cumunitive ;;(setq color-theme-is-cumulative nil) ;;(setq color-theme-is-global nil) - ;; given a frame colorizes the frame ;; if its window-system is X Windows the tty-dark theme will be applied otherwise it will be colorized tty-dark ;;(defun apply-color-theme (frame) @@ -72,10 +81,12 @@ ;; (if (eq (window-system frame) 'x) ;; (color-theme-tty-dark) ;; (color-theme-tty-dark))) - ;; add the apply-color-theme function (hook) to be executed on the creation of a new frame ;;(add-hook 'after-make-frame-functions 'apply-color-theme) +;; Use the built-in themeing in emacs24 +(load-theme 'manoj-dark) + ;; Set default tramp method to ssh (for security purposes) (setq tramp-default-method "ssh") @@ -148,6 +159,10 @@ (setq browse-url-browser-function 'w3m-browse-url) (autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t) +;; setup magit for git *DISABLED* +;;(autoload 'magit-status magit nil t) +;;(require 'magit) + ;; setup php-mode (autoload 'php-mode "php-mode.el" "Php mode." t) (setq auto-mode-alist (append '(("/*.\.php[345]?$" . php-mode)) auto-mode-alist)) @@ -235,7 +250,7 @@ (require 'geiser-install) ;(require 'quack) (require 'paredit) -(defvar paredit-hooks '(lisp-mode-hook lisp-interaction-mode-hook scheme-mode-hook c-mode-hook c++-mode-hook python-mode-hook)) +(defvar paredit-hooks '(lisp-mode-hook lisp-interaction-mode-hook emacs-lisp-mode scheme-mode-hook c-mode-hook c++-mode-hook python-mode-hook)) ;; Apply paredit-mode to modes listed in paredit-hooks (activate-mode-with-hooks (lambda () (paredit-mode 1)) paredit-hooks) @@ -272,6 +287,17 @@ (add-hook 'python-mode-hook 'hs-org/minor-mode) (add-hook 'scheme-mode-hook 'hs-org/minor-mode) +;; Setup fancy auto-complete +(add-to-list 'load-path "/usr/share/emacs/site-lisp/auto-complete") +(require 'auto-complete-config) +(add-to-list 'ac-dictionary-directories "/usr/share/emacs/site-lisp/auto-complete/ac-dict") +(ac-config-default) + +;; Enable flyspell-mode +(ac-flyspell-workaround) +;; Known Bug: flyspell-mode doesn't play nice with auto-complete-mode +;;(flyspell-mode) + ;; Enable autoinsert feature to automagically insert (require 'autoinsert) (auto-insert-mode) ;;; Adds hook to find-files-hook @@ -328,14 +354,19 @@ (insert (format-time-string "%b %e, %Y" (current-time)))) (defun open-scratch-buffer () - "Opens a new scratch buffer; if none exists create one." + "Opens the scratch buffer; if none exists creates one." (interactive) (let ((scratch-buffer (get-buffer "*scratch*"))) (if (null scratch-buffer) (progn (get-buffer-create "*scratch*") (insert initial-scratch-message) (lisp-interaction-mode))) (switch-to-buffer "*scratch*"))) -;; TODO: need to bind key to the open-scratch-buffer command + +;; Bind a key to grab a scratchpad +(global-set-key "\C-x4s" 'open-scratch-buffer) + +;; Bind a key to switch to eshell +(global-set-key "\C-x4e" 'eshell) ;; Toggles windows split orientation of 2 adjecent windows ;; Thanks to http://www.emacswiki.org/cgi-bin/wiki?ToggleWindowSplit @@ -382,20 +413,36 @@ ;; Stop startup screen (setq inhibit-startup-screen t) +;; Set some eshell options +(setq eshell-scroll-to-bottom-on-input t) +;; *BROKEN* +;;(setq eshell-scroll-to-bottom-on-output t) + +(defun eshell/clear () + "04Dec2001 - sailor, to clear the eshell buffer." + (interactive) + (let ((inhibit-read-only t)) + (erase-buffer))) + +;; Set repos for package.el +(setq package-archives '(("ELPA" . "http://tromey.com/elpa/") + ("gnu" . "http://elpa.gnu.org/packages/") + ("marmalade" . "http://marmalade-repo.org/packages/"))) + (custom-set-variables - ;; custom-set-variables 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. - '(org-agenda-files (quote ("~/.org/todo/center-todo.org" "~/.org/todo/oh-mega-todo.org" "~/.org/todo/network-todo.org" "~/.org/todo/rekahsoft-todo.org" "~/.org/todo/alpha-todo.org" "~/.org/todo/rekahsoft-mini-todo.org"))) + ;; custom-set-variables 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. + '(org-agenda-files nil) '(quack-default-program "racket") '(quack-fontify-style (quote plt)) '(quack-programs (quote ("mzscheme" "bigloo" "csi" "csi -hygienic" "gosh" "gracket" "gsi" "gsi ~~/syntax-case.scm -" "guile" "kawa" "mit-scheme" "racket" "racket -il typed/racket" "rs" "scheme" "scheme48" "scsh" "sisc" "stklos" "sxi"))) '(scroll-bar-mode nil) '(show-paren-mode 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. + ;; 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. ) diff --git a/.xbindkeysrc b/.xbindkeysrc index c39ec15..eb12f13 100644 --- a/.xbindkeysrc +++ b/.xbindkeysrc @@ -14,26 +14,32 @@ # play/pause key = toggle play pause #"~/.bin/toggle-pp.py" -"mpc toggle" +#"mpc toggle" +"cmus-remote --pause" m:0x10 + c:172 XF86AudioPlay -"mpc toggle" +#"mpc toggle" +"cmus-remote --pause" m:0x58 + c:33 Alt+Mod2+Mod4 + p # next key = next song -"mpc next" +#"mpc next" +"cmus-remote --next" m:0x10 + c:171 XF86AudioNext -"mpc next" +#"mpc next" +"cmus-remote --next" m:0x58 + c:60 Alt+Mod2+Mod4 + period # prev key = previous song -"mpc prev" +#"mpc prev" +"cmus-remote --prev" m:0x10 + c:173 XF86AudioPrev -"mpc prev" +#"mpc prev" +"cmus-remote --prev" m:0x58 + c:59 Alt+Mod2+Mod4 + comma diff --git a/.xinitrc b/.xinitrc index 597edf7..199a889 100644 --- a/.xinitrc +++ b/.xinitrc @@ -9,6 +9,9 @@ # Set the default curson used by xmonad xsetroot -cursor_name left_ptr +# Setup monitors +xrandr --output DVI-I-1 --auto --output DVI-I-2 --auto --left-of DVI-I-1 + # Start xscreensaver xscreensaver -no-splash & @@ -19,11 +22,14 @@ nitrogen --restore & unclutter & # Setup system tray -trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 4 --height 2 --transparent true --tint 0x000000 & +trayer --monitor 1 --edge top --align right --expand true --width 4 --height 2 --transparent true --tint 0x000000 & # Use xbindkeys to bind media keys etc.. xbindkeys & +# Start pulseaudio +#start-pulseaudio-x11 & + # Start-up applications parcellite & emacs --daemon & diff --git a/.xmobarrc b/.xmobarrc index e26de12..a75e5e1 100644 --- a/.xmobarrc +++ b/.xmobarrc @@ -1,17 +1,36 @@ +-- (C) Copyright Collin Doering @!@YEAR@!@ +-- +-- This program 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 of the License, or +-- (at your option) any later version. +-- +-- This program 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 this program. If not, see . + +-- File: .xmobarrc +-- Author: Collin J. Doering +-- Date: Jan 11, 2012 + Config { font = "-*-terminus-*-*-*-*-35-*-*-*-*-*-*-u" - , bgColor = "#000000" - , fgColor = "#00FFFF" - , position = TopW L 96 - , lowerOnStart = True - , commands = [ Run Network "eth0" ["-L","0","-H","32","-l", "green", "--normal","orange","--high","red"] 40 - , Run Com "/home/collin/.bin/vol.sh" [] "vol" 15 - , Run MultiCpu ["-t","Cpu | cpu0: | cpu1: | cpu2: | cpu3: ","-L","3","-H","50","--high","#f0c040"] 10 - , Run Memory ["-t","Mem: %", "-l", "green", "--normal","orange","--high","red"] 40 - , Run Date "%a %b %_d %l:%M %p" "date" 60 - , Run CpuFreq ["-t","Freq: | GHz","-L","0","-H","2","-l","green","-n","orange","-h","red"] 50 - , Run StdinReader - ] - , sepChar = "%" - , alignSep = "}{" - , template = " %StdinReader% }{ %vol% | %multicpu% | %memory% | %eth0% | %date% | " + , bgColor = "#000000" + , fgColor = "#00FFFF" + , position = TopW L 96 + , lowerOnStart = True + , commands = [ Run Network "eth0" ["-L","0","-H","32","-l", "green", "--normal","orange","--high","red"] 40 +-- , Run Com "/home/collin/.bin/vol.sh" [] "vol" 15 + , Run MultiCpu ["-t","Cpu | cpu0: | cpu1: | cpu2: | cpu3: ","-L","3","-H","50","--high","#f0c040"] 10 + , Run Memory ["-t","Mem: %", "-l", "green", "--normal","orange","--high","red"] 40 + , Run Date "%a %b %_d %l:%M %p" "date" 60 + , Run CpuFreq ["-t","Freq: | GHz","-L","0","-H","2","-l","green","-n","orange","-h","red"] 50 + , Run StdinReader + ] + , sepChar = "%" + , alignSep = "}{" + , template = " %StdinReader% }{ %multicpu% | %memory% | %eth0% | %date% | " } diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 9374e64..455d63e 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -30,6 +30,7 @@ import XMonad.Util.Run(spawnPipe) import XMonad.Layout.NoBorders(smartBorders) import XMonad.Layout.ResizableTile import XMonad.Layout.Grid +import XMonad.Layout.ToggleLayouts import XMonad.Util.NamedScratchpad import XMonad.Actions.GridSelect import XMonad.Actions.FloatKeys @@ -206,7 +207,10 @@ myGenericKeys = -- Lock the screen using xscreensaver [ ((modm .|. shiftMask, xK_v), spawn "xscreensaver-command -lock") - + + -- Toggle full-screen mode + , ((modm .|. controlMask, xK_space), sendMessage (Toggle "Full")) + -- Enable switching of windows with gridselect , ((modm, xK_g), goToSelected defaultGSConfig) @@ -231,14 +235,20 @@ myGenericKeys = -- Launch vlc , ((modm .|. controlMask, xK_v), spawn "vlc") + -- Launch a screen scratchpad terminal + , ((modm .|. controlMask, xK_Escape), namedScratchpadAction scratchpads "emacs-scratch") + -- Launch a screen scratchpad terminal , ((modm .|. controlMask, xK_1), namedScratchpadAction scratchpads "screen-terminal") -- Launch a maintainance scratchpad , ((modm .|. controlMask, xK_2), namedScratchpadAction scratchpads "maintainance-terminal") - - -- Launch deluge scratchpad - , ((modm .|. controlMask, xK_3), namedScratchpadAction scratchpads "deluge") + + -- Launch MC scratchpad + , ((modm .|. controlMask, xK_3), namedScratchpadAction scratchpads "mc-scratch") + + -- Launch transmission scratchpad (formally deluge) + , ((modm .|. controlMask, xK_4), namedScratchpadAction scratchpads "transmission") -- Enable movement and resizing of floating windows , ((modm, xK_d), withFocused (keysMoveWindow (10,0))) -- move floating window right @@ -292,6 +302,8 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $ -- The available layouts. Note that each layout is separated by |||, -- which denotes layout choice. -- +-- Add "toggleLayouts Full rztiled" to the layouts below (for +-- Mod-Control-Space command) myLayout = avoidStruts $ rztiled ||| Mirror rztiled ||| Grid ||| Full where -- default tiling algorithm partitions the screen into two panes @@ -336,37 +348,54 @@ myManageHook = composeAll , resource =? "desktop_window" --> doIgnore ] <+> namedScratchpadManageHook scratchpads <+> manageDocks -- NamedScratchPad Hook -scratchpads = [ NS "maintainance-terminal" spawnMaintainanceTerminal findMaintainanceTerminal manageMaintainanceTerminal - , NS "screen-terminal" spawnScreenTerminal findScreenTerminal manageScreenTerminal - , NS "deluge" spawnDeluge findDeluge manageDeluge ] - where - findMaintainanceTerminal = resource =? "scratchpad" - findScreenTerminal = resource =? "screen-scratch" - findDeluge = resource =? "deluge" - - spawnMaintainanceTerminal = myTerminal ++ " -name scratchpad" - spawnScreenTerminal = myTerminal ++ " -name screen-scratch -bg black" - spawnDeluge = "deluge-gtk" - - manageMaintainanceTerminal = customFloating $ W.RationalRect l t w h - where - h = 0.33 -- terminal height (%) - w = 1 -- terminal width (%) - t = 1 - h -- distance from top edge (%) - l = 1 - w -- distance from left edge (%) - manageScreenTerminal = customFloating $ W.RationalRect l t w h - where - h = 0.98 -- terminal height (%) - w = 1 -- terminal width (%) - t = 1 - h -- distance from top edge (%) - l = 1 - w -- distance from left edge (%) - manageDeluge = customFloating $ W.RationalRect l t w h - where - h = 0.98 -- terminal height (%) - w = 1 -- terminal width (%) - t = 1 - h -- distance from top edge (%) - l = 1 - w -- distance from left edge (%) - +scratchpads = [ NS "emacs-scratch" spawnEmacsScratch findEmacsScratch manageEmacsScratch + , NS "maintainance-terminal" spawnMaintainanceTerminal findMaintainanceTerminal manageMaintainanceTerminal + , NS "screen-terminal" spawnScreenTerminal findScreenTerminal manageScreenTerminal + , NS "mc-scratch" spawnMcScratch findMcScratch manageMcScratch + , NS "transmission" spawnTransmission findTransmission manageTransmission ] + where + findEmacsScratch = resource =? "emacs-scratch" + findMaintainanceTerminal = resource =? "scratchpad" + findScreenTerminal = resource =? "screen-scratch" + findMcScratch = resource =? "mc-scratch" + findTransmission = resource =? "transmission-gtk" + + spawnEmacsScratch = myTerminal ++ " -name emacs-scratch -pe -tabbedex -e emacsclient -nw" + spawnMaintainanceTerminal = myTerminal ++ " -name scratchpad" + spawnScreenTerminal = myTerminal ++ " -name screen-scratch -bg black" + spawnMcScratch = myTerminal ++ " -name mc-scratch -pe -tabbedex -e mc" + spawnTransmission = "transmission-gtk" + + manageEmacsScratch = customFloating $ W.RationalRect l t w h + where + h = 0.65 -- terminal height (%) + w = 0.55 -- terminal width (%) + t = 1 - h -- distance from top edge (%) + l = 1 - w -- distance from left edge (%) + manageMaintainanceTerminal = customFloating $ W.RationalRect l t w h + where + h = 0.33 -- terminal height (%) + w = 1 -- terminal width (%) + t = 1 - h -- distance from top edge (%) + l = 1 - w -- distance from left edge (%) + manageScreenTerminal = customFloating $ W.RationalRect l t w h + where + h = 0.98 -- terminal height (%) + w = 1 -- terminal width (%) + t = 1 - h -- distance from top edge (%) + l = 1 - w -- distance from left edge (%) + manageMcScratch = customFloating $ W.RationalRect l t w h + where + h = 0.65 -- terminal height (%) + w = 0.55 -- terminal width (%) + t = 1 - h -- distance from top edge (%) + l = 1 - w -- distance from left edge (%) + manageTransmission = customFloating $ W.RationalRect l t w h + where + h = 0.98 -- terminal height (%) + w = 1 -- terminal width (%) + t = 1 - h -- distance from top edge (%) + l = 1 - w -- distance from left edge (%) ------------------------------------------------------------------------ -- Event handling