The switch-to-matching-or-urgent-or-lru-window
doesn't seem to work well.
I ran the following shell script:
swayr-test.sh
#!/bin/bash
set -x
pacman -Q swayr-git
foot --app-id=APP_ID --title=TITLE > /dev/null 2>&1 &
sleep 1
swayr switch-to-urgent-or-lru-window
swayr switch-to-matching-or-urgent-or-lru-window [title="TITLE"]
swayr switch-to-matching-or-urgent-or-lru-window [app_id="APP_ID"]
swayr switch-to-matching-or-urgent-or-lru-window [app_name="APP_ID"]
result:
$ ./swayr-test.sh
+ pacman -Q swayr-git
swayr-git r456.0718a04-1
+ sleep 1
+ foot --app-id=APP_ID --title=TITLE
+ swayr switch-to-urgent-or-lru-window
Executed sway command '[con_id=167] focus' (It's the LRU window.)
+ swayr switch-to-matching-or-urgent-or-lru-window '[title=TITLE]'
Error: "error at 1:8: expected one of \"\\\"\", \"__focused__\", [' ' | '\\t']"
+ swayr switch-to-matching-or-urgent-or-lru-window '[app_id=APP_ID]'
Error: "error at 1:9: expected one of \"\\\"\", \"__focused__\", [' ' | '\\t']"
+ swayr switch-to-matching-or-urgent-or-lru-window '[app_name=APP_ID]'
Error: "error at 1:11: expected one of \"\\\"\", \"__focused__\", [' ' | '\\t']"
$
The syntax is wrong: the values of
title
,app_id
, andapp_name
must either be a string enclosed with double-quotes or the special keyword__focused__
without double-quotes. So basically your script looks ok but probably[
needs to be quoted itself. However, the syntax is wrong in the trace output. It seems like bash tries to be smart here and put the complete criteria query in single quotes but also remove the double-quotes from"TITLE"
and friends.FWIW, I think using something like
'[app_name="foot"]'
should work fine for most shells, i.e., put the complete criteria query in single-quotes and values of type string/regex in double-quotes.
All right. I'm sorry I misunderstood.