aboutsummaryrefslogtreecommitdiff
path: root/.config/service
diff options
context:
space:
mode:
authorLuca Matei Pintilie <luca@lucamatei.com>2024-07-14 23:20:39 +0000
committerLuca Matei Pintilie <luca@lucamatei.com>2024-07-14 23:20:39 +0000
commit3a0868feb48fbe004942ed84bf7bea000428de82 (patch)
tree1bf67ee83c49cfc4d70acacedd0ff4a6bc977ede /.config/service
parent106067ed048a684da33669eff984bd8b98f554a2 (diff)
downloaddotfiles-3a0868feb48fbe004942ed84bf7bea000428de82.tar
dotfiles-3a0868feb48fbe004942ed84bf7bea000428de82.tar.gz
dotfiles-3a0868feb48fbe004942ed84bf7bea000428de82.tar.bz2
dotfiles-3a0868feb48fbe004942ed84bf7bea000428de82.tar.lz
dotfiles-3a0868feb48fbe004942ed84bf7bea000428de82.tar.xz
dotfiles-3a0868feb48fbe004942ed84bf7bea000428de82.tar.zst
dotfiles-3a0868feb48fbe004942ed84bf7bea000428de82.zip
implement turnstile-style services
Diffstat (limited to '.config/service')
-rwxr-xr-x.config/service/blueman-applet/run4
-rwxr-xr-x.config/service/dbus/run13
-rwxr-xr-x.config/service/dunst/run4
-rwxr-xr-x.config/service/foot/run4
-rwxr-xr-x.config/service/nm-applet/run4
-rwxr-xr-x.config/service/pipewire-loopback/run10
-rwxr-xr-x.config/service/pipewire/run4
-rwxr-xr-x.config/service/swayrd/run4
-rwxr-xr-x.config/service/swaysome/run5
-rwxr-xr-x.config/service/thunar/run5
-rw-r--r--.config/service/turnstile-ready/conf2
-rwxr-xr-x.config/service/turnstile-ready/control/x4
12 files changed, 63 insertions, 0 deletions
diff --git a/.config/service/blueman-applet/run b/.config/service/blueman-applet/run
new file mode 100755
index 0000000..0fd1c86
--- /dev/null
+++ b/.config/service/blueman-applet/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+exec chpst -e "$TURNSTILE_ENV_DIR" blueman-applet
diff --git a/.config/service/dbus/run b/.config/service/dbus/run
new file mode 100755
index 0000000..a183643
--- /dev/null
+++ b/.config/service/dbus/run
@@ -0,0 +1,13 @@
+#!/bin/sh
+exec 2>&1
+
+[ -r ./conf ] && . ./conf
+
+: "${DBUS_SESSION_BUS_ADDRESS:=unix:path=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/bus}"
+. "$HOME/.config/common_service.sh"
+
+if [ -d "$TURNSTILE_ENV_DIR" ]; then
+ echo "$DBUS_SESSION_BUS_ADDRESS" > "$TURNSTILE_ENV_DIR"/DBUS_SESSION_BUS_ADDRESS
+fi
+
+exec chpst -e "$TURNSTILE_ENV_DIR" dbus-daemon --session --nofork --nopidfile --address="$DBUS_SESSION_BUS_ADDRESS" $OPTS
diff --git a/.config/service/dunst/run b/.config/service/dunst/run
new file mode 100755
index 0000000..05ad2ff
--- /dev/null
+++ b/.config/service/dunst/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+exec chpst -e "$TURNSTILE_ENV_DIR" dunst
diff --git a/.config/service/foot/run b/.config/service/foot/run
new file mode 100755
index 0000000..e73f39d
--- /dev/null
+++ b/.config/service/foot/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+exec chpst -e "$TURNSTILE_ENV_DIR" foot --server
diff --git a/.config/service/nm-applet/run b/.config/service/nm-applet/run
new file mode 100755
index 0000000..0b1b9d2
--- /dev/null
+++ b/.config/service/nm-applet/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+exec chpst -e "$TURNSTILE_ENV_DIR" nm-applet
diff --git a/.config/service/pipewire-loopback/run b/.config/service/pipewire-loopback/run
new file mode 100755
index 0000000..f475602
--- /dev/null
+++ b/.config/service/pipewire-loopback/run
@@ -0,0 +1,10 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+
+sv check pipewire >/dev/null || exit 1
+
+chpst -e "$TURNSTILE_ENV_DIR" pactl load-module module-null-sink media.class=Audio/Sink sink_name=my-sink channel_map=surround-51 || exit $?
+chpst -e "$TURNSTILE_ENV_DIR" pactl load-module module-null-sink media.class=Audio/Source/Virtual sink_name="my-source" channel_map=front-left,front-right || exit $?
+chpst -e "$TURNSTILE_ENV_DIR" pactl load-module module-null-sink media.class=Audio/Duplex sink_name="Main thing" audio.position=FL,FR,RL,RR || exit $?
+exec pause
diff --git a/.config/service/pipewire/run b/.config/service/pipewire/run
new file mode 100755
index 0000000..021c8ce
--- /dev/null
+++ b/.config/service/pipewire/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+exec chpst -e "$TURNSTILE_ENV_DIR" pipewire
diff --git a/.config/service/swayrd/run b/.config/service/swayrd/run
new file mode 100755
index 0000000..88f0770
--- /dev/null
+++ b/.config/service/swayrd/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+exec chpst -e "$TURNSTILE_ENV_DIR" swayrd
diff --git a/.config/service/swaysome/run b/.config/service/swaysome/run
new file mode 100755
index 0000000..66324cb
--- /dev/null
+++ b/.config/service/swaysome/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+chpst -e "$TURNSTILE_ENV_DIR" swaysome init 1 || exit $?
+exec pause
diff --git a/.config/service/thunar/run b/.config/service/thunar/run
new file mode 100755
index 0000000..a7fa76f
--- /dev/null
+++ b/.config/service/thunar/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+chpst -e "$TURNSTILE_ENV_DIR" thunar --daemon || exit $?
+exec pause
diff --git a/.config/service/turnstile-ready/conf b/.config/service/turnstile-ready/conf
new file mode 100644
index 0000000..5fdaacf
--- /dev/null
+++ b/.config/service/turnstile-ready/conf
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+core_services="dbus"
diff --git a/.config/service/turnstile-ready/control/x b/.config/service/turnstile-ready/control/x
new file mode 100755
index 0000000..f7b5a95
--- /dev/null
+++ b/.config/service/turnstile-ready/control/x
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+exec 2>&1
+. "$HOME/.config/common_service.sh"
+rm "$TURNSTILE_ENV_DIR"/*