diff --git a/.config/sway/scripts/get_lang.sh b/.config/sway/scripts/get_lang.sh new file mode 100755 index 0000000..64bb9b4 --- /dev/null +++ b/.config/sway/scripts/get_lang.sh @@ -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 diff --git a/.config/sway/scripts/status_bar.sh b/.config/sway/scripts/status_bar.sh index 4b0e905..b8d80f1 100755 --- a/.config/sway/scripts/status_bar.sh +++ b/.config/sway/scripts/status_bar.sh @@ -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