all repos — dotfiles-extra @ e7b4874516df8a3f5886c29fff1d1ae88e86607a

extra configs that may be extraneous and/or may be platform specific

.config/sway/scripts/scratchpad.sh

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
#!/bin/sh
tooltip=$(swaymsg -r -t get_tree | jq -r 'recurse(.nodes[]) | first(select(.name=="__i3_scratch")) | .floating_nodes | .[] | "\(.app_id) | \(.name)"')
count=$(echo -n "$tooltip" | grep -c '^')

if [[ "$count" -eq 0 ]]; then
  exit 1
elif [[ "$count" -eq 1 ]]; then
  class="one"
elif [[ "$count" -gt 1 ]]; then
  class="many"
else
  class="unknown"
fi

printf '{"text":"%s", "class":"%s", "alt":"%s", "tooltip":"%s"}\n' "$count" "$class" "$class" "${tooltip//$'\n'/'\n'}"