Last active
February 17, 2023 10:29
-
-
Save romanvm/110e038fefbb8afa107084bc052b3cec to your computer and use it in GitHub Desktop.
VPN indicator fix for Cinnamon desktop Network applet
This file contains 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
// The code is public domain and you can use it as you want. | |
// The following code should be added to _updateIcon function after else block and before catch block | |
// around line # 2345 | |
// File path: /usr/share/cinnamon/applets/[email protected]/applet.js | |
// When VPN is connected the network icon is changed to "lock with WiFi" if connected via WiFi | |
// and to "lock with wire" if connected via other methods. | |
// *** Start of VPN icon fix *** | |
for (let i = 0; i < this._activeConnections.length; i++) { | |
const a = this._activeConnections[i]; | |
if (a._section === NMConnectionCategory.VPN && a.state === NM.ActiveConnectionState.ACTIVATING) { | |
this._setIcon('network-vpn-acquiring'); | |
this.set_applet_tooltip(_("Connecting to the VPN...")); | |
break; | |
} | |
else if (a._section === NMConnectionCategory.VPN && a.state === NM.ActiveConnectionState.ACTIVATED) { | |
let iconName = 'network-vpn'; | |
if (mc._section == NMConnectionCategory.WIRELESS) { | |
const dev = mc._primaryDevice; | |
if (dev) { | |
const ap = dev.device.active_access_point; | |
iconName = 'network-wireless-signal-' + signalToIcon(ap.strength) + '-secure-symbolic'; | |
} | |
} | |
this._setIcon(iconName); | |
this.set_applet_tooltip(_("Connected to the VPN")); | |
break; | |
} | |
} | |
// *** End of VPN icon fix *** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment