View Issue Details

IDProjectCategoryView StatusLast Update
0007463Kali Linux[All Projects] Feature Requestspublic2021-11-30 23:14
Reporterkzb Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0007463: Automation Script for Keyboard settings
DescriptionHi,

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 Reproducelogin mask should provide the right language settings (keyboard mapping) if not it needs to be adjusted..

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

Activities

kzb

2021-11-30 06:35

reporter   ~0015452

Script is untested !!! Written out of mind

re4son

2021-11-30 07:11

manager   ~0015453

Last edited: 2021-11-30 07:11

View 2 revisions

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

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

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.

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 View Revisions
2021-11-30 23:13 kzb Note Added: 0015460
2021-11-30 23:14 kzb Note Added: 0015461