diff options
-rw-r--r-- | .config/emacs/init.el | 28 | ||||
-rw-r--r-- | .config/gtk-3.0/settings.ini | 4 | ||||
-rw-r--r-- | .config/maildirproc/att.rc | 136 | ||||
-rw-r--r-- | .config/maildirproc/purdue.rc | 7 | ||||
-rw-r--r-- | .config/wmii-hg/config.sh | 20 | ||||
-rw-r--r-- | .config/wmii-hg/util.sh | 2 | ||||
-rwxr-xr-x | .config/wmii-hg/wmiirc | 4 | ||||
-rw-r--r-- | .gtkrc-2.0 | 2 | ||||
-rw-r--r-- | .gtkrc-2.0.mine | 2 | ||||
-rwxr-xr-x | .local/bin/pick | 4 | ||||
-rwxr-xr-x | .local/bin/x-pdf | 3 | ||||
-rwxr-xr-x | .local/bin/x-terminal-emulator | 3 | ||||
-rwxr-xr-x | .local/bin/x-www-browser | 3 |
13 files changed, 126 insertions, 92 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index f766ac5..4bce12a 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -85,7 +85,11 @@ (:name dtrt-indent :type elpa ; Detect indent style for existing files :after (dtrt-indent-mode 1)) (:name page-break-lines :type elpa ; Display form-feeds pretty - :after (global-page-break-lines-mode 1)) + :after '(lambda () + (define-global-minor-mode global-page-break-lines-mode + page-break-lines-mode page-break-lines-mode + :group 'page-break-lines) + (global-page-break-lines-mode 1))) (:name smart-tabs-mode :type elpa ; Indent with tabs, align with spaces :after (progn (smart-tabs-mode 1) @@ -124,7 +128,7 @@ (when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) -(defadvice align-regexp (around align-with-spaces) +(defadvice align-regexp (around lukeshu-align-with-spaces) (let ((indent-tabs-mode nil)) ad-do-it)) (require 'go-mode-load nil t) @@ -178,7 +182,7 @@ ;; Backup settings (setq backup-by-copying t ;; don't clobber symlinks - backup-directory-alist '(("." . (concat xdg-cache-home "emacs/saves"))) ;; don't litter my fs tree + backup-directory-alist '(("." . "~/.cache/emacs/saves")) ;; don't litter my fs tree delete-old-versions t kept-new-versions 6 kept-old-versions 2 @@ -191,6 +195,11 @@ browse-url-browser-function 'browse-url-generic ) +;; Ediff settings +(setq + ediff-window-setup-function 'ediff-setup-windows-plain + ediff-split-window-function 'split-window-horizontally + ) ;; Automatically load smerge mode for merge files (defun try-smerge-mode () @@ -233,9 +242,20 @@ )) (add-hook 'php-mode-hook - '(lambda() + '(lambda () (c-set-offset 'cpp-macro 0) )) +(add-hook 'tex-mode-hook + '(lambda () + (set (make-local-variable 'tab-always-indent) nil) + (set (make-local-variable 'indent-tabs-mode) t) + )) + +(add-hook 'sh-mode-hook + '(lambda () + (sh-electric-here-document-mode 0) + )) + (add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) (add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini index 9801ab0..78116f3 100644 --- a/.config/gtk-3.0/settings.ini +++ b/.config/gtk-3.0/settings.ini @@ -1,7 +1,7 @@ -[Settings] +[Settings] gtk-theme-name=oxygen-gtk gtk-icon-theme-name=oxygen -gtk-fallback-icon-theme=gnome +gtk-fallback-icon-theme=mate gtk-font-name=Sans 10 gtk-cursor-theme-name=Vanilla-DMZ gtk-cursor-theme-size=0 diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc index e7f581b..b8ff8f1 100644 --- a/.config/maildirproc/att.rc +++ b/.config/maildirproc/att.rc @@ -2,6 +2,7 @@ import os import subprocess +import datetime processor.maildir_base = "~/Maildir" processor.auto_reload_rcfile = True @@ -24,6 +25,9 @@ def is_to_or_from_re(mail,address): return ( mail["From"].matches(address) or mail.target.matches(address)) +def move_ham(mail,folder): + y = datetime.datetime.now().year + mail.move("FOLDERS.Ham."+str(y)+folder) def bogofilter_auto(mail): p = subprocess.Popen( @@ -57,18 +61,30 @@ def handle_incoming_spam(mail): def handle_incoming_unknown(mail): # Filter spam + # Whitelist if ( False - or mail["Subject"].contains("[systemd-devel]") - or mail["Subject"].contains("[PATCH") - or mail["Subject"].contains("[Dev]") - or mail["Subject"].contains("[Maintenance]") - or is_to_or_from(mail, "gnu.org") or is_to_or_from(mail, "fsf.org") + or is_to_or_from(mail, "gnu.org") + or is_to_or_from(mail, "parabola.nu") + or is_to_or_from(mail, "parabolagnulinux.org") + or mail["From"] == "MAILER-DAEMON@yahoo.com" + or mail["From"].contains("@facebookmail.com>") + or mail["From"].contains("@gandi.net") + or mail["From"].contains("@goodwillindy.org>") + or mail["From"].contains("@lpi.org>") + or mail["From"].contains("@msdlt.k12.in.us>") or mail["From"].contains("@parabola.nu") + or mail["From"].contains("@post.oreilly.com>") + or mail["From"].contains("@scouting.org>") + or mail["From"].contains("@wolframalpha.com>") or mail["From"].contains("parabolagnulinux.org") - or mail["From"].contains("@facebookmail.com>") or mail["List-Id"].matches(".*\.(gnu|gnome|archlinux|parabolagnulinuxlibre)\.org") + or mail["List-Id"].matches(".*\.parabola\.nu") + or mail["Subject"].contains("[Dev]") + or mail["Subject"].contains("[Maintenance]") + or mail["Subject"].contains("[PATCH") + or mail["Subject"].contains("[systemd-devel]") ): handle_incoming_ham_training(mail) return @@ -95,7 +111,7 @@ def my_filters(mail): or mail["List-Id"].matches(list+"\.gnu\.org") or mail["Subject"].contains('['+list+']') ): - mail.move("FOLDERS.Ham.software."+list) + move_ham(mail,".software."+list) return # Sort mail from other software mailing lists @@ -104,25 +120,19 @@ def my_filters(mail): or mail["List-Id"].matches("social-discuss\.gnu\.org") or mail["Subject"].contains("social-discuss") ): - mail.move("FOLDERS.Ham.software.social") + move_ham(mail,".software.social") return if mail["List-Id"].matches("networkmanager-list\.gnome\.org"): - mail.move("FOLDERS.Ham.software.networkmanager") + move_ham(mail,".software.networkmanager") return if mail["List-Id"].matches("maintenance.lists.parabolagnulinux.org"): - if mail["Subject"].matches("Cron <.*@repo>"): - mail.move("FOLDERS.Ham.software.parabola-maintenance.cron-repo") - return - if mail["Subject"].matches("Cron <.*@parabolagnulinux>"): - mail.move("FOLDERS.Ham.software.parabola-maintenance.cron-web") - return - mail.move("FOLDERS.Ham.software.parabola-maintenance") + move_ham(mail,".software.parabola.maintenance") return if is_to_or_from(mail, "labs@parabola.nu"): - mail.move("FOLDERS.Ham.software.parabola-labs") + move_ham(mail,".software.parabola.labs") return if ( @@ -133,29 +143,30 @@ def my_filters(mail): or is_to_or_from(mail, "parabola.nu") ): if mail["Subject"].contains("[Django]"): - mail.move("FOLDERS.Ham.software.parabola-maintenance.django") + move_ham(mail,".software.parabola.maintenance.django") + return + else: + move_ham(mail,".software.parabola.dev") return - mail.move("FOLDERS.Ham.software.parabola-dev") - return if (mail["List-Id"].matches("pacman-dev.archlinux.org")): - mail.move("FOLDERS.Ham.software.pacman-dev") + move_ham(mail,".software.pacman-dev") return if (mail["List-Id"].matches("systemd-devel.lists.freedesktop.org") or is_to_or_from(mail, "systemd-devel@lists.freedesktop.org")): - mail.move("FOLDERS.Ham.software.systemd-devel") + move_ham(mail,".software.systemd-devel") return for subject_re in [ "\[Stow-[^\]]*\].*", ]: if mail["Subject"].matches(subject_re): - mail.move("FOLDERS.Ham.software") + move_ham(mail,".software") return # Sort mail from some social websites if mail["From"].matches("facebook(|mail)\.com"): - mail.move("FOLDERS.Ham.Social.Facebook") + move_ham(mail,".Social.Facebook") return if ( @@ -163,15 +174,24 @@ def my_filters(mail): or mail["From"].matches("identi\.ca") or mail["From"].matches("statusnet") ): - mail.move("FOLDERS.Ham.Social.Identica") + move_ham(mail,".Social.Identica") return + if ( + False + or mail["From"].contains("@gandi.net") + or mail["From"].contains("@ramhost.us") + or mail["From"].contains("@startcom.org") + ): + move_ham(mail,".lukeshu-com") + return + if mail["From"].matches("twitter\.com"): - mail.move("FOLDERS.Ham.Social.Twitter") + move_ham(mail,".Social.Twitter") return if mail["From"].matches("@xkcd\.com"): - mail.move("FOLDERS.Ham.Social.xkcd") + move_ham(mail,".Social.xkcd") return # Sort mail related to Troop 276 @@ -195,30 +215,24 @@ def my_filters(mail): or is_to_or_from(mail,"mytroop.us") or is_to_or_from(mail,"crossroadsbsa.org") ): - mail.move("FOLDERS.Ham.BoyScouts") + move_ham(mail,".BoyScouts") return # Sort mail from misc people - if mail["From"].matches("margieshu@sbcglobal\.net"): - mail.move("FOLDERS.Ham.misc.Mom") + if ( + False + or is_to_or_from(mail,"margieshu@sbcglobal.net") + or is_to_or_from(mail,"3174451635@mms.att.net") + ): + move_ham(mail,".misc.Mom") return for address in [ - "justicejade10@aol.com", - "parsonsjade@aol.com", - "parsonstjade@gmail.com", - "jadparso@umail.iu.edu", - ]: - if is_to_or_from(mail,address): - mail.move("FOLDERS.Ham.misc.Jade") - return - - for address in [ "nintendo.com", "nintendo-news.com", ]: if mail["From"].contains(address): - mail.move("FOLDERS.Ham.misc.Nintendo") + move_ham(mail,".misc.Nintendo") return for address in [ @@ -227,7 +241,7 @@ def my_filters(mail): "CompTIA", ]: if mail["From"].contains(address): - mail.move("FOLDERS.Ham.misc.CompTIA") + move_ham(mail,".misc.CompTIA") return # Sort mail from FRC people @@ -252,15 +266,16 @@ def my_filters(mail): "william.walk@gmail.com", ]: if is_to_or_from(mail,address): - mail.move("FOLDERS.Ham.School.Robotics") + move_ham(mail,".School.Robotics") return for subject_re in [ "robotics", - "1024", + "\b1024\b", + "\b4272\b", "kil-?a-?bytes", ]: if mail["Subject"].matches(subject_re): - mail.move("FOLDERS.Ham.School.Robotics") + move_ham(mail,".School.Robotics") return # Sort mail from software people @@ -282,7 +297,7 @@ def my_filters(mail): "trustees@core3.amsl.com", ]: if is_to_or_from(mail,address): - mail.move("FOLDERS.Ham.software") + move_ham(mail,".software") return @@ -292,16 +307,16 @@ def my_filters(mail): or is_to_or_from(mail, "@lnnorthstar.org") or is_to_or_from(mail, "lnnorthstar.org@tigertech.net") ): - mail.move("FOLDERS.Ham.School.Newspaper") + move_ham(mail,".School.Newspaper") return # Sort mail from various employers/people who pay me if is_to_or_from(mail, "@precisepath.com"): - mail.move("FOLDERS.Ham.Work.PrecisePath") + move_ham(mail,".Work.PrecisePath") return if is_to_or_from(mail,"susyphil@aol.com"): - mail.move("FOLDERS.Ham.Work.PMCH") + move_ham(mail,".Work.PMCH") for address in [ "d.farrar@comcast.net", @@ -309,7 +324,7 @@ def my_filters(mail): "@vmware.com", ]: if is_to_or_from(mail,address): - mail.move("FOLDERS.Ham.Work.FAST") + move_ham(mail,".Work.FAST") return # Sort misc newsletters @@ -323,7 +338,7 @@ def my_filters(mail): or mail["From"].contains("info@demandprogress.org") or (mail["From"].contains("@sparkfun.com") and mail["Message-Id"].contains("rsgsv.net")) ): - mail.move("FOLDERS.Ham.misc.Newsletters") + move_ham(mail,".misc.Newsletters") return if ( @@ -339,7 +354,7 @@ def my_filters(mail): or mail["Subject"].contains("NHS") or mail["Subject"].contains("National Honor Society") ): - mail.move("FOLDERS.Ham.School") + move_ham(mail,".School") return # from college stuff @@ -348,44 +363,41 @@ def my_filters(mail): or mail["Subject"].contains("NYLF") # National Youth Leadership Conference or mail["Subject"].contains("NSHSS") ): - mail.move("FOLDERS.Ham.College.Societies") + move_ham(mail,".College.Societies") return if ( False - #or mail["From"].contains(".edu") or mail["From"].contains("admissions@") - #or mail["From"].contains("college") - #or mail["From"].contains("university") or mail["Subject"].contains("college") # now we get to the BS or mail["From"].contains("@dreamitdoitindiana.com") or mail["From"].contains("@indianatechinfo.org") ): - mail.move("FOLDERS.Ham.College") + move_ham(mail,".College") return if mail["From"].contains("@projectwonderful.com"): - mail.move("FOLDERS.Ham.misc.ProjectWonderful") + move_ham(mail,".misc.ProjectWonderful") return if ( False or mail["From"].matches("@localhost") or mail["From"].matches("@[^,>]*\.local") - or mail["From"].matches("@[^,>]*\.lukeshu\.ath\.cx") + or mail["From"].matches("@[^,>]*\.lan") or mail["To"].matches("luke@") ): - mail.move("FOLDERS.Ham.LocalSystems") + move_ham(mail,".LocalSystems") return if ( False or mail["Subject"].contains("password") or mail["Subject"].contains("account") ): - mail.move("FOLDERS.Ham.misc.accounts") + move_ham(mail,".misc.accounts") return - mail.move("FOLDERS.Ham") + move_ham(mail,"") handle_mapping = { "Inbox": handle_incoming_unknown, diff --git a/.config/maildirproc/purdue.rc b/.config/maildirproc/purdue.rc index 7b75d7c..61c264c 100644 --- a/.config/maildirproc/purdue.rc +++ b/.config/maildirproc/purdue.rc @@ -79,6 +79,7 @@ def my_filters(mail): or is_to_or_from(mail, "@duke-energy.com") or is_to_or_from(mail, "@alerts.comcast.net") or is_to_or_from(mail, "rentpayment.com") + or is_to_or_from(mail, "@vectren.com") ): mail.move("INBOX.housing.BeauJardin") return @@ -214,7 +215,11 @@ def my_filters(mail): mail.move("INBOX.classes.2014-2.MA416") return # PHYS221 - if (is_to_or_from(mail, "cui@purdue.edu") or is_to_or_from(mail, "china@purdue.edu")): + if (False + or is_to_or_from(mail, "cui@purdue.edu") + or is_to_or_from(mail, "shina@purdue.edu") + or is_to_or_from(mail, "ajith@purdue.edu") + ): mail.move("INBOX.classes.2014-2.PHYS221") return handle_mapping = { diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 3b1b20f..c560f3f 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -7,7 +7,7 @@ LEFT=b RIGHT=f HIST="$XDG_CACHE_HOME/wmii/history" -mkdir -p "${HIST%/*}" +mkdir -p -- "${HIST%/*}" # Colors tuples: "<text> <background> <border>" . theme-tango-dark @@ -43,12 +43,12 @@ Event() { find $WMII_DIR/{l,r}bar -type f -delete # Populate the LBar by emulating [Create|Focus]Tag events seltag=`sed 1q $WMII_DIR/tag/sel/ctl` - lstags | while read tag; do + while read -r tag; do Event CreateTag "$tag" if [ "$tag" = "$seltag" ]; then Event FocusTag "$tag" fi - done + done < <(lstags) # Run the autostart action Action autostart 2>/dev/null & @@ -138,13 +138,13 @@ Event() { DestroyTag) ## $1=tag rm $WMII_DIR/lbar/$1;; FocusTag) ## $1=tag - echo colors "$WMII_FOCUSCOLORS" >> $WMII_DIR/lbar/$1;; + echo colors "$WMII_FOCUSCOLORS" >> $WMII_DIR/lbar/$1;; UnfocusTag) ## $1=tag - echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; + echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; UrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_URGENTCOLORS" >> $WMII_DIR/lbar/$1;; + echo colors "$WMII_URGENTCOLORS" >> $WMII_DIR/lbar/$1;; NotUrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; + echo colors "$WMII_NORMCOLORS" >> $WMII_DIR/lbar/$1;; ## LeftBar events (usually tag buttons) LeftBarMouseDown) ## $1=button $2=bar_item @@ -219,15 +219,15 @@ Key() { $MODKEY-a) ## Open wmii actions menu Action $(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000) & ;; $MODKEY-x) ## Open program menu - PATH=$_PATH setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000) & ;; + (PATH=$_PATH exec setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)) & ;; $MODKEY-Return) ## Launch a terminal - PATH=$_PATH setsid x-terminal-emulator & ;; + (PATH=$_PATH exec setsid x-terminal-emulator) & ;; ## Tag actions $MODKEY-t) ## Change to another tag { tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo view $tag >> $WMII_DIR/ctl + echo view $tag >> $WMII_DIR/ctl }& ;; $MODKEY-Shift-t) ## Retag the selected client sel=$(sed 1q $WMII_DIR/client/sel/ctl) diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index f15031e..2211d28 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -71,7 +71,7 @@ path_which() { # Lists wmii tags ## lstags() { - ls "$WMII_DIR/tag" | sed -e 's@/$@@' -e '/^sel$/d' + ls "$WMII_DIR/tag" | sed -e 's,/$,,' -e '/^sel$/d' } ################################################################################ diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc index a7dd80c..a6585de 100755 --- a/.config/wmii-hg/wmiirc +++ b/.config/wmii-hg/wmiirc @@ -13,6 +13,6 @@ Event WmiircStart trap "Event Quit" EXIT -wmiir read /event 2>/dev/null | while read event; do +while read -r event; do Event $event -done +done < <(wmiir read /event 2>/dev/null) @@ -1,6 +1,7 @@ # DO NOT EDIT! This file will be overwritten by LXAppearance. # Any customization should be done in ~/.gtkrc-2.0.mine instead. +include "/home/luke/.gtkrc-2.0.mine" gtk-theme-name="oxygen-gtk" gtk-icon-theme-name="oxygen" gtk-font-name="Sans 10" @@ -16,4 +17,3 @@ gtk-xft-antialias=1 gtk-xft-hinting=1 gtk-xft-hintstyle="hintfull" gtk-xft-rgba="rgb" -include "/home/luke/.gtkrc-2.0.mine" diff --git a/.gtkrc-2.0.mine b/.gtkrc-2.0.mine index 4e2ef9a..3cb099a 100644 --- a/.gtkrc-2.0.mine +++ b/.gtkrc-2.0.mine @@ -1 +1 @@ -gtk-fallback-icon-theme="gnome" +gtk-fallback-icon-theme="mate" diff --git a/.local/bin/pick b/.local/bin/pick index ed2d44d..6dc905f 100755 --- a/.local/bin/pick +++ b/.local/bin/pick @@ -19,7 +19,7 @@ if [[ $1 = -s ]]; then shift # Scan to find a running instance for prog in "$@"; do - if [[ -n "`pgrep $prog`" ]]; then + if [[ -n "$(pgrep "${prog%% *}")" ]]; then printf '%s\n' "$prog" exit 0 fi @@ -28,7 +28,7 @@ fi # Scan to find one that is installed for prog in "$@"; do - if [[ -x "`which $prog 2>/dev/null`" ]]; then + if [[ -x "$(which "${prog%% *}" 2>/dev/null)" ]]; then printf '%s\n' "$prog" exit 0 fi diff --git a/.local/bin/x-pdf b/.local/bin/x-pdf index 3610fde..cfaa258 100755 --- a/.local/bin/x-pdf +++ b/.local/bin/x-pdf @@ -1,4 +1,3 @@ #!/bin/sh -`pick zathura mupdf okular evince xpdf` "$@" -exit $? +eval $(pick atril zathura mupdf okular evince xpdf 'emacsclient -c') "$@" diff --git a/.local/bin/x-terminal-emulator b/.local/bin/x-terminal-emulator index 049b081..075dda5 100755 --- a/.local/bin/x-terminal-emulator +++ b/.local/bin/x-terminal-emulator @@ -1,4 +1,3 @@ #!/bin/sh -`pick emacsterm urxvt gnome-terminal xterm` "$@" -exit $? +eval $(pick 'emacsterm -c' 'urxvt' 'xterm' 'gnome-terminal') "$@" diff --git a/.local/bin/x-www-browser b/.local/bin/x-www-browser index bbd8943..945dcfc 100755 --- a/.local/bin/x-www-browser +++ b/.local/bin/x-www-browser @@ -1,4 +1,3 @@ #!/bin/sh -`pick -s conkeror iceweasel icecat firefox` "$@" -exit $? +eval $(pick -s iceweasel icecat firefox conkeror) "$@" |