Last active
January 26, 2025 07:11
-
-
Save iguanajuice/4b34ef2d93a53b7e1e91ddeb70768c4e to your computer and use it in GitHub Desktop.
Revisions
-
iguanajuice revised this gist
Jan 26, 2025 . No changes.There are no files selected for viewing
-
iguanajuice revised this gist
Jan 26, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ if [ $# -ne 2 ] then echo "Usage: swaywait [app_id/class] [sway_command]" exit 1 fi -
iguanajuice created this gist
Aug 14, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #!/bin/sh if [ $# -ne 2 ] then echo "Usage: swaywait [target] [command]" exit 1 fi TARGET=$1 COMMAND=$2 swaymsg -t subscribe -m '["window"]' | while read line do CON=`echo $line | jq -r 'select(.change=="new").container'` APPID=`echo $CON | jq -r '.app_id'` CLASS=`echo $CON | jq -r '.window_properties.class'` CONID=`echo $CON | jq -r '.id'` if [ "$APPID" = "$TARGET" ] || [ "$CLASS" = "$TARGET" ] then swaymsg "[con_id=$CONID] $COMMAND" kill -PIPE 0 fi done