feat(polybar): add voxtype XDG state logging

Amolith created

- Respect XDG_STATE_HOME for log file location
- Create state directory before launching voxtype
- Redirect voxtype output to log file instead of discarding
- Remove opx wrapper from voxtype launch command

Change summary

dot_config/polybar/executable_voxtype-polybar.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Detailed changes

dot_config/polybar/executable_voxtype-polybar.sh 🔗

@@ -10,6 +10,10 @@
 #   color_primary    - accent/alert color (used for recording)
 #   color_secondary  - secondary accent (used for transcribing)
 
+# Respect XDG_STATE_HOME for log location
+state_dir="${XDG_STATE_HOME:-$HOME/.local/state}/voxtype"
+log_file="$state_dir/voxtype.log"
+
 output=$(voxtype status --format json 2>/dev/null)
 
 if [[ -z "$output" ]]; then
@@ -22,7 +26,8 @@ alt=$(echo "$output" | jq -r '.alt // "idle"')
 # Handle toggle action
 if [[ "$1" == "toggle" ]]; then
 	if [[ "$alt" == "stopped" ]]; then
-		setsid fish -c "opx voxtype" >/dev/null 2>&1 &
+		mkdir -p "$state_dir"
+		setsid fish -c "voxtype" >>"$log_file" 2>&1 &
 	else
 		voxtype record toggle
 	fi