Add keyboard lang status bar

This commit is contained in:
q3aql 2025-08-03 20:20:08 +02:00
parent e8c9bacafa
commit 5063eb8cd6
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,14 @@
#!/bin/bash
sway_config="${HOME}/.config/sway/config"
if [ -f ${sway_config} ] ; then
get_lang=$(cat ${sway_config} | grep xkb_layout | grep -v "#" | head -1 | sed 's/xkb_layout//g' | cut -d '"' -f 2)
if [ -z ${get_lang} ] ; then
echo " us "
else
echo "${get_lang} "
fi
else
echo " us "
fi

View File

@ -8,7 +8,8 @@ while [ ${status_bar} -eq 0 ] ; do
cpuinfo=$(~/.config/sway/scripts/cpu_info.sh)
meminfo=$(~/.config/sway/scripts/mem_info.sh)
volume=$(~/.config/sway/scripts/get_volume.sh)
lang=$(~/.config/sway/scripts/get_lang.sh)
date=$(~/.config/sway/scripts/current_date.sh)
echo "${updates} ${kernel} ${cpuinfo} ${meminfo} ${volume} ${date}"
echo "${updates} ${kernel} ${cpuinfo} ${meminfo} ${volume} ${lang} ${date}"
sleep 2
done