Enable numlock in Linux
This commit is contained in:
parent
07bddaae54
commit
dd50852a68
5 changed files with 27 additions and 0 deletions
10
scripts/numlock
Executable file
10
scripts/numlock
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/env bash
|
||||||
|
#
|
||||||
|
## Enable numlock if no battery is detected
|
||||||
|
## Credit: https://wiki.archlinux.org/title/Activating_numlock_on_bootup#With_systemd_service
|
||||||
|
|
||||||
|
if ! compgen -G "/sys/class/power_supply/BAT*" >/dev/null; then
|
||||||
|
for tty in /dev/tty{1..6}; do
|
||||||
|
/usr/bin/setleds -D +num < "$tty"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
@ -21,6 +21,7 @@ mkvtoolnix-cli
|
||||||
mpv
|
mpv
|
||||||
noto-fonts
|
noto-fonts
|
||||||
noto-fonts-cjk
|
noto-fonts-cjk
|
||||||
|
numlockx
|
||||||
openbox-patched
|
openbox-patched
|
||||||
otf-font-awesome-4
|
otf-font-awesome-4
|
||||||
papirus-icon-theme
|
papirus-icon-theme
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
/etc/systemd/system/numlock.service
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=numlock
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/local/bin/numlock
|
||||||
|
StandardInput=tty
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
@ -2,6 +2,11 @@
|
||||||
#
|
#
|
||||||
## Start desktop apps based on WM
|
## Start desktop apps based on WM
|
||||||
|
|
||||||
|
# Numlock
|
||||||
|
if ! compgen -G "/sys/class/power_supply/BAT*" >/dev/null; then
|
||||||
|
numlockx &
|
||||||
|
fi
|
||||||
|
|
||||||
# Start common apps
|
# Start common apps
|
||||||
#picom --backend xrender --xrender-sync --xrender-sync-fence &
|
#picom --backend xrender --xrender-sync --xrender-sync-fence &
|
||||||
picom --daemon || picom --daemon --no-vsync
|
picom --daemon || picom --daemon --no-vsync
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue