I need help to get my skin to show None when it's not connected to Wireless or Ethernet.
I have this for my skin but it's only Showing "Ethernet" and Wireless" when connected via Ethernet or Wi-Fi. I would like it show "None" when connected to neither though and am having trouble getting that going.
Bonus: If I can get it to show "Ethernet and Wireless" when connected to both, that would be great! If not, I'm fine with that.
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_TYPE
SysInfoData=Best
After this point, I've tried various combinations but have had no luck. Anybody have any suggestions on how to do this?
It is currently April 26th, 2024, 1:45 pm
Help Getting Adapter Type Plugin to Show None
-
- Posts: 2
- Joined: November 7th, 2019, 10:51 pm
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Help Getting Adapter Type Plugin to Show None
For me, following code does work.
Unfortunately, I could not achieve the "Ethernet and Wireless" expression when both connections are active...
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=128,128,128,192
[Variables]
ConnectionStatus=""
[MeasureAdapter]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_TYPE
SysInfoData=Best
DynamicVariables=1
[MeasureInternetConnection]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
IfConditionMode=1
IfCondition=MeasureInternetConnection=1
IfTrueAction=[!SetVariable ConnectionStatus [MeasureAdapter]]
IfFalseAction=[!SetVariable ConnectionStatus -None-]
DynamicVariables=1
[MeterAdapter]
Meter=String
W=75
Text=#ConnectionStatus#
DynamicVariables=1
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Help Getting Adapter Type Plugin to Show None
But if you mean "connected" as "connected to the network other than Internet" (ex. LAN), this code probably does not work as intended, I am not sure.
-
- Posts: 2
- Joined: November 7th, 2019, 10:51 pm
Re: Help Getting Adapter Type Plugin to Show None
I am indeed going for connected to the LAN, I apologize. Internet we don't care about but specifically connected to a specific Adapter (Ex. Ethernet, Wireless, or None).
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Help Getting Adapter Type Plugin to Show None
For LAN connection, SysInfoType=LAN_CONNECTIVITY may work. But, because I have no exact LAN environment, can not confirm whether this code works or not.
This code continues to show that Internet connection is active (Ethernet or Wireless), even when I disconnected cable between my home router and WAN terminal. I am not sure why.
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=128,128,128,192
[Variables]
InternetConnectionStatus=""
LANConnectionStatus=""
[MeasureAdapter]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_TYPE
SysInfoData=Best
DynamicVariables=1
[MeasureInternetConnection]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
IfConditionMode=1
IfCondition=MeasureInternetConnection=1
IfTrueAction=[!SetVariable InternetConnectionStatus [MeasureAdapter]]
IfFalseAction=[!SetVariable InternetConnectionStatus -None-]
DynamicVariables=1
[MeasureLANConnection]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
SysInfoData=Best
IfConditionMode=1
IfCondition=MeasureLANConnection=1
IfTrueAction=[!SetVariable LANConnectionStatus [MeasureAdapter]]
IfFalseAction=[!SetVariable LANConnectionStatus -None-]
DynamicVariables=1
[MeterAdapter]
Meter=String
W=120
Text=Internet:#InternetConnectionStatus##CRLF#LAN:#LANConnectionStatus#
DynamicVariables=1
-
- Posts: 332
- Joined: September 3rd, 2018, 11:18 am
Re: Help Getting Adapter Type Plugin to Show None
Add Substitute="0":"None" to the measure that has SysInfoType=ADAPTER_TYPE.
That's it, no other IfConditions or anything else, just use MeasureName to get the info from that measure.
I don't know if that is possible since Windows switches to primarily only one of the internet connections and the measures will do the same as well, though, as mak_kawa pointed out, LAN_CONNECTIVITY would work and IfCondition=((Lan = 1) && (Adapter = 71)) could have worked to detect if you're both connected with the ethernet cable but using the wireless modem to receive info (cause it can't do both at the same time... not yet... 2080 here we come)
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Help Getting Adapter Type Plugin to Show None
Hi Jeff
You are correct. Such IfConditions are totally unnecessary.
But I noticed a weird thing about ADAPTER_TYPE option of sysinfo plugin. Maybe I am missing something. Appreciate any help.
I have both ethernet and WiFi adapters on my Windows10 PC. And when I disabled two adapters from the Windows10 setting dialog for network adapters, output from the ADAPTER_TYPE measure is still "6" and "Ethernet", not "0".
In fact, my Windows10 has one more "network adapter", Bluetooth, as well as other normal Windows10. When I disabled also Bluetooth adapter, the ADAPTER_TYPE measure finally returns "0". Probably, this is normal behavior of sysinfo plugin. But I am wondering why it returns "6" instead of "0" (or "1"?) while Ethernet adapter is inactive??
You are correct. Such IfConditions are totally unnecessary.
But I noticed a weird thing about ADAPTER_TYPE option of sysinfo plugin. Maybe I am missing something. Appreciate any help.
I have both ethernet and WiFi adapters on my Windows10 PC. And when I disabled two adapters from the Windows10 setting dialog for network adapters, output from the ADAPTER_TYPE measure is still "6" and "Ethernet", not "0".
In fact, my Windows10 has one more "network adapter", Bluetooth, as well as other normal Windows10. When I disabled also Bluetooth adapter, the ADAPTER_TYPE measure finally returns "0". Probably, this is normal behavior of sysinfo plugin. But I am wondering why it returns "6" instead of "0" (or "1"?) while Ethernet adapter is inactive??
-
- Rainmeter Sage
- Posts: 2611
- Joined: March 23rd, 2015, 5:26 pm
Re: Help Getting Adapter Type Plugin to Show None
Open a Powershell window and execute the following command:mak_kawa wrote: ↑November 8th, 2019, 8:48 amIn fact, my Windows10 has one more "network adapter", Bluetooth, as well as other normal Windows10. When I disabled also Bluetooth adapter, the ADAPTER_TYPE measure finally returns "0". Probably, this is normal behavior of sysinfo plugin. But I am wondering why it returns "6" instead of "0" (or "1"?) while Ethernet adapter is inactive??
Code: Select all
Get-WmiObject -Class MSFT_NetAdapter -Namespace root\StandardCimv2 | Sort-Object -Property InterfaceType, Virtual, InterfaceDescription | Format-Table -Property @{Label='Interface Name'; Expression={$_.InterfaceDescription}}, @{Label='Connection'; Expression={$_.Name}}, Virtual, State, @{Label='Type'; Expression={$_.InterfaceType}} -AutoSize
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Help Getting Adapter Type Plugin to Show None
Hi SilverAzide
Your suggestion completely solved my confusion. How did you get such incredible powershell command? I can't imagine at all as an end-user of Windows.
Anyway, now I know why Jeff's solution can't help me. Bluetooth is equal to Ethernet in terms of Adapter Type for me. Just one more qustion arose in my dull brain.
The Type of Bluetooth adapter is "6" in every Windows10 and Bluetooth adapter? If yes, Jeff's solution seems to be not applicable at least to Windows10 with Bluetooth.
Or only me?? In other Windows PC with Bluetooth, the Sysinfo plugin with SysInfoType=ADAPTER_TYPE returns "1" (= some other type of network interface) or "0" when Ethernet and Wifi adapter are disabled??
Your suggestion completely solved my confusion. How did you get such incredible powershell command? I can't imagine at all as an end-user of Windows.
Anyway, now I know why Jeff's solution can't help me. Bluetooth is equal to Ethernet in terms of Adapter Type for me. Just one more qustion arose in my dull brain.
The Type of Bluetooth adapter is "6" in every Windows10 and Bluetooth adapter? If yes, Jeff's solution seems to be not applicable at least to Windows10 with Bluetooth.
Or only me?? In other Windows PC with Bluetooth, the Sysinfo plugin with SysInfoType=ADAPTER_TYPE returns "1" (= some other type of network interface) or "0" when Ethernet and Wifi adapter are disabled??
-
- Rainmeter Sage
- Posts: 2611
- Joined: March 23rd, 2015, 5:26 pm
Re: Help Getting Adapter Type Plugin to Show None
As far as I know, ADAPTER_TYPE will only return 0 when there are no active network adapters left to report. This is because of using SysInfoData=Best, which will cause Rainmeter to choose the "best" remaining active adapter until none are left. For the OP, the best way to tell if there is no active adapter is to use your suggestion of SysInfoType=LAN_CONNECTIVITY. If there's no LAN connected, there certainly won't (can't) be a WAN connected, so this should be a reliable indicator. If you REALLY want to get serious, then don't use Rainmeter... there are more precise ways to determine if specific adapters are active.