Created
December 30, 2023 15:31
-
-
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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