From d06784958d73159b5e4abafe5114804662114ed7 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Thu, 9 Jul 2026 22:15:53 -0400 Subject: move ubersicht modules in tree --- .../lib/scripts/init-aerospace.sh | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/init-aerospace.sh (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/init-aerospace.sh') diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/init-aerospace.sh b/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/init-aerospace.sh new file mode 100755 index 0000000..0e9c140 --- /dev/null +++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/init-aerospace.sh @@ -0,0 +1,26 @@ +# Store the first argument passed to the script in the variable aerospace_path +aerospace_path=$1 + +# Get the status of System Integrity Protection (SIP) and store it in the variable SIP +SIP=$(csrutil status) + +# List monitors using the aerospace tool, format the output as JSON, and store it in the variable displays +# Redirect any error output to /dev/null +displays=$($aerospace_path list-monitors --json --format "%{monitor-id} %{monitor-name} %{monitor-appkit-nsscreen-screens-id}" 2> /dev/null) + +# Check if the previous command failed (exit status 1) +if [ $? -eq 1 ]; then + # Print "aerospaceError" and exit the script with status 0 + echo "aerospaceError" + exit 0 +fi + +# Print a JSON object containing the displays information, SIP status, and a shadow property set to true +echo $(cat <<-EOF + { + "displays": $displays, + "SIP": "$SIP", + "shadow": true + } +EOF +) \ No newline at end of file -- cgit v1.3