-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·35 lines (28 loc) · 1.11 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·35 lines (28 loc) · 1.11 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
31
32
33
34
35
#!/bin/bash
# Must be run with sudo for system-wide installation
if [ "$EUID" -ne 0 ]; then
echo "Please run with sudo."
exit 1
fi
# Install executables
install -Dm755 killswitch-session /usr/local/bin/killswitch-session
install -Dm755 killswitch-switcher /usr/local/bin/killswitch-switcher
# Install .desktop file for Display Manager
install -Dm644 killswitch.desktop /usr/share/wayland-sessions/killswitch.desktop
# Setup for current user
REAL_USER=${SUDO_USER:-$USER}
USER_HOME=$(eval echo ~$REAL_USER)
USER_CONFIG_DIR="$USER_HOME/.config/killswitch"
# Create config directory if it doesn't exist
mkdir -p "$USER_CONFIG_DIR"
chown "$REAL_USER:$REAL_USER" "$USER_CONFIG_DIR"
# Copy example config if it doesn't exist
if [ ! -f "$USER_CONFIG_DIR/config.sh" ]; then
cp config.example.sh "$USER_CONFIG_DIR/config.sh"
chown "$REAL_USER:$REAL_USER" "$USER_CONFIG_DIR/config.sh"
echo "Created default config at $USER_CONFIG_DIR/config.sh"
else
echo "Config $USER_CONFIG_DIR/config.sh already exists, skipping."
fi
echo "Killswitch installed successfully!"
echo "Select 'Killswitch' session in your display manager."