Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A simple applet for switching between keyboard layouts in NomadBSD. #8

Open
globetrotterdk opened this issue Feb 3, 2022 · 3 comments

Comments

@globetrotterdk
Copy link

A simple applet for switching between keyboard layouts would be very useful in NomadBSD. I am aware of vladas response to my post in the forum, however for a user friendly desktop, I believe that something along the lines of XFCE's xfce4-xkb-plugin would be much more user friendly, frankly than vladas solution. I have tried installing xfce4-xkb-plugin directly, but haven't found a way of getting it to appear in Tint2 at login.

@mrclksr
Copy link
Member

mrclksr commented Feb 7, 2022

Usually, if you configure two keyboard layouts at the NomadBSD setup, such an applet will start automatically on session start.
You can proceed as follows if you haven't configured a second keyboard layout yet:

  1. Set your keyboad layouts in ~/.config/xkbdmap.sh by adding the line
setxkbdmap -layout us,dk
  1. Make gxkb [1] start on session start via a new entry in dsbautostart.
  2. Log out and in again.

You can switch between layouts by clicking on the flag symbol in Tint.


1. If not installed, install x11/gxkb

@globetrotterdk
Copy link
Author

globetrotterdk commented Feb 7, 2022

My use case scenario is two keyboards, three keyboard layouts. I have tried gxkb, however it only shows one keyboard layout - a question mark in Tint2 and nothing in Plank. It is also impossible to move the icons around in Plank. I have also tried editing the ~/.config/plank.ini file directly, but to no effect. Here is my ~/.config/xkbdmap.sh:
setxkbdmap -layout dk,us,ru
At install, I have tried configuring two keyboard layouts - default Danish and secondary US English, however the Danish keyboard was always dominated by the US English (a bit like real life linguistics on occasion) and I could never get the Danish keyboard to work, so I stopped configuring the US English as a secondary keyboard, but there is definitely something going on...

@mrclksr
Copy link
Member

mrclksr commented Feb 8, 2022

a question mark in Tint2 and nothing in Plank.

Plank, unlike Tint2, does not have a tray where gxkb can run in.

At install, I have tried configuring two keyboard layouts - default Danish and secondary US English, however the Danish keyboard was always dominated by the US English (a bit like real life linguistics on occasion) and I could never get the Danish keyboard to work, so I stopped configuring the US English as a secondary keyboard, but there is definitely something going on...

An alternative is IBus. You can configure it as follows:

EDIT:

$ sudo pkg install ibus

Add the lines

export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export XIM_PROGRAM="ibus-daemon"
export XIM_ARGS="--daemonize --xim"
ibus-daemon&

to ~/.xprofile near the beginning of the file, where the other exports are.

The default tray icon color (dark blue) is hard to read. Change it to white:

$ dconf write /desktop/ibus/panel/xkb-icon-rgba "'white'"

After logging out and in again, you'll see IBus's tray icon in Tint2. Right-click on it to open the context menu. Go to Settings->Input Method to add layouts. Left-click on the tray icon to select from your layouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants