summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6fb7bfd86726776b053852f31cfec9ffc699db17 (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
# Maintainer: Yajat Rangnekar <yajatrangnekar@gmail.com>
pkgname=cli-reminder
pkgver=0.1.0
pkgrel=1
pkgdesc="A CLI reminder application with TUI and notification support"
arch=('x86_64')
url="https://github.com/Skeleton-Hacker/CLI_Reminder"
license=('MIT')
depends=('gcc-libs')
makedepends=('rust' 'cargo' 'git')
optdepends=('libnotify: for desktop notifications')
source=("git+https://github.com/Skeleton-Hacker/CLI_Reminder.git")
sha256sums=('SKIP')

build() {
  cd "$srcdir/CLI_Reminder/remindme/"
  cargo build --release
}

package() {
  cd "$srcdir/CLI_Reminder"
  
  # Install binary
  install -Dm755 "remindme/target/release/remindme" "$pkgdir/usr/bin/remindme"
  
  # Create systemd service files
  mkdir -p "$pkgdir/usr/lib/systemd/user"
  
  # Create service file with proper environment variables
  cat > "$pkgdir/usr/lib/systemd/user/remindme-check.service" << EOF
[Unit]
Description=Check for due reminders

[Service]
Type=oneshot
ExecStart=/usr/bin/remindme notify --desktop
# Using %t expands to the user's runtime directory: /run/user/\$UID
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus
# Inherit DISPLAY from user environment instead of hardcoding
EOF
  
  # Create timer file
  cat > "$pkgdir/usr/lib/systemd/user/remindme-check.timer" << EOF
[Unit]
Description=Periodically check for due reminders

[Timer]
OnBootSec=1s
OnUnitActiveSec=1s
AccuracySec=1s

[Install]
WantedBy=timers.target
EOF

  # Install desktop entry
  mkdir -p "$pkgdir/usr/share/applications"
  cat > "$pkgdir/usr/share/applications/remindme.desktop" << EOF
[Desktop Entry]
Name=RemindMe
Comment=CLI Reminder Application
Exec=/usr/bin/remindme
Icon=appointment-soon
Terminal=true
Type=Application
Categories=Utility;
EOF

  # Create documentation directory and files
  mkdir -p "$pkgdir/usr/share/doc/$pkgname"
  if [ -f "setup.sh" ]; then
    install -Dm644 "setup.sh" "$pkgdir/usr/share/doc/$pkgname/setup.sh"
  fi
  
  # Create configuration directory
  mkdir -p "$pkgdir/etc/remindme"
  echo '[]' > "$pkgdir/etc/remindme/reminders.json.example"
}