Update arbtt config
This commit is contained in:
parent
147a919848
commit
ee58e0d517
|
@ -1,38 +1,47 @@
|
|||
let
|
||||
inherit (import (import ../nix/sources.nix).nixos-unstable { }) lib;
|
||||
inherit (import (import ../nix/sources.nix).nixos-unstable {}) lib;
|
||||
makeConfig = hostName: imports:
|
||||
{ ... }: {
|
||||
imports = imports ++ [ ./roles/default.nix ];
|
||||
m-0.hostName = hostName;
|
||||
nixpkgs.overlays = [ (_: _: (import ../channels.nix).${hostName}) ];
|
||||
};
|
||||
in {
|
||||
{ ... }: {
|
||||
imports = imports ++ [ ./roles/default.nix ];
|
||||
m-0.hostName = hostName;
|
||||
nixpkgs.overlays = [ (_: _: (import ../channels.nix).${hostName}) ];
|
||||
};
|
||||
in
|
||||
{
|
||||
apollo = let
|
||||
install = f: ({ pkgs, ... }: { home.packages = f pkgs; });
|
||||
makeAutostart = name:
|
||||
{ config, ... }: {
|
||||
config.home.file.".config/autostart/${name}.desktop".source =
|
||||
"${config.home.path}/share/applications/${name}.desktop";
|
||||
};
|
||||
{ config, ... }: {
|
||||
config.home.file.".config/autostart/${name}.desktop".source =
|
||||
"${config.home.path}/share/applications/${name}.desktop";
|
||||
};
|
||||
setStartpage = startpage:
|
||||
{ ... }: {
|
||||
programs.firefox.profiles."fz2sm95u.default".settings = {
|
||||
"browser.startup.homepage" = startpage;
|
||||
};
|
||||
{ ... }: {
|
||||
programs.firefox.profiles."fz2sm95u.default".settings = {
|
||||
"browser.startup.homepage" = startpage;
|
||||
};
|
||||
};
|
||||
makeBlock = list:
|
||||
{ pkgs, lib, ... }: {
|
||||
systemd.user.services.blockserver = {
|
||||
Unit.Description = "Serve a blocklist";
|
||||
Service = {
|
||||
ExecStart = "${pkgs.python3}/bin/python -m http.server 8842 -d ${
|
||||
pkgs.writeTextDir "blocklist" (lib.concatStringsSep "\r\n" list)
|
||||
}";
|
||||
Restart = "always";
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
{ pkgs, lib, ... }: {
|
||||
systemd.user.services.blockserver = {
|
||||
Unit.Description = "Serve a blocklist";
|
||||
Service = {
|
||||
ExecStart = "${pkgs.python3}/bin/python -m http.server 8842 -d ${
|
||||
pkgs.writeTextDir "blocklist" (lib.concatStringsSep "\r\n" list)
|
||||
}";
|
||||
Restart = "always";
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
setWorkspaceName = name:
|
||||
{ pkgs, lib, ... }: {
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/wm/preferences" = {
|
||||
workspace-names = [ name ]; # use neo
|
||||
};
|
||||
};
|
||||
};
|
||||
tinkerPages = [
|
||||
"reddit.com"
|
||||
"github.com"
|
||||
|
@ -61,30 +70,33 @@ in {
|
|||
"twitter.com"
|
||||
"chaos.social"
|
||||
];
|
||||
apolloConfig = imports:
|
||||
makeConfig "apollo" (imports ++ [
|
||||
./roles/arbtt
|
||||
./roles/zettelkasten.nix
|
||||
./roles/hoogle.nix
|
||||
./roles/battery.nix
|
||||
./roles/mpd.nix
|
||||
./roles/beets.nix
|
||||
./roles/mpclient.nix
|
||||
./roles/on-my-machine.nix
|
||||
./roles/desktop
|
||||
./roles/git-sign.nix
|
||||
./roles/laptop.nix
|
||||
./roles/mail.nix
|
||||
./roles/update_tasks.nix
|
||||
./roles/research.nix
|
||||
./roles/vdirsyncer.nix
|
||||
./roles/khard.nix
|
||||
./roles/khal.nix
|
||||
./roles/taskwarrior.nix
|
||||
./roles/taskwarrior-git.nix
|
||||
./roles/taskwarrior-notify.nix
|
||||
(makeAutostart "unlock-ssh")
|
||||
]);
|
||||
apolloConfig = name: imports:
|
||||
makeConfig "apollo" (
|
||||
imports ++ [
|
||||
./roles/arbtt
|
||||
./roles/zettelkasten.nix
|
||||
./roles/hoogle.nix
|
||||
./roles/battery.nix
|
||||
./roles/mpd.nix
|
||||
./roles/beets.nix
|
||||
./roles/mpclient.nix
|
||||
./roles/on-my-machine.nix
|
||||
./roles/desktop
|
||||
./roles/git-sign.nix
|
||||
./roles/laptop.nix
|
||||
./roles/mail.nix
|
||||
./roles/update_tasks.nix
|
||||
./roles/research.nix
|
||||
./roles/vdirsyncer.nix
|
||||
./roles/khard.nix
|
||||
./roles/khal.nix
|
||||
./roles/taskwarrior.nix
|
||||
./roles/taskwarrior-git.nix
|
||||
./roles/taskwarrior-notify.nix
|
||||
(makeAutostart "unlock-ssh")
|
||||
(setWorkspaceName name)
|
||||
]
|
||||
);
|
||||
unrestricted = [
|
||||
./roles/accounting.nix
|
||||
./roles/mail-client.nix
|
||||
|
@ -92,27 +104,28 @@ in {
|
|||
./roles/tinkering.nix
|
||||
./roles/chat.nix
|
||||
(setStartpage "https://stats.maralorn.de/d/health-status")
|
||||
(makeBlock [ ])
|
||||
(makeBlock [])
|
||||
];
|
||||
in {
|
||||
unrestricted = apolloConfig unrestricted;
|
||||
orga = apolloConfig [
|
||||
./roles/mail-client.nix
|
||||
./roles/accounting.nix
|
||||
./roles/pythia.nix
|
||||
(setStartpage "https://habitica.com")
|
||||
(makeBlock (tinkerPages ++ leisurePages))
|
||||
(makeAutostart "firefox")
|
||||
(makeAutostart "kassandra")
|
||||
(makeAutostart "kassandra2")
|
||||
(install (p: [ p.discord ])) # For teaching
|
||||
];
|
||||
research = apolloConfig [
|
||||
(makeBlock (tinkerPages ++ leisurePages))
|
||||
(setStartpage "http://localhost:8042")
|
||||
];
|
||||
gaming = apolloConfig (unrestricted ++ [ ./roles/games.nix ]);
|
||||
};
|
||||
in
|
||||
{
|
||||
unrestricted = apolloConfig "Unrestricted" unrestricted;
|
||||
orga = apolloConfig "Orga" [
|
||||
./roles/mail-client.nix
|
||||
./roles/accounting.nix
|
||||
./roles/pythia.nix
|
||||
(setStartpage "https://habitica.com")
|
||||
(makeBlock (tinkerPages ++ leisurePages))
|
||||
(makeAutostart "firefox")
|
||||
(makeAutostart "kassandra")
|
||||
(makeAutostart "kassandra2")
|
||||
(install (p: [ p.discord ])) # For teaching
|
||||
];
|
||||
research = apolloConfig "Research" [
|
||||
(makeBlock (tinkerPages ++ leisurePages))
|
||||
(setStartpage "http://localhost:8042")
|
||||
];
|
||||
gaming = apolloConfig "Gaming" (unrestricted ++ [ ./roles/games.nix ]);
|
||||
};
|
||||
hera = {
|
||||
default = makeConfig "hera" [
|
||||
./roles/on-my-machine.nix
|
||||
|
|
|
@ -1,133 +0,0 @@
|
|||
-- -*- 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,
|
|
@ -1,3 +1,3 @@
|
|||
{ pkgs, config, ... }: {
|
||||
home.file.".arbtt/categorize.cfg".source = ./categorize.cfg;
|
||||
home.file.".arbtt/categorize.cfg".source = pkgs.privateFile "arbtt/categorize.cfg";
|
||||
}
|
||||
|
|
2
private
2
private
|
@ -1 +1 @@
|
|||
Subproject commit 3329593ae81e900155b0f6ea643323e8e87321e6
|
||||
Subproject commit b8c0fbc125651a613441db84b07b87d0b47dc65d
|
Loading…
Reference in a new issue