[arch-general] Get netctl status from C?
rodrigorivascosta at gmail.com
Tue Dec 17 07:11:36 EST 2013
On Sun, Dec 15, 2013 at 7:01 AM, Daniel Bryan <danbryan at gmail.com> wrote:
> I run dwm with a custom C program to update the status bar.
> So far I can check everything without needing to exec(), e.g. through
> libmpd, parsing /proc/meminfo, and so on.
> Is there a way to interface with the netctl profile system from C? I
> really just want to find the currently actively profile.
> I pulled down the code for netctl with abs and it seems to amount
> largely to shell scripts that will with stuff in /sys. It doesn't look
> too daunting, but I'd prefer a native interface if one exists.
netctl profiles are actually systemd units: if the profile is "foo" then
the unit is "netctl at foo.service".
And systemd has a C interface by using dbus, I think...
More information about the arch-general