Created
January 1, 2016 21:07
-
-
Save anestv/2e5b2306002a4d0b651b to your computer and use it in GitHub Desktop.
Automatically enable numlock on login screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# script to automatically enable numlock on login screen | |
# tested on Ubuntu 14.04 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
echo "Updating reps..." | |
sudo apt-get -qq update | |
echo "Installing numlockx..." | |
sudo apt-get install numlockx | |
if [ -w /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf ]; then | |
echo "# enable numlock" >> /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf | |
echo "greeter-setup-script=/usr/bin/numlockx on" >> /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf | |
echo "Success!" | |
else | |
echo "File /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf does not exist or is not writeable" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment