"Lightweight" ibus script that display languages.
This is just a small script that output the value of ibus engine
to STDOUT
by using dbus
, written in shell. I made this for displaying my keyboard layout in Polybar, but feel free to tailor it to your need. There are some nifty part here and there and I will explain it below
dbus-monitor
ibus
(duh)
You can either clone this repository or just copy on the repository. Make sure to chmod +x
the script files
git clone https://github.com/Banbeucmas/ibus-monitor.git
cd ibus-monitor
chmod +x *.sh
Main script is ibus_monitor.sh
and you should use it, ibus_toggle.sh
only serve the purpose of parsing the file.
Currently only mozc-jp
and Bamboo
is parsed, you can edit it to your liking and pipe ibus_monitor.sh
as the input
./ibus_monitor.sh | ./ibus_toggle.sh
You can make a script module and use it like this. Note that tail
has to be true
[module/language]
type = custom/script
exec = ~/.config/polybar/scripts/ibus_monitor.sh | ~/.config/polybar/scripts/ibus_toggle.sh
tail = true
format-padding = 2
Q: Why don't you use ibus engine
directly?
A: It isn't meant to be used in polybar, you can try it, it works, just be mindful that your CPU will go brrrrrrr for doing this
Q: How painful this was?
A: I know nothing about dbus
prior to this, give me back 16 hours of pain
Q: Nice polybar config?
A: Yes yes, before you ask me about where to get it, here is my dotfile
Q: How can I talk to you?
A: I am fairly active in my own Discord. Click here to join
GNU GENERAL PUBLIC LICENSE, Version 3