summaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2024-06-06 15:25:36 -0500
committerzachir <zachir@librem.one>2024-06-06 15:32:41 -0500
commit2d1af667b96d9f8d80a4aec217d8a1f48a946bb2 (patch)
treee4d2183a41f0c197dd15989972e09f07192afd05 /runit
parent84e670004f797f30b89298daf4de7b842fda4f26 (diff)
Add runit user services as well
Diffstat (limited to 'runit')
-rw-r--r--runit/conf/logind.conf54
-rw-r--r--runit/sv/dunst/conf9
-rwxr-xr-xrunit/sv/dunst/log/run12
-rwxr-xr-xrunit/sv/dunst/run5
-rw-r--r--runit/sv/mako/conf9
-rw-r--r--runit/sv/mako/down0
-rwxr-xr-xrunit/sv/mako/log/run12
-rwxr-xr-xrunit/sv/mako/run5
-rw-r--r--runit/sv/mpd-mpris/conf9
-rwxr-xr-xrunit/sv/mpd-mpris/log/run12
-rwxr-xr-xrunit/sv/mpd-mpris/run8
-rw-r--r--runit/sv/mpd-notification/conf9
-rwxr-xr-xrunit/sv/mpd-notification/log/run12
-rwxr-xr-xrunit/sv/mpd-notification/run9
-rw-r--r--runit/sv/mpd/conf9
-rwxr-xr-xrunit/sv/mpd/log/run12
-rwxr-xr-xrunit/sv/mpd/run8
-rw-r--r--runit/sv/pipewire-pulse/conf12
-rwxr-xr-xrunit/sv/pipewire-pulse/log/run12
-rwxr-xr-xrunit/sv/pipewire-pulse/run12
-rw-r--r--runit/sv/wireplumber/conf12
-rwxr-xr-xrunit/sv/wireplumber/log/run12
-rwxr-xr-xrunit/sv/wireplumber/run12
23 files changed, 266 insertions, 0 deletions
diff --git a/runit/conf/logind.conf b/runit/conf/logind.conf
new file mode 100644
index 0000000..c31f33a
--- /dev/null
+++ b/runit/conf/logind.conf
@@ -0,0 +1,54 @@
+# This file is part of elogind.
+#
+# elogind is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See logind.conf(5) for details.
+
+[Login]
+KillUserProcesses=yes
+#KillOnlyUsers=
+#KillExcludeUsers=root
+#InhibitDelayMaxSec=5
+#HandlePowerKey=poweroff
+#HandleSuspendKey=suspend
+#HandleHibernateKey=hibernate
+#HandleLidSwitch=suspend
+#HandleLidSwitchExternalPower=suspend
+#HandleLidSwitchDocked=ignore
+#PowerKeyIgnoreInhibited=no
+#SuspendKeyIgnoreInhibited=no
+#HibernateKeyIgnoreInhibited=no
+#LidSwitchIgnoreInhibited=yes
+#HoldoffTimeoutSec=30s
+#IdleAction=ignore
+#IdleActionSec=30min
+#RuntimeDirectorySize=10%
+#RuntimeDirectoryInodes=400k
+#RemoveIPC=yes
+#InhibitorsMax=8192
+#SessionsMax=8192
+
+[Sleep]
+#AllowSuspend=yes
+#AllowHibernation=yes
+#AllowSuspendThenHibernate=yes
+#AllowHybridSleep=yes
+#AllowPowerOffInterrupts=no
+#BroadcastPowerOffInterrupts=yes
+#AllowSuspendInterrupts=no
+#BroadcastSuspendInterrupts=yes
+#HandleNvidiaSleep=no
+#SuspendState=mem standby freeze
+#SuspendMode=
+#HibernateState=disk
+#HibernateMode=platform shutdown
+#HybridSleepState=disk
+#HybridSleepMode=suspend platform shutdown
+#HibernateDelaySec=10800
diff --git a/runit/sv/dunst/conf b/runit/sv/dunst/conf
new file mode 100644
index 0000000..88353ef
--- /dev/null
+++ b/runit/sv/dunst/conf
@@ -0,0 +1,9 @@
+# -*- mode: sh; -*-
+
+# Additional command line arguments for pipewire(1).
+OPTS=''
+
+# Setting this to 1 enables logging, any other value - disables.
+LOGGING_ENABLE=1
+# The directory will be created for you, if logging is enabled.
+LOG_DIR="$HOME/.local/var/log/dunst"
diff --git a/runit/sv/dunst/log/run b/runit/sv/dunst/log/run
new file mode 100755
index 0000000..09818ce
--- /dev/null
+++ b/runit/sv/dunst/log/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ -r ../conf ] && . ../conf
+
+if [ "${LOGGING_ENABLE}x" = "1x" ]; then
+ # Create the log directory if not exists.
+ [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}"
+
+ exec svlogd -tt "${LOG_DIR:-}"
+else
+ exec chpst -b mpd-log-null cat >/dev/null
+fi
diff --git a/runit/sv/dunst/run b/runit/sv/dunst/run
new file mode 100755
index 0000000..1c0aa88
--- /dev/null
+++ b/runit/sv/dunst/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ -r ./conf ] && . ./conf
+
+exec dunst ${OPTS:-} 2>&1
diff --git a/runit/sv/mako/conf b/runit/sv/mako/conf
new file mode 100644
index 0000000..6bb79d1
--- /dev/null
+++ b/runit/sv/mako/conf
@@ -0,0 +1,9 @@
+# -*- mode: sh; -*-
+
+# Additional command line arguments for pipewire(1).
+OPTS=''
+
+# Setting this to 1 enables logging, any other value - disables.
+LOGGING_ENABLE=1
+# The directory will be created for you, if logging is enabled.
+LOG_DIR="$HOME/.local/var/log/mako"
diff --git a/runit/sv/mako/down b/runit/sv/mako/down
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/runit/sv/mako/down
diff --git a/runit/sv/mako/log/run b/runit/sv/mako/log/run
new file mode 100755
index 0000000..09818ce
--- /dev/null
+++ b/runit/sv/mako/log/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ -r ../conf ] && . ../conf
+
+if [ "${LOGGING_ENABLE}x" = "1x" ]; then
+ # Create the log directory if not exists.
+ [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}"
+
+ exec svlogd -tt "${LOG_DIR:-}"
+else
+ exec chpst -b mpd-log-null cat >/dev/null
+fi
diff --git a/runit/sv/mako/run b/runit/sv/mako/run
new file mode 100755
index 0000000..266f521
--- /dev/null
+++ b/runit/sv/mako/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ -r ./conf ] && . ./conf
+
+exec mako ${OPTS:-} 2>&1
diff --git a/runit/sv/mpd-mpris/conf b/runit/sv/mpd-mpris/conf
new file mode 100644
index 0000000..7b43455
--- /dev/null
+++ b/runit/sv/mpd-mpris/conf
@@ -0,0 +1,9 @@
+# -*- mode: sh; -*-
+
+# Additional command line arguments for pipewire(1).
+OPTS='-network unix'
+
+# Setting this to 1 enables logging, any other value - disables.
+LOGGING_ENABLE=0
+# The directory will be created for you, if logging is enabled.
+LOG_DIR="$HOME/.local/var/log/mpd-mpris"
diff --git a/runit/sv/mpd-mpris/log/run b/runit/sv/mpd-mpris/log/run
new file mode 100755
index 0000000..09818ce
--- /dev/null
+++ b/runit/sv/mpd-mpris/log/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ -r ../conf ] && . ../conf
+
+if [ "${LOGGING_ENABLE}x" = "1x" ]; then
+ # Create the log directory if not exists.
+ [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}"
+
+ exec svlogd -tt "${LOG_DIR:-}"
+else
+ exec chpst -b mpd-log-null cat >/dev/null
+fi
diff --git a/runit/sv/mpd-mpris/run b/runit/sv/mpd-mpris/run
new file mode 100755
index 0000000..3883e70
--- /dev/null
+++ b/runit/sv/mpd-mpris/run
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Wait for the PipeWire Pulse daemon to start.
+sv check "$HOME/.config/runit/sv/mpd" >/dev/null || exit 1
+
+[ -r ./conf ] && . ./conf
+
+exec mpd-mpris ${OPTS:--network unix} 2>&1
diff --git a/runit/sv/mpd-notification/conf b/runit/sv/mpd-notification/conf
new file mode 100644
index 0000000..e0b9aa3
--- /dev/null
+++ b/runit/sv/mpd-notification/conf
@@ -0,0 +1,9 @@
+# -*- mode: sh; -*-
+
+# Additional command line arguments for pipewire(1).
+OPTS=''
+
+# Setting this to 1 enables logging, any other value - disables.
+LOGGING_ENABLE=0
+# The directory will be created for you, if logging is enabled.
+LOG_DIR="$HOME/.local/var/log/mpd-notification"
diff --git a/runit/sv/mpd-notification/log/run b/runit/sv/mpd-notification/log/run
new file mode 100755
index 0000000..09818ce
--- /dev/null
+++ b/runit/sv/mpd-notification/log/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ -r ../conf ] && . ../conf
+
+if [ "${LOGGING_ENABLE}x" = "1x" ]; then
+ # Create the log directory if not exists.
+ [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}"
+
+ exec svlogd -tt "${LOG_DIR:-}"
+else
+ exec chpst -b mpd-log-null cat >/dev/null
+fi
diff --git a/runit/sv/mpd-notification/run b/runit/sv/mpd-notification/run
new file mode 100755
index 0000000..a643d56
--- /dev/null
+++ b/runit/sv/mpd-notification/run
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Wait for the PipeWire Pulse daemon to start.
+sv check "$HOME/.config/runit/sv/mpd" >/dev/null || exit 1
+sv check "$HOME/.config/runit/sv/mako" >/dev/null || exit 1
+
+[ -r ./conf ] && . ./conf
+
+exec mpd-notification ${OPTS:-} 2>&1
diff --git a/runit/sv/mpd/conf b/runit/sv/mpd/conf
new file mode 100644
index 0000000..ca3a82f
--- /dev/null
+++ b/runit/sv/mpd/conf
@@ -0,0 +1,9 @@
+# -*- mode: sh; -*-
+
+# Additional command line arguments for pipewire(1).
+OPTS=''
+
+# Setting this to 1 enables logging, any other value - disables.
+LOGGING_ENABLE=0
+# The directory will be created for you, if logging is enabled.
+LOG_DIR="$HOME/.local/var/log/mpd"
diff --git a/runit/sv/mpd/log/run b/runit/sv/mpd/log/run
new file mode 100755
index 0000000..09818ce
--- /dev/null
+++ b/runit/sv/mpd/log/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ -r ../conf ] && . ../conf
+
+if [ "${LOGGING_ENABLE}x" = "1x" ]; then
+ # Create the log directory if not exists.
+ [ -d "${LOG_DIR:-}" ] || mkdir -p "${LOG_DIR:-}"
+
+ exec svlogd -tt "${LOG_DIR:-}"
+else
+ exec chpst -b mpd-log-null cat >/dev/null
+fi
diff --git a/runit/sv/mpd/run b/runit/sv/mpd/run
new file mode 100755
index 0000000..b57d5ac
--- /dev/null
+++ b/runit/sv/mpd/run
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Wait for the PipeWire Pulse daemon to start.
+sv check "$HOME/.config/runit/sv/pipewire-pulse" >/dev/null || exit 1
+
+[ -r ./conf ] && . ./conf
+
+exec mpd --no-daemon --stderr ${OPTS:-} 2>&1
diff --git a/runit/sv/pipewire-pulse/conf b/runit/sv/pipewire-pulse/conf
new file mode 100644
index 0000000..606eac5
--- /dev/null
+++ b/runit/sv/pipewire-pulse/conf
@@ -0,0 +1,12 @@
+# -*- mode: sh; -*-
+
+# Additional command line arguments for pipewire-pulse.
+OPTS=''
+
+# Setting this to 1 enables logging, any other value - disables.
+LOGGING_ENABLE=0
+# Set the pipewire log level.
+# See: https://docs.pipewire.org/page_daemon.html#sec_logging
+LOG_LEVEL=1
+# The directory will be created for you, if logging is enabled.
+LOG_DIR="$HOME/.local/var/log/pipewire-pulse"
diff --git a/runit/sv/pipewire-pulse/log/run b/runit/sv/pipewire-pulse/log/run
new file mode 100755
index 0000000..ba8236e
--- /dev/null
+++ b/runit/sv/pipewire-pulse/log/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ -r ../conf ] && . ../conf
+
+if [ "${LOGGING_ENABLE}x" = "1x" ]; then
+ # Create the log directory if not exists.
+ [ -d "${LOG_DIR}" ] || mkdir -p "${LOG_DIR}"
+
+ exec svlogd -tt "${LOG_DIR}"
+else
+ exec chpst -b pipewire-pulse-log-null cat >/dev/null
+fi
diff --git a/runit/sv/pipewire-pulse/run b/runit/sv/pipewire-pulse/run
new file mode 100755
index 0000000..0e43d6f
--- /dev/null
+++ b/runit/sv/pipewire-pulse/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Wait for the PipeWire Media Session daemon to start.
+sv check "$HOME/.config/runit/sv/wireplumber" >/dev/null || exit 1
+
+[ -r ./conf ] && . ./conf
+
+if [ "${LOGGING_ENABLE}x" = "1x" -a -n "${LOG_LEVEL}" ]; then
+ export PIPEWIRE_DEBUG="${LOG_LEVEL}"
+fi
+
+exec pipewire-pulse ${OPTS:-} 2>&1
diff --git a/runit/sv/wireplumber/conf b/runit/sv/wireplumber/conf
new file mode 100644
index 0000000..d712f03
--- /dev/null
+++ b/runit/sv/wireplumber/conf
@@ -0,0 +1,12 @@
+# -*- mode: sh; -*-
+
+# Additional command line arguments for wireplumber.
+OPTS=''
+
+# Setting this to 1 enables logging, any other value - disables.
+LOGGING_ENABLE=0
+# Set the wireplumber log level.
+# See: https://pipewire.pages.freedesktop.org/wireplumber/daemon-logging.html
+LOG_LEVEL=2
+# The directory will be created for you, if logging is enabled.
+LOG_DIR="$HOME/.local/var/log/wireplumber"
diff --git a/runit/sv/wireplumber/log/run b/runit/sv/wireplumber/log/run
new file mode 100755
index 0000000..aa89d14
--- /dev/null
+++ b/runit/sv/wireplumber/log/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ -r ../conf ] && . ../conf
+
+if [ "${LOGGING_ENABLE}x" == "1x" ]; then
+ # Create the log directory if not exists.
+ [ -d "${LOG_DIR}" ] || mkdir -p "${LOG_DIR}"
+
+ exec svlogd -tt "${LOG_DIR}"
+else
+ exec chpst -b wireplumber-log-null cat >/dev/null
+fi
diff --git a/runit/sv/wireplumber/run b/runit/sv/wireplumber/run
new file mode 100755
index 0000000..5fb9edc
--- /dev/null
+++ b/runit/sv/wireplumber/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Wait for the PipeWire daemon to start.
+sv check "$HOME/.config/runit/sv/pipewire" >/dev/null || exit 1
+
+[ -r ./conf ] && . ./conf
+
+if [ "${LOGGING_ENABLE}x" = "1x" -a -n "${LOG_LEVEL}" ]; then
+ export WIREPLUMBER_DEBUG="${LOG_LEVEL}"
+fi
+
+exec wireplumber ${OPTS:-} 2>&1