1 -- -*- mode: haskell; -*-
2 -- Comments in this file use the Haskell syntax:
3 -- A "--" comments the rest of the line.
4 -- A set of {- ... -} comments out a group of lines.
6 -- This defines some aliases, to make the reports look nicer:
8 "sun-awt-X11-XFramePeer" -> "java",
9 "sun-awt-X11-XDialogPeer" -> "java",
10 "sun-awt-X11-XWindowPeer" -> "java",
11 "gramps.py" -> "gramps",
12 "___nforschung" -> "ahnenforschung",
16 -- A rule that probably everybody wants. Being inactive for over a minute
17 -- causes this sample to be ignored by default.
18 $idle > 60 ==> tag inactive,
20 -- A rule that matches on a list of strings
21 current window $program == ["Navigator","galeon"] ==> tag Web,
23 current window $program == "sun-awt-X11-XFramePeer" &&
24 current window $title == "I3P"
27 current window $program == "sun-awt-X11-XDialogPeer" &&
28 current window $title == " " &&
29 any window $title == "I3P"
32 -- Simple rule that just tags the current program
33 tag Program:$current.program,
35 -- Another simple rule, just tags the current desktop (a.k.a. workspace)
38 -- I'd like to know what evolution folders I'm working in. But when sending a
39 -- mail, the window title only contains the (not very helpful) subject. So I do
40 -- not tag necessarily by the active window title, but the title that contains
42 current window $program == "evolution" &&
43 any window ($program == "evolution" && $title =~ /^(.*) \([0-9]+/)
44 ==> tag Evo-Folder:$1,
46 -- A general rule that works well with gvim and gnome-terminal and tells me
47 -- what project I'm currently working on
48 current window $title =~ m!(?:~|home/jojo)/projekte/(?:programming/(?:haskell/)?)?([^/)]*)!
50 current window $title =~ m!(?:~|home/jojo)/debian!
51 ==> tag Project:Debian,
53 -- This was a frequently looked-at pdf-File
54 current window $title =~ m!output.pdf! &&
55 any window ($title =~ /nforschung/)
56 ==> tag Project:ahnenforschung,
59 -- My diploma thesis is in a different directory
60 current window $title =~ [ m!(?:~|home/jojo)/dokumente/Uni/DA!
62 , m!LoopSubgroupPaper.pdf! ]
65 current window $title =~ m!TDM!
68 ( $date >= 2010-08-01 &&
69 $date <= 2010-12-01 &&
70 ( current window $program == "sun-awt-X11-XFramePeer" &&
71 current window $title == "I3P" ||
72 current window $program == "sun-awt-X11-XDialogPeer" &&
73 current window $title == " " &&
74 any window $title == "I3P" ||
75 current window $title =~ m!(?:~|home/jojo)/dokumente/Uni/SA! ||
76 current window $title =~ m!Isabelle200! ||
77 current window $title =~ m!isar-ref.pdf! ||
78 current window $title =~ m!document.pdf! ||
79 current window $title =~ m!outline.pdf! ||
80 current window $title =~ m!Studienarbeit.pdf! )
84 -- Out of curiosity: what percentage of my time am I actually coding Haskell?
85 current window ($program == "gvim" && $title =~ /^[^ ]+\.hs \(/ )
86 ==> tag Editing-Haskell,
89 -- Example of time-related rules. I do not use these myself.
91 -- To be able to match on the time of day, I introduce tags for that as well.
92 -- $time evaluates to local time.
93 $time >= 2:00 && $time < 8:00 ==> tag time-of-day:night,
94 $time >= 8:00 && $time < 12:00 ==> tag time-of-day:morning,
95 $time >= 12:00 && $time < 14:00 ==> tag time-of-day:lunchtime,
96 $time >= 14:00 && $time < 18:00 ==> tag time-of-day:afternoon,
97 $time >= 18:00 && $time < 22:00 ==> tag time-of-day:evening,
98 $time >= 22:00 || $time < 2:00 ==> tag time-of-day:late-evening,
100 -- This tag always refers to the last 24h
101 $sampleage <= 24:00 ==> tag last-day,
103 -- To categorize by calendar periods (months, weeks, or arbitrary periods),
104 -- I use $date variable, and some auxiliary functions. All these functions
105 -- evaluate dates in local time. Set TZ environment variable if you need
106 -- statistics in a different time zone.
108 -- You can compare dates:
109 $date >= 2001-01-01 ==> tag this_century,
110 -- You have to write them in YYYY-MM-DD format, else they will not be recognized.
112 -- “format $date” produces a string with the date in ISO 8601 format
113 -- (YYYY-MM-DD), it may be compared with strings. For example, to match
114 -- everything on and after a particular date I can use
115 format $date =~ ".*-03-19" ==> tag period:on_a_special_day,
116 -- but note that this is a rather expensive operation and will slow down your
117 -- data processing considerably.
119 -- “day of month $date” gives the day of month (1..31),
120 -- “day of week $date” gives a sequence number of the day of week
121 -- (1..7, Monday is 1):
122 (day of month $date == 13) && (day of week $date == 5) ==> tag day:friday_13,
124 -- “month $date” gives a month number (1..12), “year $date” gives a year:
125 month $date == 1 ==> tag month:January,
126 month $date == 2 ==> tag month:February,
127 year $date == 2010 ==> tag year:2010,
129 -- “$now” evaluates to the current time
130 day of month $now == day of month $date ==> tag current-day,
131 month $now == month $date ==> tag current-month,
132 year $now == year $date ==> tag current-year,