-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
30 lines (24 loc) · 1 KB
/
install.sh
File metadata and controls
30 lines (24 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
echo "Installing Keyboard Backlight Saver..."
# 1. Install dependencies
echo "Checking dependencies..."
if ! command -v xprintidle >/dev/null 2>&1; then
sudo apt-get update && sudo apt-get install -y xprintidle
fi
# 2. Install main script
mkdir -p "$HOME/.local/bin"
cp src/kbd-auto-off.sh "$HOME/.local/bin/kbd-auto-off"
chmod +x "$HOME/.local/bin/kbd-auto-off"
echo "Script installed to ~/.local/bin/kbd-auto-off"
# 3. Install Permission Fixer (System Service)
echo "Installing permission fix service (requires sudo)..."
sudo cp services/kbd-brightness-fix.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now kbd-brightness-fix.service
# 4. Install User Service
echo "Installing user background service..."
mkdir -p "$HOME/.config/systemd/user"
cp services/kbd-backlight.service "$HOME/.config/systemd/user/"
systemctl --user daemon-reload
systemctl --user enable --now kbd-backlight.service
echo "Done! Your keyboard light should now turn off after 15s of inactivity."