Skip to content

Instantly share code, notes, and snippets.

@awwaiid
Created June 6, 2024 15:26
Show Gist options
  • Save awwaiid/f1ff71536190d1eb8d2051f8997239a7 to your computer and use it in GitHub Desktop.
Save awwaiid/f1ff71536190d1eb8d2051f8997239a7 to your computer and use it in GitHub Desktop.
#!/bin/bash
name=$1
if [ -z "$name" ]; then
echo "Usage: $0 <name>"
exit 1
fi
echo "Saving profile $name"
echo -e "\nprofile $name {" >> ~/.config/kanshi/config
swaymsg -t get_outputs | \
jq '.[] | " output '"'"'\(.make) \(.model) \(.serial)'"'"' mode \(.current_mode.width)x\(.current_mode.height) position \(.rect.x),\(.rect.y)"' -r \
>> ~/.config/kanshi/config
echo "}" >> ~/.config/kanshi/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment