Skip to content

Instantly share code, notes, and snippets.

@Urpagin
Created July 15, 2025 05:34
Show Gist options
  • Select an option

  • Save Urpagin/4f0ee1e0571fdfddfff6f56104d19cfb to your computer and use it in GitHub Desktop.

Select an option

Save Urpagin/4f0ee1e0571fdfddfff6f56104d19cfb to your computer and use it in GitHub Desktop.
Patches the annoying Discord update pop-up on Linux
#!/usr/bin/env bash
# Patches the annoying update Discord pop-up on Linux.
# Author: Urpagin
# Date: 2025-07-15
# Multiline command
command -v jq >/dev/null 2>&1 && \
f="$HOME/.config/discord/settings.json" && \
{ [[ -f "$f" ]] \
&& c=$(jq '.SKIP_HOST_UPDATE = true' "$f") \
&& [[ -n "$c" ]] || ! echo "Error: the new content is empty" \
&& printf '%s\n' "$c" > "$f" && echo "JSON file successfully updated!" \
|| echo "Failed to update '${f}'. JSON error, or file does not exist.";} \
|| echo "jq not installed."
# One liner
#command -v jq >/dev/null 2>&1 && f="$HOME/.config/discord/settings.json" && { [[ -f "$f" ]] && c=$(jq '.SKIP_HOST_UPDATE = true' "$f") && [[ -n "$c" ]] || ! echo "Error: the new content is empty" && printf '%s\n' "$c" > "$f" && echo "JSON file successfully updated!" || echo "Failed to update '${f}'. JSON error, or file does not exist.";} || echo "jq not installed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment