I need a simple program to display information for me on screen. For example, I want a tiny box in the corner to tell me what the current language is.

I envision that the program would just run a script every few seconds or otherwise get updated.

I use fvwm, not gnome or other window managers that have a dock so I need something that will work with a vanilla Xwindows.

Is there something like this?


Normally the current language is displayed in the system tray by the input method editor. For example, ibus or fcitx. And if you have a system tray application, it will be in there.

If you wanted to get the layout without using the input method, you could shell out to setxkbmap such as from here.

Whatever commands you want to run you could either do it from FvwmScript or just update a button in FvwmButtons.

For just the language one, add this to your fvwm config:

DestroyModuleConfig FvwmButtonLanguage: *
*FvwmButtonLanguage: (Id button0, Title "ZZ")

Then you can either schedule a periodic task for it (also in your fvwm config):

Schedule 1000 PipeRead "echo SendToModule FvwmButtonLanguage ChangeButton button0 Title $(setxkbmap -query | grep layout | cut -f2 -d: )"

Or run a script (assuming you have Module FvwmCommandS loaded in your start function) to update the button that contains the following:

 while true ; do FvwmCommand "SendToModule FvwmButtonLanguage ChangeButton button0 Title $(setxkbmap -query | grep layout | cut -f2 -d: )" ; sleep 1 ; done

If you update your question to provide another example, I'll update this answer with a thorough example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.