Changed hyprland config structure, added switching keyboard functionnality + various fixes
This commit is contained in:
parent
0b72e2371e
commit
663777d8ec
16 changed files with 141 additions and 167 deletions
33
config/.config/hypr/scripts/change-kb-layout.sh
Executable file
33
config/.config/hypr/scripts/change-kb-layout.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
status_file="$HOME/.config/hypr/status/kb_layout"
|
||||
hyprland_cfg_file="$HOME/.config/hypr/hyprland.conf"
|
||||
|
||||
|
||||
fr_to_en() {
|
||||
printf "en" > "${status_file}"
|
||||
|
||||
hyprctl notify 1 2000 0 "Keyboard set to QWERTY"
|
||||
|
||||
sed -i 's/kb_layouts\/fr/kb_layouts\/us/g' "$hyprland_cfg_file"
|
||||
}
|
||||
|
||||
en_to_fr() {
|
||||
printf "fr" > "${status_file}"
|
||||
|
||||
hyprctl notify 1 2000 0 "Keyboard set to AZERTY"
|
||||
|
||||
sed -i 's/kb_layouts\/us/kb_layouts\/fr/g' "$hyprland_cfg_file"
|
||||
}
|
||||
|
||||
if ! [ -f "${status_file}" ]; then
|
||||
hyprctl notify 3 3000 0 "Status file missing"
|
||||
hyprctl notify 2 6000 0 "Use Mod + Ctrl + Space to change keyboard layout"
|
||||
en_to_fr
|
||||
else
|
||||
if [ $(cat "${status_file}") = "fr" ]; then
|
||||
fr_to_en
|
||||
elif [ $(cat "${status_file}") = "en" ]; then
|
||||
en_to_fr
|
||||
fi
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue