Nm-applet
nm-applet is a system tray application to help connect to both wired and wireless networks.
Contents |
Running as a non-root user : easy way
Add yourself to netdev group :
adduser username netdev
I guess some similar policy exist on almost any system. If this fails, follow the non easy way below.
Running as a non-root user
If one tries to run nm-applet as a non-root user then it will often show no networks, this is because of its security policies. It is possible to run it using "sudo nm-applet", however this will not allow you to autostart it.
To allow the user to run nm-applet on without root privileges the following files need to be edited:
/etc/dbus-1/system.d/NetworkManager.conf
/etc/dbus-1/system.d/NetworkManagerInfo.conf
/etc/dbus-1/system.d/nm-applet.conf
/etc/dbus-1/system.d/nm-avahi-autoipd.conf
/etc/dbus-1/system.d/nm-dhcp-client.conf
In each file, copy the section of text which starts with <policy user="root"> and ends with </policy>. Paste it immediately below the </policy> line, and change the <policy user="root"> line to your username, i.e. <policy user="fred">, where "fred" is your username.
For example:
<policy user="root"> <allow own="org.freedesktop.nm_dhcp_client"/> <allow send_interface="org.freedesktop.nm_dhcp_client"/> </policy>
Becomes:
<policy user="root"> <allow own="org.freedesktop.nm_dhcp_client"/> <allow send_interface="org.freedesktop.nm_dhcp_client"/> </policy> <policy user="fred"> <allow own="org.freedesktop.nm_dhcp_client"/> <allow send_interface="org.freedesktop.nm_dhcp_client"/> </policy>
After this, nm-applet should work when started normally.
Autostarting
To autostart nm-applet first add the above changes to the configuration, then add:
os.execute("nm-applet &")
To the end of your rc.lua file.
nm-applet >= 0.9.4.1-1
The new version of nm-applet requires polkit to be running in background in order to correctly work. add your username to the netdev group
Create a small run_once script as described in the Autostart page (eg: /usr/local/bin/run_once)
#!/bin/bash #Alternative pgrep $@ > /dev/null || ($@ &)
at the end of the rc.lua add start the gnome polkit daemon and the applet
awful.util.spawn_with_shell("/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1")
awful.util.spawn_with_shell("run_once nm-applet")
- Note
- The run_once script avoid nm-applet to start twice in case of multi-screen configuration.
known issue
The network icon is a bit too large to fit in the status bar.
Alternative to nm-applet
wicd (wicd.sourceforge.net) is an alternative to the gnome network manager and it only gtk dependent. wicd as 3 client front-ends:
- wicd-cli: a scriptable console client
- wicd-curses: a Curse client
- wicd-gtk: a gtk client interface and systray applet.