Install arbtt config
This commit is contained in:
parent
063af68e7b
commit
147a919848
|
@ -63,6 +63,7 @@ in {
|
|||
];
|
||||
apolloConfig = imports:
|
||||
makeConfig "apollo" (imports ++ [
|
||||
./roles/arbtt
|
||||
./roles/zettelkasten.nix
|
||||
./roles/hoogle.nix
|
||||
./roles/battery.nix
|
||||
|
|
133
home-manager/roles/arbtt/categorize.cfg
Normal file
133
home-manager/roles/arbtt/categorize.cfg
Normal file
|
@ -0,0 +1,133 @@
|
|||
-- -*- mode: haskell; -*-
|
||||
-- Comments in this file use the Haskell syntax:
|
||||
-- A "--" comments the rest of the line.
|
||||
-- A set of {- ... -} comments out a group of lines.
|
||||
|
||||
-- This defines some aliases, to make the reports look nicer:
|
||||
aliases (
|
||||
"sun-awt-X11-XFramePeer" -> "java",
|
||||
"sun-awt-X11-XDialogPeer" -> "java",
|
||||
"sun-awt-X11-XWindowPeer" -> "java",
|
||||
"gramps.py" -> "gramps",
|
||||
"___nforschung" -> "ahnenforschung",
|
||||
"Pidgin" -> "pidgin"
|
||||
)
|
||||
|
||||
-- A rule that probably everybody wants. Being inactive for over a minute
|
||||
-- causes this sample to be ignored by default.
|
||||
$idle > 120 ==> tag inactive,
|
||||
|
||||
-- A rule that matches on a list of strings
|
||||
current window $program == ["Navigator","galeon"] ==> tag Web,
|
||||
|
||||
-- Use condition bindings to reduce duplication
|
||||
condition isJava = current window $program ==
|
||||
["sun-awt-X11-XFramePeer", "sun-awt-X11-XDialogPeer", "sun-awt-X11-XWindowPeer"]
|
||||
in $isJava && current window $title == "I3P" ==> tag Program:I3P,
|
||||
|
||||
current window $program == "sun-awt-X11-XDialogPeer" &&
|
||||
current window $title == " " &&
|
||||
any window $title == "I3P"
|
||||
==> tag Program:I3P,
|
||||
|
||||
-- Simple rule that just tags the current program
|
||||
tag Program:$current.program,
|
||||
|
||||
-- Another simple rule, just tags the current desktop (a.k.a. workspace)
|
||||
--tag Desktop:$desktop,
|
||||
|
||||
-- I'd like to know what evolution folders I'm working in. But when sending a
|
||||
-- mail, the window title only contains the (not very helpful) subject. So I do
|
||||
-- not tag necessarily by the active window title, but the title that contains
|
||||
-- the folder
|
||||
current window $program == "evolution" &&
|
||||
any window ($program == "evolution" && $title =~ /^(.*) \([0-9]+/)
|
||||
==> tag Evo-Folder:$1,
|
||||
|
||||
-- A general rule that works well with gvim and gnome-terminal and tells me
|
||||
-- what project I'm currently working on
|
||||
current window $title =~ m!(?:~|home/jojo)/projekte/(?:programming/(?:haskell/)?)?([^/)]*)!
|
||||
==> tag Project:$1,
|
||||
current window $title =~ m!(?:~|home/jojo)/debian!
|
||||
==> tag Project:Debian,
|
||||
|
||||
-- This was a frequently looked-at pdf-File
|
||||
current window $title =~ m!output.pdf! &&
|
||||
any window ($title =~ /nforschung/)
|
||||
==> tag Project:ahnenforschung,
|
||||
|
||||
|
||||
-- My diploma thesis is in a different directory
|
||||
current window $title =~ [ m!(?:~|home/jojo)/dokumente/Uni/DA!
|
||||
, m!Diplomarbeit.pdf!
|
||||
, m!LoopSubgroupPaper.pdf! ]
|
||||
==> tag Project:DA,
|
||||
|
||||
current window $title =~ m!TDM!
|
||||
==> tag Project:TDM,
|
||||
|
||||
( $date >= 2010-08-01 &&
|
||||
$date <= 2010-12-01 &&
|
||||
( current window $program == "sun-awt-X11-XFramePeer" &&
|
||||
current window $title == "I3P" ||
|
||||
current window $program == "sun-awt-X11-XDialogPeer" &&
|
||||
current window $title == " " &&
|
||||
any window $title == "I3P" ||
|
||||
current window $title =~ m!(?:~|home/jojo)/dokumente/Uni/SA! ||
|
||||
current window $title =~ m!Isabelle200! ||
|
||||
current window $title =~ m!isar-ref.pdf! ||
|
||||
current window $title =~ m!document.pdf! ||
|
||||
current window $title =~ m!outline.pdf! ||
|
||||
current window $title =~ m!Studienarbeit.pdf! )
|
||||
) ==> tag Project:SA,
|
||||
|
||||
|
||||
-- Out of curiosity: what percentage of my time am I actually coding Haskell?
|
||||
current window ($program == "gvim" && $title =~ /^[^ ]+\.hs \(/ )
|
||||
==> tag Editing-Haskell,
|
||||
|
||||
-- Example of time-related rules. I do not use these myself.
|
||||
|
||||
-- To be able to match on the time of day, I introduce tags for that as well.
|
||||
-- $time evaluates to local time.
|
||||
$time >= 1:00 && $time < 2:00 ==> tag time-of-day:bed-time,
|
||||
$time >= 2:00 && $time < 6:00 ==> tag time-of-day:night,
|
||||
$time >= 6:00 && $time < 10:00 ==> tag time-of-day:early-morning,
|
||||
$time >= 10:00 && $time < 11:00 ==> tag time-of-day:breakfast,
|
||||
$time >= 11:00 && $time < 15:00 ==> tag time-of-day:noon,
|
||||
$time >= 15:00 && $time < 19:00 ==> tag time-of-day:afternoon,
|
||||
$time >= 19:00 || $time < 1:00 ==> tag time-of-day:evening,
|
||||
|
||||
-- This tag always refers to the last 24h
|
||||
$sampleage <= 24:00 ==> tag last-day,
|
||||
|
||||
-- To categorize by calendar periods (months, weeks, or arbitrary periods),
|
||||
-- I use $date variable, and some auxiliary functions. All these functions
|
||||
-- evaluate dates in local time. Set TZ environment variable if you need
|
||||
-- statistics in a different time zone.
|
||||
|
||||
-- You can compare dates:
|
||||
--$date >= 2001-01-01 ==> tag this_century,
|
||||
-- You have to write them in YYYY-MM-DD format, else they will not be recognized.
|
||||
|
||||
-- “format $date” produces a string with the date in ISO 8601 format
|
||||
-- (YYYY-MM-DD), it may be compared with strings. For example, to match
|
||||
-- everything on and after a particular date I can use
|
||||
-- format $date =~ /.*-03-19/ ==> tag period:on_a_special_day,
|
||||
-- but note that this is a rather expensive operation and will slow down your
|
||||
-- data processing considerably.
|
||||
|
||||
-- “day of month $date” gives the day of month (1..31),
|
||||
-- “day of week $date” gives a sequence number of the day of week
|
||||
-- (1..7, Monday is 1):
|
||||
-- (day of month $date == 13) && (day of week $date == 5) ==> tag day:friday_13,
|
||||
|
||||
-- “month $date” gives a month number (1..12), “year $date” gives a year:
|
||||
-- month $date == 1 ==> tag month:January,
|
||||
-- month $date == 2 ==> tag month:February,
|
||||
-- year $date == 2010 ==> tag year:2010,
|
||||
|
||||
-- “$now” evaluates to the current time
|
||||
-- day of month $now == day of month $date ==> tag current-day,
|
||||
-- month $now == month $date ==> tag current-month,
|
||||
-- year $now == year $date ==> tag current-year,
|
3
home-manager/roles/arbtt/default.nix
Normal file
3
home-manager/roles/arbtt/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{ pkgs, config, ... }: {
|
||||
home.file.".arbtt/categorize.cfg".source = ./categorize.cfg;
|
||||
}
|
Loading…
Reference in a new issue