Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0007463Kali LinuxFeature Requestspublic2022-02-17 15:38
Reporterkzb Assigned Todaniruiz  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Fixed in Version2022.1 
Summary0007463: Automation Script for Keyboard settings
Description

Hi,

please deliver a small config script with kali e.g. /bin/setlang $lang to make it easier to persist a custom language setting.

It's annoying to play half an hour with the undocumented part of Kali to get it working!

For example:

#!/bin/bash
isroot=$(id | grep "root");
if [ -z "$isroot" ]; then
echo "You're not root..";
exit;
fi

if [ -z "$1" ]; then
echo "[usage]: $0 <lang>";
exit;
fi

persist for general mapping (doesn't really work!)

setxkbmap -layout "$1"
localectl --no-convert set-x11-keymap "$1"

#persist for login screen
echo '@reboot setxkbmap -layout "$1" \
@reboot localectl --no-convert set-x11-keymap "$1"' >> /etc/crontab

fixes the defaults

echo "" > /etc/default/locale
echo "LANG=$1.UTF-8" >> /etc/default/locale
echo "LC_ALL=$1.UTF-8" >> /etc/default/locale

echo "Done with setting the lang to $1";

Steps To Reproduce

login mask should provide the right language settings (keyboard mapping) if not it needs to be adjusted..

like German nodeadkeys: z instead of y.. (etc)

Relationships

related to 0007462 resolveddaniruiz Changing language only with a few "Hacks" possible 

Activities

kzb

kzb

2021-11-30 06:35

reporter   ~0015452

Script is untested !!! Written out of mind

re4son

re4son

2021-11-30 07:11

manager   ~0015453

Last edited: 2021-11-30 07:11

Have you tried defining your keyboard layout in "/etc/lightdm/lightdm.conf"?
Adding the following in the "[Seat:*]" section will do the trick:

display-setup-script=setxkbmap de

kzb

kzb

2021-11-30 23:13

reporter   ~0015460

not tried, like in the other report.

it's basically the same code but after login or when the lightdm (greeter) starts?
Should work like @reboot

Thanks for the contribution, if you could set it with a sed script (overwriting the defaults inside the conf by using /bin/setlang), would be fine.

... /bin/setlang <code> would be easier than running 20 commands and adjusting 20 popups :D

kzb

kzb

2021-11-30 23:14

reporter   ~0015461

and it should be possible to make a dir inside the cronjobs dir.. no or only one line needs to be added to crontab... which makes things easier.

daniruiz

daniruiz

2022-02-17 15:38

manager   ~0015765

Since Kali 2022.1 the keyboard layout selector is placed in the top-bar of the login screen.

To change the system keyboard setting you need to run (and then reboot):
sudo dpkg-reconfigure keyboard-configuration

Issue History

Date Modified Username Field Change
2021-11-30 06:35 kzb New Issue
2021-11-30 06:35 kzb Note Added: 0015452
2021-11-30 07:11 re4son Note Added: 0015453
2021-11-30 07:11 re4son Note Edited: 0015453
2021-11-30 23:13 kzb Note Added: 0015460
2021-11-30 23:14 kzb Note Added: 0015461
2022-02-17 15:38 daniruiz Note Added: 0015765
2022-02-17 15:38 daniruiz Relationship added related to 0007462
2022-02-17 15:38 daniruiz Assigned To => daniruiz
2022-02-17 15:38 daniruiz Status new => resolved
2022-02-17 15:38 daniruiz Resolution open => fixed
2022-02-17 15:38 daniruiz Fixed in Version => 2022.1