mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
14 lines
450 B
Bash
14 lines
450 B
Bash
#!/bin/sh
|
|
# This script will turn on numlock if it's off.
|
|
# This script is meant to be executed by i3 config, but it will also work when you write in terminal.
|
|
|
|
# This variable greps numlock value (on/off)
|
|
onoff=$(xset -q | grep Num | rev | cut -c 24- | rev | cut -c 46-)
|
|
|
|
# Then there's if statement, which checks if numlock is off/on
|
|
if [ $onoff == on ] ; then
|
|
exit # numlock is on; exit
|
|
else
|
|
xdotool key Num_Lock # numlock is off; turn it on
|
|
fi
|