Ifplugd > Awesome WM 3.4.5-1 widget using awesome-client
Hi LQ,
I'm trying to make a widget for my wibox that is a text field that updates when the network cable is plugged in or unplugged. For the detection purpose, that can also be customized to do things, someone suggested using ifplugd. So I have a text widget in awesome that is to be remotely updated by ifplugd via awesome-client. I've made the widget: Code:
-- }}File: rc.lua: Code:
File: rc.lua: Code:
File: ifplugd.action: Code:
File: up.sh: Code:
File: dn.sh: * The widget works: I have a textbox that I can write things into. * The remote activation works: I can write the "sh -c 'echo..." command in a terminal, and it will change the text succesfully. I can also sh the scripts and that works as well. * Ifplugd does execute the scripts, because when I uncomment the exec lines, it alternates between starting urxvt and x-terminal emulator when I plug in or unplug the network cable. (done to give me a visible output to see whether it executes at all) Problem: For some reason, however, it either doesn't or fails to execute the sh -c 'echo [..]' command, and doesn't affect the text. To try another solution I also configured it to execute a script instead of the line itself, but that doesn't work either. I really don't know why? I've been thinking that maybe it requires permissions as my user or something, or maybe it doesn't output the command to the same place where the widget is looking for input? I can't seem to figure it out, so any thoughts, ideas, suggestions or solutions would be great! |
Accidentally found something out:
The terminals it starts are logged in as "root", not "ifplugd", my user name or something else. When I try to execute the command myself as root, I get this error message: Code:
"Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.naquadah.awesome.awful was not provided by any .service files" |
Hello,
awesome-client communicate with awesome through dbus, so it has to be able to connect to your awesome user's dbus session. IMHO the easiest way is to run awesome-client as your awesome user like Code:
su lys -c 'echo "ips.text = \"dn\"" | awesome-client' |
Right, thanks!
|
All times are GMT -5. The time now is 12:15 PM. |