Nm-applet

From awesome

Jump to: navigation, search

nm-applet is a system tray application to help connect to both wired and wireless networks.

[edit] 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.

[edit] 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.

[edit] 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.

Personal tools