diff --git a/home/battery.nix b/home/battery.nix index f7b83373..a8169cec 100644 --- a/home/battery.nix +++ b/home/battery.nix @@ -1,6 +1,5 @@ { lib, pkgs, config, ... }: let - inherit (import ../pkgs) eventd; battery-watch = pkgs.writeScript "battery-watch" '' #!${pkgs.stdenv.shell} @@ -13,9 +12,9 @@ let if [ "$(${pkgs.acpi}/bin/acpi -a | grep -o off)" == "off" ]; then battery_level=`${pkgs.acpi}/bin/acpi -b | sed 's/.*[dg], //g;s/\%,.*//g'` 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 - ${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 fi fi diff --git a/home/desktop/default.nix b/home/desktop/default.nix index 739903d1..84d3b96f 100644 --- a/home/desktop/default.nix +++ b/home/desktop/default.nix @@ -3,14 +3,8 @@ let inherit (import ../../pkgs) desktop-pkgs; inherit (import ../../lib) colors; in { - imports = [ - ./sway.nix - ./wallpaper.nix - ./rofi.nix - ./ssh-agent.nix - ./eventd.nix - ./sleep-nag.nix - ]; + imports = + [ ./sway.nix ./wallpaper.nix ./rofi.nix ./ssh-agent.nix ./sleep-nag.nix ]; m-0 = { workspaces = [ "tasks" diff --git a/home/desktop/eventd.nix b/home/desktop/eventd.nix deleted file mode 100644 index f702f3cb..00000000 --- a/home/desktop/eventd.nix +++ /dev/null @@ -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 = "\${command}\\nsucceeded after \${time} @ \${host}"; - }; - NotificationBubble = { - Colour = colors.black; - Queue = "command"; - }; - }; - "eventd/command-failure.action".text = lib.generators.toINI { } { - Action = { Name = "command-failure"; }; - Notification = { - Text = "\${command}\\nfailed after \${time} @ \${host}"; - }; - NotificationBubble = { - Queue = "critical"; - Colour = colors.red; - }; - }; - "eventd/critical.action".text = lib.generators.toINI { } { - Action = { Name = "critical"; }; - Notification = { Text = "\${title}\${message/^/\\n}"; }; - NotificationBubble = { - Queue = "critical"; - Colour = colors.red; - }; - }; - "eventd/kassandra.action".text = lib.generators.toINI { } { - Action = { Name = "kassandra"; }; - Notification = { Text = "\${title}\${message/^/\\n}"; }; - NotificationBubble = { Queue = "critical"; }; - }; - "eventd/notification.action".text = lib.generators.toINI { } { - Action = { Name = "notification"; }; - Notification = { Text = "\${title}\${message/^/\\n}"; }; - }; - }; - }; - -} diff --git a/home/desktop/sleep-nag.nix b/home/desktop/sleep-nag.nix index 6ab2a70c..b5692d67 100644 --- a/home/desktop/sleep-nag.nix +++ b/home/desktop/sleep-nag.nix @@ -1,7 +1,6 @@ { lib, pkgs, config, ... }: let inherit (import ../../lib) writeHaskellScript; - inherit (import ../../pkgs) eventd; sleep-nag = writeHaskellScript { name = "sleep-nag"; imports = [ @@ -11,7 +10,7 @@ let "Control.Concurrent" "Data.Functor" ]; - bins = [ eventd ]; + bins = [ pkgs.libnotify ]; } '' main = forever $ do time <- getZonedTime @@ -21,7 +20,7 @@ let diff = diffUTCTime (zonedTimeToUTC time{zonedTimeToLocalTime = (zonedTimeToLocalTime time){localTimeOfDay = TimeOfDay 23 0 0}}) (zonedTimeToUTC time) delay = toRational diff 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) else threadDelay (floor $ delay * 1000000) diff --git a/home/update_tasks.nix b/home/update_tasks.nix index 3782a15c..fc444422 100644 --- a/home/update_tasks.nix +++ b/home/update_tasks.nix @@ -1,12 +1,10 @@ -{ config, lib, pkgs, ... }: -let inherit (import ../pkgs) eventd; -in { +{ config, lib, pkgs, ... }: { systemd.user = { services.update_tasks = { Unit = { Description = "Update taskwarrior tasks"; }; Service = { Type = "oneshot"; - Environment = "PATH=${pkgs.taskwarrior}/bin:${eventd}/bin"; + Environment = "PATH=${pkgs.taskwarrior}/bin"; ExecStart = "${config.home.homeDirectory}/.cargo/bin/update_tasks"; }; }; diff --git a/home/zsh/default.nix b/home/zsh/default.nix index 9d2308be..8a3b1b79 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -14,7 +14,7 @@ # If running from tty1 start sway if [ "$(tty)" = "/dev/tty1" ]; then . ${my-pkgs.start-ssh-agent}/bin/start-ssh-agent - exec ${pkgs.sway}/bin/sway + exec ${pkgs.sway}/bin/sway >> ~/tmp/sway.log fi ${builtins.readFile ./zshrc} diff --git a/pkgs/default.nix b/pkgs/default.nix index 5ee57ebe..1bf8a95d 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -235,6 +235,5 @@ in rec { inherit (my-lib) home-manager; }; foreign-home-pkgs = extra-system-pkgs; - eventd = pkgs.callPackage ./eventd { }; email2matrix = pkgs.callPackage ./email2matrix { }; } diff --git a/pkgs/eventd/default.nix b/pkgs/eventd/default.nix deleted file mode 100644 index 6954dac1..00000000 --- a/pkgs/eventd/default.nix +++ /dev/null @@ -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" - ''; -}