setup activity watch
authorIan Kelling <ian@iankelling.org>
Tue, 3 Dec 2024 13:47:57 +0000 (08:47 -0500)
committerIan Kelling <ian@iankelling.org>
Tue, 3 Dec 2024 13:47:57 +0000 (08:47 -0500)
i3-sway/bar.conf
i3-sway/i3.conf
myx

index 49fc262d1473bbc8bc282fe53f89c34337763132..d6f22087e700c7b6b9ad92ac8c0446a60cabf9f4 100644 (file)
@@ -29,20 +29,14 @@ output primary
 #for faster testing
 #status_command          /a/bin/ds/filesystem/usr/local/bin/myi3status
 status_command          /usr/local/bin/myi3status
-#mode hide
-# hidden_state hide
+# note: old wip command: /p/c/myi3life
+
+
 font pango:monospace 18
 
-# i have no need for the tray icons so far
 tray_output primary
 
-# I found I didn't need these, but, I'm trying them out again.
+# I found I didn't need these.
 # workspace_buttons no
-}
 
-## dont want to see this bar for now
-# bar {
-# status_command          /p/c/myi3life
-# tray_output none
-# workspace_buttons no
-# }
+# note /a/c/myx adds the last bit to this file conditionally.
index 92f40dd8d5aa59299e161a2451c8fb281b4009fb..498d9915fdb432b19ef19cddf05c84686e5c3371 100644 (file)
@@ -7,6 +7,8 @@ bindsym $mod+Shift+p restart
 
 $ex copyq
 $ex dunst
-$ex /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
+# haven't been using it enough to justify automatically running it.]
+#$ex /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
+$ex /a/opt/activity-watch/aw-qt
 # this dies when we restart i3.
 exec_always --no-startup-id i3-event-hook
diff --git a/myx b/myx
index b3bfb9abf9a3d75d88d2cfe23d024c4851abef66..25207953af2a04281b8e611a7eaf618fcefafca8 100755 (executable)
--- a/myx
+++ b/myx
@@ -92,9 +92,16 @@ m() {
 
 
 
-secondary_out=$(awk '$2 == "connected" && $3 != "primary" {print $1}' $xf)
 primary_info=$(awk '$2 == "connected" && $3 == "primary" {print $1,$4}' $xf)
 
+secondary_out=$(awk '$2 == "connected" && $3 != "primary" {print $1}' $xf)
+# Some systems only have a non-primary connected.
+if [[ ! $primary_info ]]; then
+  primary_info=$(awk '$2 == "connected" {print $1,$3}' $xf)
+  xrandr --output $secondary_out --primary
+  secondary_out=
+fi
+
 # res_info eg: 3840x2160+1920+0
 read -r primary_out primary_res_info <<<"$primary_info"
 
@@ -280,7 +287,7 @@ elif [[ $secondary_out ]]; then
 
 fi
 
-echo d1 ${ws_outputs[@]}
+#echo d1 ${ws_outputs[@]}
 
 rm -f ~/i3-myx.conf
 total_ws_count=11
@@ -293,9 +300,18 @@ for (( i=0; i<total_ws_count; i++ )); do
   fi
   echo "workspace $ws output $ws_out" >>~/i3-myx.conf
 done
-if [[ $secondary_out ]]; then
-  cat /a/bin/ds/i3-sway/bar.conf >> ~/i3-myx.conf
-fi
+
+{
+  cat /a/bin/ds/i3-sway/bar.conf
+  if [[ $secondary_out ]]; then
+    echo "}"
+  else
+    echo 'mode hide
+hidden_state hide
+}'
+  fi
+} >> ~/i3-myx.conf
+
 echo "bindsym \$mod+Shift+t move workspace to output ${move_outputs[*]}" >>~/i3-myx.conf
 # give it some time to reload or adjust to new x settings.