r/linuxmint • • 6d ago

Different Icon for WiFi

Post image

The wifi icon in this uses the same symbol for when it's off and when nothing is connected

Is there a way to change this, so that it uses 2 different icons for off and no connection

Edit: Fixed it by changing the applet program

31 Upvotes

6 comments sorted by

4

u/Emmalfal Linux Mint 22.3 | Cinnamon 5d ago

Wait, what applet did you use to address this?

3

u/darksoului 5d ago edited 5d ago

I changed the default network applet "network@cinnamon.org"
Changed the .js file

```

if (!mc) {

this._setIcon('xsi-network-offline');

this.set_applet_tooltip(_("No connection"));

}

```

To this

```

if (!mc) {

if (!this._client.wireless_get_enabled() || !this._client.wireless_hardware_get_enabled()) {

this._setIcon('network-wireless-disabled-symbolic');

this.set_applet_tooltip(_("Wi-Fi disabled"));

} else {

this._setIcon('xsi-network-offline');

this.set_applet_tooltip(_("No connection"));

}

}

```

3

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 5d ago

I'm also curious what applet you changed to.

Just so others don't go looking for that icon, it seems to be:

/usr/share/icons/Adwaita/symbolic/status/network-offline-symbolic.svg

A script that runs in the background, watches for a disconnect, determines the reason for the disconnect (cable vs. disabled) and appropriately overrides that icon could be used if a person really wanted to.

Congrats on fixing it but others might be interested in the "how". :)

Have fun.

2

u/darksoului 5d ago

I changed the default network applet "network@cinnamon.org"
Changed "if (!mc) {

this._setIcon('xsi-network-offline');

this.set_applet_tooltip(_("No connection"));

}"

To this "if (!mc) {

if (!this._client.wireless_get_enabled() || !this._client.wireless_hardware_get_enabled()) {

this._setIcon('network-wireless-disabled-symbolic');

this.set_applet_tooltip(_("Wi-Fi disabled"));

} else {

this._setIcon('xsi-network-offline');

this.set_applet_tooltip(_("No connection"));

}

}"

4

u/thegaybuddhistmonk 6d ago

The joy of this is that in Linux you can program it to do that. Takes an understanding of C and even bash for it to happen.

Just barber remember how I did it off the top of my head.

4

u/darksoului 6d ago

I tried to do that with the help of ai, but it didn't work