You are not logged in.
Pages: 1
hey guys,
im trying to get a working pipe menu which enables me to restart /etc/init.d/network.sh with one of my existing configurations i have stored in a folder, as descriped in http://doc.slitaz.org/en:guides:network-script#openbox
i have to remark though that its also necessary to edit the openbox-menu itself to include the new menu, which is not mentioned in the link above.
so i get a new entry in my openbox menu alright, but opening it gives me following error:
'invalid output from pipe-menu "/usr/lib/openbox/wifinetworks.sh"'
i guess simply saying "echo" in the script isnt feeding the data correctly.
anyone got any thoughts on fixing the script?
Offline
ok there seems to be code missing in the link above.
theres nothing in between the quotaion/citation marks. normally, opening and closing xml tags should go there.
i changed my script to this (commented out bits i dont need):
#!/bin/sh
#
# openbox pipe menu to start network connections
# (This script is only useful if sudo is installed, and correctly configured)
echo '<openbox_pipe_menu>'
# for default file:
#echo ''
#echo ''
#echo 'sudo /etc/init.d/network.sh restart'
#echo ''
# for others files:
for file in $(ls /home/tux/.network/)
do
echo '<item label="'"$file"'">'
echo '<action name="Execute"><execute>'
echo "sudo /etc/init.d/network.sh restart /home/tux/.network/$file"
echo '</execute></action>'
echo '</item>'
done
# To stop connections:
#echo ''
#echo ''
#echo 'sudo /etc/init.d/network.sh stop'
#echo ''
echo '</openbox_pipe_menu>'
when i call it i get this:
root@slitaz:/home/tux# /usr/lib/openbox/wifinetworks.sh
<openbox_pipe_menu>
<item label="WiFiKenny">
<action name="Execute"><execute>
sudo /etc/init.d/network.sh restart /home/tux/.network/WiFiKenny
</execute></action>
</item>
<item label="university">
<action name="Execute"><execute>
sudo /etc/init.d/network.sh restart /home/tux/.network/university
</execute></action>
</item>
</openbox_pipe_menu>
and in my /etc/xdg/openbox/menu.xml ive got this in my root-menu.
<menu id="network-menu" label="Network"
execute="/usr/lib/openbox/wifinetworks.sh" />
still get the error..
Offline
fixed. dont know where exactly my problem was, but adapting the "Templates" pipe-menu from the Openbox Wiki like follwing is working like it should:
#!/bin/bash
echo '<openbox_pipe_menu>'
ls /home/tux/.network/ | while read; do
echo '<item label="'"${REPLY}"'">'
echo -n '<action name="Execute"><execute>'
echo -n "sudo /etc/init.d/network.sh restart '/home/tux/.network/${REPLY}'"
echo '</execute></action>'
echo '</item>'
done
echo '</openbox_pipe_menu>'
Offline
Pages: 1
[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]