summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--].config/X11/clientrc0
-rw-r--r--.config/maildirproc/att.rc37
-rw-r--r--.config/maildirproc/purdue.rc56
-rw-r--r--.config/systemd/user/vncserver@.service1
-rw-r--r--.config/systemd/user/x0vncserver@.service1
-rwxr-xr-x.local/bin/pick6
6 files changed, 80 insertions, 21 deletions
diff --git a/.config/X11/clientrc b/.config/X11/clientrc
index d18d714..d18d714 100644..100755
--- a/.config/X11/clientrc
+++ b/.config/X11/clientrc
diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc
index b8ff8f1..6b31260 100644
--- a/.config/maildirproc/att.rc
+++ b/.config/maildirproc/att.rc
@@ -1,6 +1,7 @@
# -*- mode: python; indent-tabs-mode: t -*-
import os
+import os.path
import subprocess
import datetime
@@ -27,7 +28,14 @@ def is_to_or_from_re(mail,address):
or mail.target.matches(address))
def move_ham(mail,folder):
y = datetime.datetime.now().year
- mail.move("FOLDERS.Ham."+str(y)+folder)
+ folder = "FOLDERS.Ham."+str(y)+folder
+ dir = processor.maildir_base+"/"+folder
+ if not os.path.isfile(dir+"/maildirfolder"):
+ os.makedirs(dir+"/tmp", 0o777, True)
+ os.makedirs(dir+"/new", 0o777, True)
+ os.makedirs(dir+"/cur", 0o777, True)
+ open(dir+"/maildirfolder", 'a').close()
+ mail.move(folder)
def bogofilter_auto(mail):
p = subprocess.Popen(
@@ -127,7 +135,7 @@ def my_filters(mail):
move_ham(mail,".software.networkmanager")
return
- if mail["List-Id"].matches("maintenance.lists.parabolagnulinux.org"):
+ if mail["List-Id"].matches("maintenance\.lists\.parabola(gnulinux\.org|\.nu)"):
move_ham(mail,".software.parabola.maintenance")
return
@@ -137,7 +145,8 @@ def my_filters(mail):
if (
False
- or mail["List-Id"].matches("parabolagnulinux.org")
+ or mail["List-Id"].matches("parabolagnulinux\.org")
+ or mail["List-Id"].matches("parabola\.nu")
or is_to_or_from(mail, "parabolagnulinux.org")
or is_to_or_from(mail, "kiwwwi.com.ar")
or is_to_or_from(mail, "parabola.nu")
@@ -281,19 +290,19 @@ def my_filters(mail):
# Sort mail from software people
for address in [
"@archlinux.org",
+ "@canonical.org",
+ "@cnuk.org",
+ "@eff.org",
+ "@foocorp.net",
"@fsf.org",
"@github.com",
- "canonical.org",
- "cnuk.org",
- "eff.org",
- "esr@thyrsus.com",
- "foocorp.net",
- "gitorious.org",
- "gnome.org",
- "gnu.org",
- "ietf.org",
- "kde.org",
- "sourceforge.com",
+ "@gitorious.org",
+ "@gnome.org",
+ "@gnu.org",
+ "@ietf.org",
+ "@kde.org",
+ "@sourceforge.com",
+ "@thyrsus.com",
"trustees@core3.amsl.com",
]:
if is_to_or_from(mail,address):
diff --git a/.config/maildirproc/purdue.rc b/.config/maildirproc/purdue.rc
index 61c264c..9f6bf37 100644
--- a/.config/maildirproc/purdue.rc
+++ b/.config/maildirproc/purdue.rc
@@ -88,12 +88,20 @@ def my_filters(mail):
mail.move("INBOX.crap.Facebook")
return
+ if is_to_or_from(mail,"@cerias.purdue.edu"):
+ mail.move("INBOX.crap.CERIAS")
+ return
+
+ if is_to_or_from(mail,"royfu@purdue.edu"):
+ mail.move("INBOX.crap.Hackers")
+ return
+
if (
False
or is_to_or_from(mail,"@cable.comcast.com")
or is_to_or_from(mail,"@apexsystemsinc.com")
):
- mail.move("INBOX.work.Comcast")
+ mail.move("INBOX.work.2013.Comcast")
return
if (
@@ -109,20 +117,24 @@ def my_filters(mail):
# Fall 2012 ############################################################
+ # SCI210 (Teaming principles)
if mail["Subject"].contains("Fall-2012-SCI-21000-001:"):
mail.move("INBOX.classes.2012-2.SCI210")
+ # CS180 (Java)
if mail["Subject"].contains("fall-2012-cs-18000"):
mail.move("INBOX.classes.2012-2.CS180")
return
if piazza_topic(mail, "CS 18000"):
mail.move("INBOX.classes.2012-2.CS180.Piazza")
return
+ # SOC100
if mail["Subject"].contains("Fall-2012-SOC-10000"):
mail.move("INBOX.classes.2012-2.SOC100")
return
# Spring 2013 ##########################################################
+ # CS240 (C)
if mail["Subject"].contains("[CS240] Submission result for"):
mail.move("INBOX.classes.2013-1.CS240.autograder")
return
@@ -132,33 +144,40 @@ def my_filters(mail):
if piazza_topic(mail, "CS 240"):
mail.move("INBOX.classes.2013-1.CS240.Piazza")
return
+ # PHYS220
if mail["Subject"].matches(".*(PHYS|CHIP)\s*220.*") or is_to_or_from(mail,"srdas@purdue.edu"):
mail.move("INBOX.classes.2013-1.PHYS220")
return
+ # SOC220 (Social Problems)
if mail["Subject"].contains("Spring-2013-SOC-22000"):
mail.move("INBOX.classes.2013-1.SOC220")
return
# Fall 2013 ############################################################
+ # CS250 (Computer Architecture)
if mail["Subject"].contains("Fall-2013-CS-25000"):
mail.move("INBOX.classes.2013-2.CS250")
return
if piazza_topic(mail, "CS 250") or piazza_topic(mail, "CS 250-FALL2013"):
mail.move("INBOX.classes.2013-2.CS250.Piazza")
return
+ # CS251 (Intro Algo)
if mail["Subject"].contains("Fall-2013-CS-25100"):
mail.move("INBOX.classes.2013-2.CS251")
return
if piazza_topic(mail, "CS 251"):
mail.move("INBOX.classes.2013-2.CS251.Piazza")
return
+ # SPAN101
if mail["Subject"].contains("Fall-2013-SPAN-10100"):
mail.move("INBOX.classes.2013-2.SPAN101")
return
+ # MA261 (Calc III)
if mail["Subject"].contains("Fall-2013-MA-26100"):
mail.move("INBOX.classes.2013-2.MA261")
return
+ # MA265 (Linear Algebra)
if mail["Subject"].contains("Fall-2013-MA-26500"):
mail.move("INBOX.classes.2013-2.MA265")
return
@@ -172,11 +191,11 @@ def my_filters(mail):
if mail["From"].contains("mixable") and mail["Subject"].matches("^COM 21700"):
mail.move("INBOX.classes.2014-1.COM217.Mixable")
return
- # CS252
+ # CS252 (Systems Programming)
if piazza_topic(mail, "CS 25200"):
mail.move("INBOX.classes.2014-1.CS252.Piazza")
return
- # CS307
+ # CS307 (Software Engineering)
if is_to_or_from(mail, "dunsmore@purdue.edu") or mail["Subject"].contains("Spring-2014-CS-30700-LE1"):
mail.move("INBOX.classes.2014-1.CS307")
return
@@ -199,10 +218,10 @@ def my_filters(mail):
mail.move("INBOX.classes.2014-2.CS334")
return
# CS354 (OS)
- # CS381 (Algo)
if piazza_topic(mail, "CS 354"):
mail.move("INBOX.classes.2014-2.CS354.Piazza")
return
+ # CS381 (Algo)
if piazza_topic(mail, "CS 381"):
mail.move("INBOX.classes.2014-2.CS381.Piazza")
return
@@ -222,6 +241,35 @@ def my_filters(mail):
):
mail.move("INBOX.classes.2014-2.PHYS221")
return
+
+ # Spring 2015 #########################################################
+
+ # CS352 (Compilers)
+ if is_to_or_from(mail, "wjg@cs.purdue.edu"):
+ mail.move("INBOX.classes.2015-1.CS352")
+ return
+ if piazza_topic(mail, "CS 352"):
+ mail.move("INBOX.classes.2015-1.CS352.Piazza")
+ return
+ # CS408 (Software testing)
+ if (False
+ or mail["Subject"].contains("spring-2015-cs-40800")
+ or is_to_or_from(mail, "li1471@purdue.edu")
+ or is_to_or_from(mail, "kirby@purdue.edu")
+ or is_to_or_from(mail, "webb39@purdue.edu")
+ or is_to_or_from(mail, "Jkou@purdue.edu")
+ or is_to_or_from(mail, "nstodda@purdue.edu")
+ or is_to_or_from(mail, "aryker@purdue.edu") # TA
+ ):
+ mail.move("INBOX.classes.2015-1.CS408")
+ return
+ # CS448 (Databases)
+ # ME297 (FRC)
+ if mail["Subject"].contains("[ME297]"):
+ mail.move("INBOX.classes.2015-1.ME297")
+ return
+ # SOC324 (Criminology)
+
handle_mapping = {
"INBOX": my_filters,
}
diff --git a/.config/systemd/user/vncserver@.service b/.config/systemd/user/vncserver@.service
index ef83ef2..8c1d818 100644
--- a/.config/systemd/user/vncserver@.service
+++ b/.config/systemd/user/vncserver@.service
@@ -1,5 +1,6 @@
[Unit]
Description=VNC desktop
+Conflicts=x0vncserver@%i.service
[Service]
Type=simple
diff --git a/.config/systemd/user/x0vncserver@.service b/.config/systemd/user/x0vncserver@.service
index 476e822..02165a7 100644
--- a/.config/systemd/user/x0vncserver@.service
+++ b/.config/systemd/user/x0vncserver@.service
@@ -1,5 +1,6 @@
[Unit]
Description=VNC server for X displays
+Conflicts=vncserver@%i.service
[Service]
Type=simple
diff --git a/.local/bin/pick b/.local/bin/pick
index 6dc905f..7458041 100755
--- a/.local/bin/pick
+++ b/.local/bin/pick
@@ -20,7 +20,7 @@ if [[ $1 = -s ]]; then
# Scan to find a running instance
for prog in "$@"; do
if [[ -n "$(pgrep "${prog%% *}")" ]]; then
- printf '%s\n' "$prog"
+ printf -- '%s\n' "$prog"
exit 0
fi
done
@@ -29,10 +29,10 @@ fi
# Scan to find one that is installed
for prog in "$@"; do
if [[ -x "$(which "${prog%% *}" 2>/dev/null)" ]]; then
- printf '%s\n' "$prog"
+ printf -- '%s\n' "$prog"
exit 0
fi
done
-printf '%s\n' "$cmd: no suitable program found"
+printf -- '%s\n' "$cmd: no suitable program found" >&2
exit 1