From 45098288dfa0f23b753d60c890932b8f6b3f1640 Mon Sep 17 00:00:00 2001
From: Justine Smithies <justine@smithies.me.uk>
Date: Sat, 6 Jul 2024 14:58:24 +0100
Subject: Fixed Eww bar workspace script to work with my two screens when one
 is unplugged using kanshi.

---
 .config/eww/scripts/workspace.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/.config/eww/scripts/workspace.sh b/.config/eww/scripts/workspace.sh
index 07564c2..34af41f 100755
--- a/.config/eww/scripts/workspace.sh
+++ b/.config/eww/scripts/workspace.sh
@@ -1,12 +1,14 @@
 #! /bin/bash
 
 active() {
-if [[ $arg = 0 ]]
+if [[ $arg = 0 && $(river-bedload -print outputs | jq -r '.[''] | select(.).name' | wc -l | xargs) -gt 1 ]]
+# if [[ $arg = 0 ]]
 then
 	arg=1
 else
 	arg=0
 fi
+# fi
 num=$(river-bedload -print outputs | jq -r '.['$arg'] | select(.).view_tags')
 num=$(echo $num | awk -F' ' '{print $1}')
 b=0
@@ -43,7 +45,7 @@ done
 
 # Get Focused workspace for current monitor ID
 export arg="$1"
-if [[ $arg = 0 ]]
+if [[ $arg = 0 && $(river-bedload -print outputs | jq -r '.[''] | select(.).name' | wc -l | xargs) -gt 1 ]]
 then
 	arg=1
 else
-- 
cgit v1.2.3