summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-05-04 10:01:34 -0300
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-05-04 10:01:34 -0300
commit31ee4472e897cbf0c3d61bd56bd5864f4507b659 (patch)
tree5b0a8af5189ea1b88a36e9b909f3933899d9a1cf
re-initial
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
-rw-r--r--conf.d/tmux2
-rw-r--r--conf.d/wireplumber0
-rwxr-xr-xinit.d/dbus6
-rwxr-xr-xinit.d/emacs10
-rwxr-xr-xinit.d/mpd32
-rwxr-xr-xinit.d/pipewire5
-rwxr-xr-xinit.d/pipewire-pulse10
-rwxr-xr-xinit.d/tmux18
-rwxr-xr-xinit.d/wireplumber12
-rw-r--r--rc.conf3
10 files changed, 98 insertions, 0 deletions
diff --git a/conf.d/tmux b/conf.d/tmux
new file mode 100644
index 0000000..7f86f7b
--- /dev/null
+++ b/conf.d/tmux
@@ -0,0 +1,2 @@
+sessions="weechat"
+commands_weechat="weechat"
diff --git a/conf.d/wireplumber b/conf.d/wireplumber
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/conf.d/wireplumber
diff --git a/init.d/dbus b/init.d/dbus
new file mode 100755
index 0000000..055c1ba
--- /dev/null
+++ b/init.d/dbus
@@ -0,0 +1,6 @@
+#!/sbin/openrc-run
+
+pidfile="${XDG_RUNTIME_DIR:-${RC_SVCDIR}}/${RC_SVCNAME#*.}"
+command="/usr/bin/dbus-daemon"
+command_args="--session --syslog --nofork --address unix:path=${XDG_RUNTIME_DIR:-${RC_SVCDIR}}/bus"
+command_background=yes
diff --git a/init.d/emacs b/init.d/emacs
new file mode 100755
index 0000000..f882e86
--- /dev/null
+++ b/init.d/emacs
@@ -0,0 +1,10 @@
+#!/sbin/openrc-run
+
+command="/usr/bin/emacs"
+command_args="--fg-daemon"
+command_background="true"
+pidfile=${XDG_RUNTIME_DIR:-${SVCDIR}}/emacs.pid
+description="Start an Emacs server running in the background"
+depend() {
+ after dbus
+}
diff --git a/init.d/mpd b/init.d/mpd
new file mode 100755
index 0000000..d2a7654
--- /dev/null
+++ b/init.d/mpd
@@ -0,0 +1,32 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+: CFGFILE=${CFGFILE:=${XDG_CONFIG_HOME:-${HOME}/.config}/mpd/mpd.conf}
+
+depend() {
+ use pipewire pulseaudio
+ config ${CFGFILE}
+}
+
+get_config() {
+ x=$1
+ test -e ${CFGFILE} || return 1
+ sed -n \
+ -e '/^[ \t]*'${x}'/{s:^[ \t]*'${x}'[ \t]\+"\?\([^#"]\+\)[^"]*"\?$:\1: ; p }' \
+ ${CFGFILE}
+}
+
+extra_started_commands='reload'
+# Required by io_uring
+command=/usr/bin/mpd
+command_args=${CFGFILE}
+required_files=${CFGFILE}
+pidfile=$(get_config pid_file)
+description="Music Player Daemon"
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ start-stop-daemon --pidfile ${pidfile} --signal HUP
+ eend $?
+}
diff --git a/init.d/pipewire b/init.d/pipewire
new file mode 100755
index 0000000..e5c9e89
--- /dev/null
+++ b/init.d/pipewire
@@ -0,0 +1,5 @@
+#!/sbin/openrc-run
+
+command="/usr/bin/pipewire"
+command_background="true"
+pidfile="${XDG_RUNTIME_DIR:-${SVCDIR}}/pipewire.pid"
diff --git a/init.d/pipewire-pulse b/init.d/pipewire-pulse
new file mode 100755
index 0000000..9e029c3
--- /dev/null
+++ b/init.d/pipewire-pulse
@@ -0,0 +1,10 @@
+#!/sbin/openrc-run
+
+depend() {
+ need pipewire
+}
+
+command="/usr/bin/pipewire"
+command_args="-c pipewire-pulse.conf"
+command_background="true"
+pidfile="${XDG_RUNTIME_DIR:-${SVCDIR}}/pipewire-pulse.pid"
diff --git a/init.d/tmux b/init.d/tmux
new file mode 100755
index 0000000..770a996
--- /dev/null
+++ b/init.d/tmux
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+user=$(whoami)
+command="/usr/bin/tmux"
+command_args="new-session -s ${user} -t ${user} -d"
+pidfile="${XDG_RUNTIME_DIR:-RC_SVCDIR}/tmux.pid"
+description="Start a tmux session"
+
+start_post() {
+ tmux display-message -p '#{pid}' > ${pidfile}
+ for session in ${sessions}; do
+ tmux new-session -s ${session} -d
+ eval local commands="\${commands_${session}}"
+ for command in "${commands}"; do
+ tmux new-window -n "${session}":"${command}" "${command}"
+ done
+ done
+}
diff --git a/init.d/wireplumber b/init.d/wireplumber
new file mode 100755
index 0000000..823ff2d
--- /dev/null
+++ b/init.d/wireplumber
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+
+depend() {
+ need pipewire dbus
+}
+
+DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR:-${RC_SVCDIR}}/bus"
+export DBUS_SESSION_BUS_ADDRESS
+
+command="/usr/bin/wireplumber"
+command_background=true
+pidfile="${XDG_RUNTIME_DIR-:${SVCDIR}}/wireplumber.pid"
diff --git a/rc.conf b/rc.conf
new file mode 100644
index 0000000..d5a2ac1
--- /dev/null
+++ b/rc.conf
@@ -0,0 +1,3 @@
+rc_parallel="NO"
+rc_env_allow="DBUS_SESSION_BUS_ADDRESS"
+unicode="YES"