Skip to content

Instantly share code, notes, and snippets.

@datsfilipe
Created December 30, 2023 15:31
Show Gist options
  • Save datsfilipe/0f67bdf0a0ae4bba4080097ed8a79c6c to your computer and use it in GitHub Desktop.
Save datsfilipe/0f67bdf0a0ae4bba4080097ed8a79c6c to your computer and use it in GitHub Desktop.
Switch US keyboard variant from 'intl' to 'default' in Xorg and Wayland (Hyprland).
#!/bin/sh
variant=$1
if [ -z "$WAYLAND_DISPLAY" ]; then
if [ "$variant" = "intl" ]; then
setxkbmap -layout us -variant intl
notify-send -t 2000 "Keyboard layout" "Switched to international"
else
setxkbmap -layout us
notify-send -t 2000 "Keyboard layout" "Switched to default"
fi
else
if [ "$variant" = "intl" ]; then
hyprctl keyword input:kb_variant intl
notify-send -t 2000 "Keyboard layout" "Switched to international"
else
hyprctl reload
notify-send -t 2000 "Keyboard layout" "Switched to default"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment