Watches a directory for new Discord .deb package downloads and prompts the user for immediate installation.
Currently supports Debian-based systems only, but the code is straightforward and can be adapted to other environments with minimal changes.
This tool requires the following system dependencies to function:
zenity- to display GUI promptspolkit(forpkexec) to request privilege elevation for installationdpkg- for installing.debpackagessystemd-run- to launch Discord
Make sure these are installed on your system before running the watcher.
Use the provided Makefile to install and manage the watcher and its systemd user service:
make installThis will:
- Build the Rust binary (
cargo install --path .) - Create necessary directories (
~/.config/systemd/userand~/Downloads/discord) - Copy the systemd service file to the user systemd directory
- Reload and enable the service, starting it immediately
To disable and remove the service, run:
make removeThis will:
- Disable and stop the systemd service
- Remove the service file from your user systemd directory
- Reload the daemon
Make sure your user environment supports systemd user services. If user lingering is disabled, enable it by running:
loginctl enable-linger $USERThe systemd user service runs a background Rust program that watches a specified directory (by default, ~/Downloads/discord) for new discord*.deb files.
-
File Detection Watches for new
.debfiles matchingdiscord*.deb. -
User Prompt When detected, prompts the user via
zenityfor installation confirmation. -
Privilege Elevation If the user agrees, invokes
pkexec dpkg --install <path-to-deb>to install the package with elevated privileges. -
Launch Discord After installation, runs
systemd-run --user --scope /usr/bin/discordto start Discord outside the service cgroup.
The default watched directory is:
~/Downloads/discord
To change it, edit the ExecStart line inside the .service file accordingly.