Skip to content

Instantly share code, notes, and snippets.

View ckafi's full-sized avatar
💭
the meat made the machines

Tobias Frilling ckafi

💭
the meat made the machines
  • Marburg
  • 03:40 (UTC +02:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ckafi on github.
  • I am ckafi (https://keybase.io/ckafi) on keybase.
  • I have a public key whose fingerprint is 4DB7 C38E 68F1 59B7 5848 9DD9 D560 DD1A 42ED 90BC

To claim this, I am signing this object:

@ckafi
ckafi / track_prev_focus
Last active March 21, 2024 09:57
Tracks the previosly focused window in sway and marks it with '_prev'
#!/bin/sh
prev_focus=$(swaymsg -r -t get_seats | jq '.[0].focus')
swaymsg -m -t subscribe '["window"]' | \
jq --unbuffered 'select(.change == "focus").container.id' | \
while read new_focus; do
swaymsg "[con_id=${prev_focus}] mark --add _prev" &>/dev/null
prev_focus=$new_focus
done