Created
February 14, 2026 17:27
-
-
Save meyt/42329259eb487f73344b76334a383ba9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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