summarylogtreecommitdiffstats
path: root/bartender.install
blob: 18a51c3b023ee6297d7c6df72aff116e4e25253a (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
post_install() {
    # Apply systemd preset to enable bartender for the installing user
    # This runs as the user via makepkg, so --user works correctly
    if systemctl --user daemon-reload 2>/dev/null; then
        systemctl --user preset bartender.service 2>/dev/null || true
    fi

    cat << 'EOF'

==> Bartender installed successfully!

AUTOSTART
---------
Bartender is enabled by default and will start automatically on login.

To start it now (without logging out):
   systemctl --user start bartender.service

To disable autostart:
   systemctl --user disable bartender.service

CONFIGURATION (optional)
------------------------
Create ~/.config/bartender/config.toml to customize settings.
See /usr/share/doc/bartender-git/README.md for configuration options.

For widgets requiring API credentials (like FreshRSS), add them to config.toml:
   [freshrss]
   api_url = "https://your-instance.com/api/..."
   auth_token = "your_token_here"

IMPORTANT: Protect your config file:
   chmod 600 ~/.config/bartender/config.toml

NOTE
----
Bartender will automatically stop waybar and mako if they're running as services.
To switch back: systemctl --user stop bartender && systemctl --user start waybar mako

EOF
}

pre_remove() {
    # Stop and disable the service before removal
    if systemctl --user is-active bartender.service &>/dev/null; then
        systemctl --user stop bartender.service || true
    fi
    if systemctl --user is-enabled bartender.service &>/dev/null; then
        systemctl --user disable bartender.service || true
    fi
}

post_remove() {
    cat << 'EOF'

==> Bartender has been removed.

Your configuration in ~/.config/bartender/ was preserved.
Remove it manually if no longer needed:
   rm -rf ~/.config/bartender

If you were using bartender as your status bar, you can now
restart waybar and mako:
   systemctl --user start waybar.service mako.service

EOF
}

post_upgrade() {
    # Reload systemd to pick up any service file changes
    systemctl --user daemon-reload 2>/dev/null || true

    cat << 'EOF'

==> Bartender upgraded!

Restart the service to apply changes:
   systemctl --user restart bartender.service

EOF
}