Remove a lot of eventd, fix mako
This commit is contained in:
parent
b1140900bc
commit
60458fbcf3
8 changed files with 9 additions and 188 deletions
|
@ -1,6 +1,5 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
let
|
let
|
||||||
inherit (import ../pkgs) eventd;
|
|
||||||
battery-watch = pkgs.writeScript "battery-watch" ''
|
battery-watch = pkgs.writeScript "battery-watch" ''
|
||||||
#!${pkgs.stdenv.shell}
|
#!${pkgs.stdenv.shell}
|
||||||
|
|
||||||
|
@ -13,9 +12,9 @@ let
|
||||||
if [ "$(${pkgs.acpi}/bin/acpi -a | grep -o off)" == "off" ]; then
|
if [ "$(${pkgs.acpi}/bin/acpi -a | grep -o off)" == "off" ]; then
|
||||||
battery_level=`${pkgs.acpi}/bin/acpi -b | sed 's/.*[dg], //g;s/\%,.*//g'`
|
battery_level=`${pkgs.acpi}/bin/acpi -b | sed 's/.*[dg], //g;s/\%,.*//g'`
|
||||||
if [ $battery_level -le $critical_level ]; then
|
if [ $battery_level -le $critical_level ]; then
|
||||||
${eventd}/bin/eventc critical battery -d "title='Battery level is low!'" -d "message='Only $battery_level% of the charge remains.'"
|
${pkgs.libnotify}/bin/notify-send 'Battery level is low!' "Only $battery_level% of the charge remains."
|
||||||
else
|
else
|
||||||
${eventd}/bin/eventc notification battery -d "title='Battery is discharging!'" -d "message='Only $battery_level% of the charge remains.'"
|
${pkgs.libnotify}/bin/notify-send 'Battery level is discharging!' "Only $battery_level% of the charge remains."
|
||||||
sleep 18m
|
sleep 18m
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3,14 +3,8 @@ let
|
||||||
inherit (import ../../pkgs) desktop-pkgs;
|
inherit (import ../../pkgs) desktop-pkgs;
|
||||||
inherit (import ../../lib) colors;
|
inherit (import ../../lib) colors;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports =
|
||||||
./sway.nix
|
[ ./sway.nix ./wallpaper.nix ./rofi.nix ./ssh-agent.nix ./sleep-nag.nix ];
|
||||||
./wallpaper.nix
|
|
||||||
./rofi.nix
|
|
||||||
./ssh-agent.nix
|
|
||||||
./eventd.nix
|
|
||||||
./sleep-nag.nix
|
|
||||||
];
|
|
||||||
m-0 = {
|
m-0 = {
|
||||||
workspaces = [
|
workspaces = [
|
||||||
"tasks"
|
"tasks"
|
||||||
|
|
|
@ -1,130 +0,0 @@
|
||||||
{ pkgs, lib, config, ... }:
|
|
||||||
let
|
|
||||||
colors = config.m-0.colors;
|
|
||||||
inherit (import ../../pkgs) eventd;
|
|
||||||
in {
|
|
||||||
|
|
||||||
home.packages = [ eventd ];
|
|
||||||
systemd.user = {
|
|
||||||
services = {
|
|
||||||
eventd = {
|
|
||||||
Unit = {
|
|
||||||
Description = "eventd";
|
|
||||||
After = [ "graphical-session-pre.target" ];
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
Install = { WantedBy = [ "default.target" ]; };
|
|
||||||
Service = {
|
|
||||||
Type = "notify";
|
|
||||||
Sockets = "eventd-control.socket eventd.socket";
|
|
||||||
ExecStart = "${eventd}/bin/eventd --listen systemd";
|
|
||||||
ExecReload = "${eventd}/bin/eventdctl reload";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
sockets = {
|
|
||||||
eventd-control = {
|
|
||||||
Unit = { Description = "eventd control socket"; };
|
|
||||||
Socket = {
|
|
||||||
Service = "eventd.service";
|
|
||||||
SocketMode = "0600";
|
|
||||||
ListenStream = "%t/eventd/private";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
eventd = {
|
|
||||||
Unit = { Description = "eventd sockets"; };
|
|
||||||
Socket = {
|
|
||||||
SocketMode = "0660";
|
|
||||||
ListenStream = "%t/eventd/evp";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
xdg = {
|
|
||||||
configFile = {
|
|
||||||
"eventd/eventd.conf".text = lib.generators.toINI { } {
|
|
||||||
"Queue default" = {
|
|
||||||
Margin = 10;
|
|
||||||
Spacing = 2;
|
|
||||||
Limit = 10;
|
|
||||||
};
|
|
||||||
"Queue command" = {
|
|
||||||
Anchor = "bottom-right";
|
|
||||||
Margin = 10;
|
|
||||||
Spacing = 2;
|
|
||||||
Limit = 10;
|
|
||||||
};
|
|
||||||
"Queue critical" = {
|
|
||||||
Anchor = "top";
|
|
||||||
Margin = 450;
|
|
||||||
Spacing = 2;
|
|
||||||
Limit = 10;
|
|
||||||
};
|
|
||||||
"Queue tasks" = {
|
|
||||||
Anchor = "bottom";
|
|
||||||
Margin = 0;
|
|
||||||
Spacing = 1;
|
|
||||||
Limit = 20;
|
|
||||||
};
|
|
||||||
Notification = { Text = "\${message}"; };
|
|
||||||
NotificationBubble = {
|
|
||||||
Padding = 10;
|
|
||||||
Radius = 0;
|
|
||||||
Border = 4;
|
|
||||||
BorderBlur = 4;
|
|
||||||
Timeout = 5000;
|
|
||||||
Colour = colors.background;
|
|
||||||
};
|
|
||||||
NotificationText = {
|
|
||||||
Font = "Linux Libertine 12";
|
|
||||||
Colour = colors.foreground;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"eventd/notification.event".text = lib.generators.toINI { } {
|
|
||||||
"Event notification *" = { Actions = "notification"; };
|
|
||||||
"Event notification kassandra" = { Actions = "kassandra"; };
|
|
||||||
"Event command success" = { Actions = "command-success"; };
|
|
||||||
"Event command failure" = { Actions = "command-failure"; };
|
|
||||||
"Event critical *" = { Actions = "critical"; };
|
|
||||||
};
|
|
||||||
"eventd/command-success.action".text = lib.generators.toINI { } {
|
|
||||||
Action = { Name = "command-success"; };
|
|
||||||
Notification = {
|
|
||||||
Text = "<b>\${command}</b>\\nsucceeded after \${time} @ \${host}";
|
|
||||||
};
|
|
||||||
NotificationBubble = {
|
|
||||||
Colour = colors.black;
|
|
||||||
Queue = "command";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"eventd/command-failure.action".text = lib.generators.toINI { } {
|
|
||||||
Action = { Name = "command-failure"; };
|
|
||||||
Notification = {
|
|
||||||
Text = "<b>\${command}</b>\\nfailed after \${time} @ \${host}";
|
|
||||||
};
|
|
||||||
NotificationBubble = {
|
|
||||||
Queue = "critical";
|
|
||||||
Colour = colors.red;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"eventd/critical.action".text = lib.generators.toINI { } {
|
|
||||||
Action = { Name = "critical"; };
|
|
||||||
Notification = { Text = "<b>\${title}</b>\${message/^/\\n}"; };
|
|
||||||
NotificationBubble = {
|
|
||||||
Queue = "critical";
|
|
||||||
Colour = colors.red;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"eventd/kassandra.action".text = lib.generators.toINI { } {
|
|
||||||
Action = { Name = "kassandra"; };
|
|
||||||
Notification = { Text = "<b>\${title}</b>\${message/^/\\n}"; };
|
|
||||||
NotificationBubble = { Queue = "critical"; };
|
|
||||||
};
|
|
||||||
"eventd/notification.action".text = lib.generators.toINI { } {
|
|
||||||
Action = { Name = "notification"; };
|
|
||||||
Notification = { Text = "<b>\${title}</b>\${message/^/\\n}"; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
let
|
let
|
||||||
inherit (import ../../lib) writeHaskellScript;
|
inherit (import ../../lib) writeHaskellScript;
|
||||||
inherit (import ../../pkgs) eventd;
|
|
||||||
sleep-nag = writeHaskellScript {
|
sleep-nag = writeHaskellScript {
|
||||||
name = "sleep-nag";
|
name = "sleep-nag";
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -11,7 +10,7 @@ let
|
||||||
"Control.Concurrent"
|
"Control.Concurrent"
|
||||||
"Data.Functor"
|
"Data.Functor"
|
||||||
];
|
];
|
||||||
bins = [ eventd ];
|
bins = [ pkgs.libnotify ];
|
||||||
} ''
|
} ''
|
||||||
main = forever $ do
|
main = forever $ do
|
||||||
time <- getZonedTime
|
time <- getZonedTime
|
||||||
|
@ -21,7 +20,7 @@ let
|
||||||
diff = diffUTCTime (zonedTimeToUTC time{zonedTimeToLocalTime = (zonedTimeToLocalTime time){localTimeOfDay = TimeOfDay 23 0 0}}) (zonedTimeToUTC time)
|
diff = diffUTCTime (zonedTimeToUTC time{zonedTimeToLocalTime = (zonedTimeToLocalTime time){localTimeOfDay = TimeOfDay 23 0 0}}) (zonedTimeToUTC time)
|
||||||
delay = toRational diff
|
delay = toRational diff
|
||||||
if night then (do
|
if night then (do
|
||||||
eventc "notification" "kassandra" "-d" ([i|title='Es ist #{formatTime defaultTimeLocale "%H:%M" time} Uhr: Zeit ins Bett zu gehen!'|]::String) "-d" "message='Du kannst das hier auch morgen tun!'"
|
notify_send ([i|title='Es ist #{formatTime defaultTimeLocale "%H:%M" time} Uhr: Zeit ins Bett zu gehen!'|]::String) "Du kannst das hier auch morgen tun!"
|
||||||
threadDelay 600000000)
|
threadDelay 600000000)
|
||||||
else
|
else
|
||||||
threadDelay (floor $ delay * 1000000)
|
threadDelay (floor $ delay * 1000000)
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }: {
|
||||||
let inherit (import ../pkgs) eventd;
|
|
||||||
in {
|
|
||||||
systemd.user = {
|
systemd.user = {
|
||||||
services.update_tasks = {
|
services.update_tasks = {
|
||||||
Unit = { Description = "Update taskwarrior tasks"; };
|
Unit = { Description = "Update taskwarrior tasks"; };
|
||||||
Service = {
|
Service = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
Environment = "PATH=${pkgs.taskwarrior}/bin:${eventd}/bin";
|
Environment = "PATH=${pkgs.taskwarrior}/bin";
|
||||||
ExecStart = "${config.home.homeDirectory}/.cargo/bin/update_tasks";
|
ExecStart = "${config.home.homeDirectory}/.cargo/bin/update_tasks";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# If running from tty1 start sway
|
# If running from tty1 start sway
|
||||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
if [ "$(tty)" = "/dev/tty1" ]; then
|
||||||
. ${my-pkgs.start-ssh-agent}/bin/start-ssh-agent
|
. ${my-pkgs.start-ssh-agent}/bin/start-ssh-agent
|
||||||
exec ${pkgs.sway}/bin/sway
|
exec ${pkgs.sway}/bin/sway >> ~/tmp/sway.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${builtins.readFile ./zshrc}
|
${builtins.readFile ./zshrc}
|
||||||
|
|
|
@ -235,6 +235,5 @@ in rec {
|
||||||
inherit (my-lib) home-manager;
|
inherit (my-lib) home-manager;
|
||||||
};
|
};
|
||||||
foreign-home-pkgs = extra-system-pkgs;
|
foreign-home-pkgs = extra-system-pkgs;
|
||||||
eventd = pkgs.callPackage ./eventd { };
|
|
||||||
email2matrix = pkgs.callPackage ./email2matrix { };
|
email2matrix = pkgs.callPackage ./email2matrix { };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
{ fetchFromGitHub, stdenv, ninja, meson, pkgconfig, glib, cairo, gdk_pixbuf
|
|
||||||
, glib_networking, pango, libudev, xorg, libxslt, docbook_xml_xslt, git, libuuid
|
|
||||||
, dbus, libsoup, docbook_xml_dtd_45, docbook5_xsl, gettext, autoconf, libtool
|
|
||||||
, utillinux, libxkbcommon }:
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "eventd";
|
|
||||||
version = "d7c7ba59aa6b225b3e2b8aebdd853137c05d8445";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "sardemff7";
|
|
||||||
repo = "eventd";
|
|
||||||
rev = version;
|
|
||||||
sha256 = "0b32dwx2ngdm57pdhq1wr7h7i12lnhnm81bs9bbs60dqc01ry6jq";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
buildInputs = [
|
|
||||||
ninja
|
|
||||||
meson
|
|
||||||
pkgconfig
|
|
||||||
glib
|
|
||||||
cairo
|
|
||||||
gdk_pixbuf
|
|
||||||
glib_networking
|
|
||||||
pango
|
|
||||||
libudev
|
|
||||||
xorg.libxcb
|
|
||||||
xorg.xcbutil
|
|
||||||
xorg.xcbutilwm
|
|
||||||
libxkbcommon
|
|
||||||
libxslt
|
|
||||||
docbook_xml_xslt
|
|
||||||
docbook_xml_dtd_45
|
|
||||||
libuuid
|
|
||||||
dbus
|
|
||||||
];
|
|
||||||
preConfigure = ''
|
|
||||||
export mesonFlags="-Dsystemd=true -Dintrospection=false -Dnd-wayland=false -Dim=false -Dsound=false -Ddbussessionservicedir=$prefix/share/dbus-1/services -Dsystemduserunitdir=$prefix/lib/systemd/user -Dsystemdsystemunitdir=$prefix/lib/systemd/system"
|
|
||||||
'';
|
|
||||||
}
|
|
Loading…
Reference in a new issue