summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin/hyprland-plugins-setup
blob: e780cb7a210188b01cd7dd973ee19408f4f192cd (plain)
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
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# hyprland-plugins-setup - Install Hyprland plugins on first login
# Called from hyprland.conf exec-once

LOGFILE="$HOME/.local/var/log/hyprland-plugins-setup.log"
mkdir -p "$(dirname "$LOGFILE")"

log() {
    echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" >> "$LOGFILE"
}

# Check if plugins already installed and enabled
if hyprpm list 2>/dev/null | grep -q "hyprscrolling"; then
    if hyprpm list | grep -q "enabled: .*true"; then
        log "Plugins already installed and enabled, skipping"
        exit 0
    fi
fi

log "Starting Hyprland plugin setup"

# Add hyprland-plugins repository
log "Adding hyprland-plugins repository..."
if hyprpm add https://github.com/hyprwm/hyprland-plugins 2>&1 | tee -a "$LOGFILE"; then
    log "hyprland-plugins repository added"
else
    log "Failed to add hyprland-plugins repository"
fi

# Enable plugins from hyprland-plugins
for plugin in hyprscrolling xtra-dispatchers; do
    log "Enabling $plugin..."
    if hyprpm enable "$plugin" 2>&1 | tee -a "$LOGFILE"; then
        log "$plugin enabled"
    else
        log "Failed to enable $plugin"
    fi
done

# Reload plugins into Hyprland
log "Reloading plugins..."
hyprpm reload 2>&1 | tee -a "$LOGFILE"

log "Plugin setup complete"
notify-send "Hyprland Plugins" "Plugin setup complete" -t 3000