Kembali ke Dashboard

Setup Agent PC Client

Jalankan satu perintah di tiap PC client. Agent akan auto-start saat PC menyala dan polling wallpaper baru tiap 60 detik.

⚠ Penting — Jalankan Installer Sekali Saja

Cukup jalankan perintah di bawah satu kali per PC. Installer akan mendaftarkan Scheduled Task / LaunchAgent yang otomatis jalan di background dan polling tiap 60 detik — termasuk saat PC restart. JANGAN menjalankan wallpaper-agent.ps1 langsung; itu hanya loop di window PowerShell dan akan berhenti saat window ditutup.

Cara Kerja

  1. 1. Admin upload wallpaper baru di dashboard → tersimpan di Cloud Storage dengan versi baru.
  2. 2. Agent di tiap PC polling endpoint /api/public/status setiap 60 detik.
  3. 3. Jika versi server lebih baru → agent download gambar & set wallpaper desktop secara otomatis (tanpa restart).
  4. 4. Agent juga lapor hostname, IP, dan versi ke dashboard supaya admin tahu status tiap device.

Windows

Buka PowerShell as Administrator di PC client, lalu jalankan:

$env:WP_SERVER="https://your-app.lovable.app"; iwr -useb "https://your-app.lovable.app/agents/install-windows.ps1?t=$([DateTimeOffset]::Now.ToUnixTimeSeconds())" | iex

Verifikasi agent aktif: Get-ScheduledTask WallpaperAgent | Get-ScheduledTaskInfo
Lalu cek log — harus ada baris baru tiap ±60 detik.

Restart agent: Stop-ScheduledTask WallpaperAgent; Start-ScheduledTask WallpaperAgent

Uninstall: Unregister-ScheduledTask WallpaperAgent -Confirm:$false

macOS

Buka Terminal di PC client, lalu jalankan:

curl -fsSL https://your-app.lovable.app/agents/install-macos.sh | bash -s https://your-app.lovable.app

Cek status: launchctl list | grep wallpaperagent

Uninstall: launchctl unload ~/Library/LaunchAgents/com.wallpaperagent.plist

Troubleshooting

Windows: "execution of scripts is disabled"

Installer sudah pakai -ExecutionPolicy Bypass. Kalau masih error, jalankan dulu: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

macOS: wallpaper tidak berubah

Pastikan System Settings → Privacy & Security → Automation mengizinkan Terminal/bash untuk mengontrol System Events.

Device tidak muncul di dashboard

Tunggu 60 detik setelah agent jalan, lalu refresh dashboard. Pastikan PC bisa akses https://your-app.lovable.app (tidak diblokir firewall/proxy).