A smart auto-updater for Discord on Linux that checks for updates and seamlessly installs them when available. Now supports first-time Discord installation!
The script will:
- Check if Discord is installed - if not, automatically install it
- Check your current Discord version
- Compare with the latest available version
- If an update is available, download and prompt for sudo password to install
- Launch Discord
- Debian/Ubuntu-based Linux system with
dpkg
package manager - Python 3.8+
- Python packages:
requests
,packaging
(see requirements.txt) notify-send
(libnotify) - for desktop notifications (usually pre-installed)- Polkit authentication agent - for GUI password prompts (see setup below)
Discord Butler uses pkexec
for secure privilege escalation with GUI authentication dialogs. You need a polkit authentication agent running.
For i3/dwm/minimal window managers:
# Install lightweight polkit agent
sudo apt install lxpolkit
# Add to your window manager startup (e.g., ~/.config/i3/config)
exec --no-startup-id lxpolkit
For other desktop environments:
# GNOME-based systems
sudo apt install policykit-1-gnome
# KDE-based systems
sudo apt install polkit-kde-agent-1
Verify setup:
# This should show a GUI authentication dialog
pkexec echo "Polkit working!"
-
Clone this repository:
git clone https://github.com/maniac-en/discord-butler cd discord-butler
-
Install dependencies (choose one method):
pip install -r requirements.txt --break-system-packages
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
- Run the application:
python main.py
If you installed using a virtual environment, activate it first:
source venv/bin/activate # Only needed if using virtual environment
Then run the application:
python main.py
To run Discord Butler from app launchers that support .desktop
files:
-
Make the script executable:
chmod +x main.py
-
Create a desktop entry at
~/.local/share/applications/discord-butler.desktop
:For system-level installation:
[Desktop Entry] Name=Discord Butler Comment=Auto-update Discord and launch Exec=/path/to/discord-butler/main.py Icon=discord Terminal=false Type=Application Categories=Network;InstantMessaging;
For virtual environment installation:
[Desktop Entry] Name=Discord Butler Comment=Auto-update Discord and launch Exec=/path/to/discord-butler/venv/bin/python /path/to/discord-butler/main.py Icon=discord Terminal=false Type=Application Categories=Network;InstantMessaging;
-
Update desktop database:
update-desktop-database ~/.local/share/applications/
Since dmenu doesn't recognize .desktop
files, create a wrapper script in your PATH:
I've provided helper commands to just copy-paste and set it up easily!
For system-level installation:
# Quick setup (run from the discord-butler directory)
chmod +x main.py && ln -sf "$(pwd)/main.py" ~/.local/bin/discord-butler
For virtual environment installation:
# Create a wrapper script
cat > ~/.local/bin/discord-butler << 'EOF'
#!/bin/bash
cd /path/to/discord-butler
source venv/bin/activate
python main.py
EOF
# Make it executable
chmod +x ~/.local/bin/discord-butler
Manual setup:
- System-level: Create symlink:
ln -sf /full/path/to/discord-butler/main.py ~/.local/bin/discord-butler
- Virtual environment: Create wrapper script as shown above, replacing
/path/to/discord-butler
with your actual path - Ensure
~/.local/bin
is in your PATH (addexport PATH="$HOME/.local/bin:$PATH"
to your shell config if needed)
Now you can run discord-butler
from dmenu.