Add language toggle between SE and US in Sway, additionally, set Ghostty to the default terminal.
This commit is contained in:
parent
060aa3fed8
commit
f0f10ab09b
2 changed files with 15 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ include catppuccin_macchiato
|
||||||
# Remap caps lock to escape
|
# Remap caps lock to escape
|
||||||
input * {
|
input * {
|
||||||
xkb_options "caps:escape"
|
xkb_options "caps:escape"
|
||||||
|
xkb_layout us,se
|
||||||
}
|
}
|
||||||
|
|
||||||
input "type:touchpad" {
|
input "type:touchpad" {
|
||||||
|
|
@ -23,7 +24,7 @@ input "type:touchpad" {
|
||||||
# Logo key. Use Mod1 for Alt.
|
# Logo key. Use Mod1 for Alt.
|
||||||
set $mod Mod4
|
set $mod Mod4
|
||||||
# Your preferred terminal emulator
|
# Your preferred terminal emulator
|
||||||
set $term alacritty
|
set $term ghostty
|
||||||
# Your preferred application launcher
|
# Your preferred application launcher
|
||||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||||
# on the original workspace that the command was run on.
|
# on the original workspace that the command was run on.
|
||||||
|
|
@ -57,6 +58,9 @@ exec_always --no-startup-id ~/.config/sway/dim_inactive.windows.py
|
||||||
|
|
||||||
# Exit sway (logs you out of your Wayland session)
|
# Exit sway (logs you out of your Wayland session)
|
||||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
||||||
|
|
||||||
|
# Switch the keyboard layout
|
||||||
|
bindsym $mod+Shift+l exec ~/.config/sway/toggle_keyboard_layout.sh
|
||||||
#
|
#
|
||||||
# Moving around:
|
# Moving around:
|
||||||
#
|
#
|
||||||
|
|
|
||||||
10
linux_home/.config/sway/toggle_keyboard_layout.sh
Executable file
10
linux_home/.config/sway/toggle_keyboard_layout.sh
Executable 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue