Add language toggle between SE and US in Sway, additionally, set Ghostty to the default terminal.

This commit is contained in:
Martin Larsson 2025-01-07 23:49:17 +01:00
parent 060aa3fed8
commit f0f10ab09b
2 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,10 @@
#!/bin/zsh
# Toggle between US (0) and Swedish (1) layouts
current=$(swaymsg -t get_inputs | jq -r '.[] | select(.type=="keyboard") | .xkb_active_layout_index' | head -n 1)
if [ "$current" -eq 0 ]; then
swaymsg input '*' xkb_switch_layout 1
else
swaymsg input '*' xkb_switch_layout 0
fi