add layout display to i3blocks
This commit is contained in:
parent
89b210f663
commit
1471013bd7
@ -51,6 +51,10 @@ command=i3blocks_helper pomodoro
|
||||
interval=1
|
||||
signal=10
|
||||
|
||||
[language]
|
||||
command=i3blocks_helper language
|
||||
interval=1
|
||||
|
||||
[time]
|
||||
command=i3blocks_helper time
|
||||
interval=30
|
||||
|
||||
@ -76,6 +76,22 @@ cmd_bluetooth_battery() {
|
||||
done
|
||||
}
|
||||
|
||||
cmd_language() {
|
||||
layout="$(xkblayout-state print %n)"
|
||||
|
||||
case "${layout}" in
|
||||
English)
|
||||
echo "🇬🇧 En"
|
||||
;;
|
||||
Russian)
|
||||
echo "🇷🇺 Ru"
|
||||
;;
|
||||
*)
|
||||
echo "🌐 ${layout}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${1}" in
|
||||
wireless) shift; cmd_wireless "$@" ;;
|
||||
ethernet) shift; cmd_ethernet "$@" ;;
|
||||
@ -89,6 +105,7 @@ case "${1}" in
|
||||
volume) shift; cmd_volume "$@" ;;
|
||||
pomodoro) shift; cmd_pomodoro "$@" ;;
|
||||
bluetooth_battery) shift; cmd_bluetooth_battery "$@" ;;
|
||||
language) shift; cmd_language "$@" ;;
|
||||
|
||||
*) exit "${EXIT_FAILURE}" ;;
|
||||
esac
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user