A variety of simple automation scripts and enhancements to Sway and i3.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
424B

  1. #!/bin/bash
  2. swaymsg -t get_tree |
  3. jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes | .[] | select(.nodes==[]) | ((.id | tostring) + "\t" + .name)' |
  4. sed -e 's/ - [^-]*//' |
  5. sed -e 's/^\([0-9]*\)\t*\(.*\)/\2 \1/' |
  6. rofi -dmenu -config ~/.config/rofi/sidebar.rasi | {
  7. read -r
  8. id=`echo $REPLY | rev | cut -d' ' -f1 | rev`
  9. swaymsg "[con_id=$id]" focus
  10. }