CopperBadger / dotfiles

My dotfiles + utility scripts for Arch + i3-gaps
104 stars 5 forks source link

Detect if Ethernet is being used, and adjust to show at i3 start #7

Closed ghost closed 8 years ago

ghost commented 8 years ago

I thought it would be neat if i3 would show ethernet status if it were being used. I tried to do this myself, but had an issue.

I uncommented the 'eth' portion of the parser, and changed the colors to fit the wifi's colors. I also copied the options for wifi in the conky config, and edited it to show my ethernet poert. Using ethu and ethd at the bottom show Ethernet status. I tried to do an if statement, where if sys_arr[10] was "up", it would show Ethernet, but the bar was blank. I suspect this has to do with the viscmds near the bottom, so I attempted a nested if statement --- replacing the wifi-only printf with the aforementioned sys_arr[10] if statement, but this only shows wifi regardless of ethernet status.

Do you know what I did wrong? I can provide my files if you need them.

EDIT: I swapped eth and wlan, and it works; you don't even have to restart i3 for it to switch. I can provide the files if you would like to add them to yours, I'll keep this open so you can see it.

CopperBadger commented 8 years ago

Hiya! Sorry for missing this + thanks for looking into it! I was thinking of doing the same thing recently.

I suppose this is as good a place as any to mention it: I've actually overhauled my UI quite a bit since I last updated my repo (check it out here), so there will be a large wave of changes coming through at some point. I'll still keep the old bar scripts in the repo if you prefer them though. The new bar only displays the current wifi network's SSID by default, however it can easily display usage numbers as well, and (as you've shown) similar details for wired networks; it uses the same electro7 scripts to run.