What you are suggesting would certainly be possible, but the more complex logic would require an overhaul of the script.
Feel free to adapt the script to suit your needs. If you run into issues, email me on here and I'll try to help.
]]>Example.
When wifi is connected have the wifi icon with tooltip showing in systray.
When the ethernet is connected have the wired icon with tooltip showing in systray.
But dont show both icons when only one connection is up, only show the respected icon and tooltip for the connection.
??
I suppose this is going beyond what wifi-monitor was intended for, but you have to agree that having eth and wifi on one script would be cool, you could rename it net-monitor?
]]>I bet these scripts could be improved to read /etc/default/autowifi files so the original scripts could be controlled by a dpkg... is anyone interested in seeing some effort on that?
]]>...so I did roll my own tiny alternative to yad using python:
#!/usr/bin/python3
import sys
from PyQt4 import QtGui, QtCore
def show_icon(icon, tooltip):
class SystemTrayIcon(QtGui.QSystemTrayIcon):
def __init__(self, icon, parent=None):
QtGui.QSystemTrayIcon.__init__(self, icon, parent)
self.setToolTip(tooltip)
def exit(self):
QtCore.QCoreApplication.exit()
app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
trayIcon = SystemTrayIcon(QtGui.QIcon(icon), w)
trayIcon.show()
sys.exit(app.exec_())
icon=sys.argv[1]
tooltip=sys.argv[2]
show_icon(icon, tooltip)
If you'd like to try it:
1. Paste this code into a blank text file, name it show-icon, put it somewhere in your PATH, make it executable
2. Install the script's two dependencies: $ sudo apt install python3 python3-pyqt4
3. Test it: $ show-icon /path/to/icon.png "hello world" &
If the yad test I suggested in post #5 doesn't work, try this python script. If the python script ("show-icon") works, let me know and I can customize wifi-monitor for you (to use show-icon instead of yad).
]]>What happens when you type this in a terminal?
yad --notification --image=dialog-ok --text="hello world"
You should see "hello world" when you hover over the icon. If you don't see it, it's because yad and tint2 are not playing nice together.
yad works perfectly for me in both MATE and fluxbox.
If you want to use wifi-monitor but are married to tint2, you can swap out yad for some other utility to show the icon+tooltip. I can explore some alternatives.
]]>Using tint2 i tried out wifi-monitor and it works ok but it would be a nice added extra to have some form of tool-tip to show the essid, the script looks like it should have this but mouse hover for me over the icon reveals nothing. Is that a possibility already or something to be added perhaps?
]]>It should work in Xfce as well. Note that, in the interest of simplicity, the icon only shows up when internet is connected. If there is no internet connectivity, then no icon is the expected behavior.
]]>Even better, it installs and runs in my nodbus beowulf, and the icon shows up on lxpanel. Testing in a live-iso running in a VM was less than ideal, and I didn't jump through all the hoops to get it to actually connect. I can do that with an installed system some time.
Thanks.
]]>a. handful of wireless hotspots (SSID and password) should be remembered
b. at boot, laptop should connect to highest-priority hotspot among those available
c. an icon should appear while I am connected to internet, showing hotspot's SSID
Given such simple needs, for many years I thought having a "network manager" installed was overkill. Finally, for the past few months I've been enjoying a completely network-manager-free computing experience thanks to these two simple shell scripts I wrote:
https://github.com/bdantas/autowifi (currently 63 lines including comments and blank lines)
https://github.com/bdantas/wifi-monitor (currently 51 lines including comments and blank lines)
I'd like to share the scripts with my Devuan friends. If you'd like to use them, all you need to do is:
1. Install some basic packages (you likely have most of them installed already):
sudo apt install procps net-tools wireless-tools wpasupplicant udhcpc curl yad
2. Download the two scripts, put them somewhere in your PATH, adjust the "user variables" at the top as appropriate, change the ssid/password strings at the top of autowifi as appropriate, make the scripts executable
3. Add sudo autowifi & and wifi-monitor & to your startup jobs (note that wifi-monitor should run without sudo)
4. Disable your current network manager (e.g., sudo update-rc.d network-manager disable)
5. Reboot
If you decide to try it, please let me know how it goes.
Cheers,
Bruno "GNUser"
P.S. If you change your mind and want to go back to using the network manager, just remove the two startup jobs and re-enable the network manager (e.g., sudo update-rc.d network-manager enable)
]]>