aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/common_service.sh12
-rw-r--r--.config/i3/config14
-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
-rw-r--r--.config/sway/config26
15 files changed, 79 insertions, 36 deletions
diff --git a/.config/common_service.sh b/.config/common_service.sh
new file mode 100644
index 0000000..50c34ee
--- /dev/null
+++ b/.config/common_service.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+: ${TURNSTILE_ENV_DIR:="${HOME}/.config/service-env"}
+
+. /etc/profile
+
+for file in /etc/profile.d/*.sh
+do
+ . "$file"
+done
+
+. "$HOME/.profile"
+
diff --git a/.config/i3/config b/.config/i3/config
index 5563d24..b1f4e7e 100644
--- a/.config/i3/config
+++ b/.config/i3/config
@@ -237,17 +237,3 @@ bindsym $mod+r mode "resize"
exec_always --no-startup-id ${XDG_CONFIG_HOME:-~/.config}/polybar/launch.sh
-exec dunst
-exec nm-applet --indicator
-exec blueman-applet
-exec thunar --daemon
-#exec pipewire
-#exec pipewire-pulse
-#exec gentoo-pipewire-launcher
-
-#exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
-
-#exec pactl load-module module-null-sink media.class=Audio/Sink sink_name=my-sink channel_map=surround-51
-#exec pactl load-module module-null-sink media.class=Audio/Source/Virtual sink_name="my-source" channel_map=front-left,front-right
-#exec pactl load-module module-null-sink media.class=Audio/Duplex sink_name="Main thing" audio.position=FL,FR,RL,RR
-
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"/*
diff --git a/.config/sway/config b/.config/sway/config
index fcfad93..ac82b2f 100644
--- a/.config/sway/config
+++ b/.config/sway/config
@@ -322,33 +322,15 @@ input "type:touchpad" {
output $laptop_screen enable
exec_always ${XDG_CONFIG_HOME:-~/.config}/sway/clamshell.sh
-exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
-exec dunst
-exec nm-applet --indicator
-exec blueman-applet
-exec thunar --daemon
-exec pipewire
-exec pipewire-pulse
-exec wireplumber
-exec gentoo-pipewire-launcher
-exec foot --server
+exec_always echo $WAYLAND_DISPLAY > $HOME/.config/service-env/WAYLAND_DISPLAY
+exec_always echo $DISPLAY > $HOME/.config/service-env/DISPLAY
+exec_always echo $SWAYSOCK > $HOME/.config/service-env/SWAYSOCK
+# TODO: How do I use this?
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
-exec pactl load-module module-null-sink media.class=Audio/Sink sink_name=my-sink channel_map=surround-51
-exec pactl load-module module-null-sink media.class=Audio/Source/Virtual sink_name="my-source" channel_map=front-left,front-right
-exec pactl load-module module-null-sink media.class=Audio/Duplex sink_name="Main thing" audio.position=FL,FR,RL,RR
-
-exec export SDL_VIDEODRIVER=wayland
-exec export _JAVA_AWT_WM_NONREPARENTING=1
-exec export QT_QPA_PLATFORM=wayland
-exec export XDG_CURRENT_DESKTOP=sway
-exec export XDG_SESSION_DESKTOP=sway
-exec "swaysome init 1"
-exec "swayrd"
-
include /etc/sway/config.d/*