From 7caf734bf4c2edcd847d3cccdf85f09f9fdce8a7 Mon Sep 17 00:00:00 2001 From: Marc Partensky Date: Tue, 7 May 2024 16:51:48 +0200 Subject: [PATCH] systemd user directory for timers --- .github/FUNDING.yml | 7 +++++++ service/.config/systemd/user/brightness.service | 5 +++++ service/.config/systemd/user/lowram.service | 5 +++++ .../systemd => .config/systemd/user}/battery.timer | 0 timer/.config/systemd/user/lowram.timer | 13 +++++++++++++ 5 files changed, 30 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 service/.config/systemd/user/brightness.service create mode 100644 service/.config/systemd/user/lowram.service rename timer/{.local/share/systemd => .config/systemd/user}/battery.timer (100%) create mode 100644 timer/.config/systemd/user/lowram.timer diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..a79890d --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,7 @@ +liberapay: marcpartensky +patreon: marcpartensky +github: marcpartensky +custom: + # - monero:43J2XmRtjDPRLD35UsYGH2AZamFBQz7dt4VdvZXVm3SuadTrvcoXUXBRUNHqukFte23Q5TWXqhbwaLJJgoVQzzbe2AJDANQ + - https://paypal.me/marcpartensky + - https://buymeacoffee.com/marcpartensky diff --git a/service/.config/systemd/user/brightness.service b/service/.config/systemd/user/brightness.service new file mode 100644 index 0000000..17ce4a6 --- /dev/null +++ b/service/.config/systemd/user/brightness.service @@ -0,0 +1,5 @@ +[Unit] +Description=Notify when the battery is low and the computer is discharching. + +[Service] +ExecStart=brightnessctl s 1% diff --git a/service/.config/systemd/user/lowram.service b/service/.config/systemd/user/lowram.service new file mode 100644 index 0000000..022d928 --- /dev/null +++ b/service/.config/systemd/user/lowram.service @@ -0,0 +1,5 @@ +[Unit] +Description=Notify when the ram is low and the computer is overloading. + +[Service] +ExecStart=sh -c ~/.local/bin/lowram diff --git a/timer/.local/share/systemd/battery.timer b/timer/.config/systemd/user/battery.timer similarity index 100% rename from timer/.local/share/systemd/battery.timer rename to timer/.config/systemd/user/battery.timer diff --git a/timer/.config/systemd/user/lowram.timer b/timer/.config/systemd/user/lowram.timer new file mode 100644 index 0000000..c7d4916 --- /dev/null +++ b/timer/.config/systemd/user/lowram.timer @@ -0,0 +1,13 @@ +[Unit] +Description=Notify when the battery is low and the computer is discharging. + +[Timer] +OnCalendar=*-*-* *:*:* + +[Install] +WantedBy=timers.target + + +[Service] +# WorkingDirectory=/path/to/script +ExecStart=sh -c ~/.local/bin/lowram