Skip to content

Instantly share code, notes, and snippets.

@meyt
Created February 14, 2026 17:27
Show Gist options
  • Select an option

  • Save meyt/42329259eb487f73344b76334a383ba9 to your computer and use it in GitHub Desktop.

Select an option

Save meyt/42329259eb487f73344b76334a383ba9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Query the GNOME proxy mode
MODE=$(gsettings get org.gnome.system.proxy mode | tr -d "'")
if [ "$MODE" = "manual" ]; then
HOST=$(gsettings get org.gnome.system.proxy.http host | tr -d "'")
PORT=$(gsettings get org.gnome.system.proxy.http port)
# Check if host is local
if [[ "$HOST" == "127.0.0.1" || "$HOST" == "localhost" ]]; then
DISPLAY_VAL="$PORT"
else
DISPLAY_VAL="$HOST:$PORT"
fi
# Proxy ON
echo "<img>/usr/share/icons/elementary-xfce/panel/16/network-vpn.png</img>"
echo "<txt><span color='#3498db'>$DISPLAY_VAL</span></txt>"
echo "<tool>Proxy: $MODE ($HOST:$PORT)</tool>"
else
# Proxy OFF
echo "<img>/usr/share/icons/elementary-xfce/panel/16/network-vpn-acquiring.png</img>"
echo "<txt><span color='#7f8c8d'>OFF</span></txt>"
echo "<tool>System Proxy is Disabled</tool>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment