summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xbin/rcmenu24
1 files changed, 19 insertions, 5 deletions
diff --git a/bin/rcmenu b/bin/rcmenu
index 06e940c..976afe7 100755
--- a/bin/rcmenu
+++ b/bin/rcmenu
@@ -5,14 +5,27 @@ set -u
 
 export MENU_PROMPT="󰑮 rc"
 svdir=/run/s6-rc/servicedirs
+rcdir=/etc/s6-rc/src
 ico=/usr/share/icons/mdi/scalable/run-fast.svg
 menu_exitcode=-1
 
 __list() {
-	for sv in "$svdir"/*; do
-		printf "%s " "$(basename "$sv")"
-		doas -n s6-svstat "$sv"
-	done | column -t
+	(
+		find "$svdir" -mindepth 1 -maxdepth 1 -type d -print |
+			while read -r sv; do
+				printf "%s " "$(basename "$sv")"
+				doas -n s6-svstat "$sv"
+			done
+		find "$rcdir" -mindepth 1 -maxdepth 1 -type d -print |
+			while read -r sv; do
+				if [ -f "$sv/type" ] && grep -q bundle "$sv/type"; then
+					printf "%s " "$(basename "$sv")"
+					printf "[bundle] "
+					printf "contents: "
+					find "$sv/contents.d/" -type f -exec basename {} \; | xargs | sed 's, ,/,g'
+				fi
+			done
+	) | column -t
 }
 
 __handle() {
@@ -32,12 +45,13 @@ __handle() {
 			fi
 			;;
 
-		down)
+		down | \[bundle\])
 			action=start
 			msg=$(doas -n s6-rc -v2 -u change "$sv")
 			;;
 
 		*)
+			action=noop
 			msg=$(printf "unknown service state: %s\n" "$state")
 			false
 			;;