SliTaz SliTaz Forum

You are not logged in.

#1 2014-10-25 14:49:55

K3nn3th
Member
Registered: 2014-09-13
Posts: 194

openbox pipe menu

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

#2 2014-10-25 16:44:35

K3nn3th
Member
Registered: 2014-09-13
Posts: 194

Re: openbox pipe menu

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

#3 2014-10-26 04:34:51

K3nn3th
Member
Registered: 2014-09-13
Posts: 194

Re: openbox pipe menu

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

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]