From 6385a436eb4433be7dc83038b5e9dc8868e3b20c Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Wed, 5 Aug 2020 17:06:45 +0200 Subject: [PATCH] Add missing sway-switch-app script --- bin/sway-switch-app | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 bin/sway-switch-app diff --git a/bin/sway-switch-app b/bin/sway-switch-app new file mode 100755 index 0000000..4d48591 --- /dev/null +++ b/bin/sway-switch-app @@ -0,0 +1,7 @@ +#!/bin/bash +set -exo pipefail +app_id="$1" +swaymsg -t get_tree \ + | jq -r "recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.app_id==\"${app_id}\")|select(.focused==false)|\"[con_id=\"+ (.id|tostring) + \"] focus\"" \ + | head -n 1 \ + | xargs -e swaymsg