[doc] Added socket checks for the examples
In the examples in awesomerc.5.txt, they kind of assume that awesome is already running. If you run them from your .xinitrc, they'll fail, because the awesome socket isn't available. This patch adds a quick check to make sure the socket is there before starting up. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
038e52c699
commit
568117dae1
|
@ -86,10 +86,19 @@ Simple textbox example
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
echo "0 widget_tell bottom clock text `date`"
|
# if you start this from .xinitrc, the script will start before
|
||||||
echo "" # an empty line flushes data inside awesome
|
# awesome, and will fail.
|
||||||
sleep 1
|
if [ -S ~/.awesome_ctl.0 ]; then
|
||||||
done | awesome-client
|
while true
|
||||||
|
do
|
||||||
|
echo "0 widget_tell bottom clock text `date`"
|
||||||
|
echo "" # an empty line flushes data inside awesome
|
||||||
|
sleep 1
|
||||||
|
done | awesome-client
|
||||||
|
else
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
Note: What we're saying is "awesome-client, tell the bottom status bar's
|
Note: What we're saying is "awesome-client, tell the bottom status bar's
|
||||||
widget named 'clock' to set it's 'text' property to date's output".
|
widget named 'clock' to set it's 'text' property to date's output".
|
||||||
|
@ -148,12 +157,21 @@ Simple progressbar example
|
||||||
4. Create ~/bin/awesome-diskusage
|
4. Create ~/bin/awesome-diskusage
|
||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
while true; do
|
while true
|
||||||
usage = `df /dev/sda5 | awk '/\/dev\/sda5/ { print 100-$5 }'`
|
do
|
||||||
echo "0 widget_tell bottom diskusage data disk ${usage}"
|
# if you start this from .xinitrc, the script will start before
|
||||||
echo "" # an empty line flushes data inside awesome
|
# awesome, and will fail.
|
||||||
sleep 600;
|
if [ -S ~/.awesome_ctl.0 ]; then
|
||||||
done | awesome-client
|
while true; do
|
||||||
|
usage = `df /dev/sda5 | awk '/\/dev\/sda5/ { print 100-$5 }'`
|
||||||
|
echo "0 widget_tell bottom diskusage data disk ${usage}"
|
||||||
|
echo "" # an empty line flushes data inside awesome
|
||||||
|
sleep 600;
|
||||||
|
done | awesome-client
|
||||||
|
else
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
Note: What we're saying is "awesome-client, tell the bottom status bar's
|
Note: What we're saying is "awesome-client, tell the bottom status bar's
|
||||||
|
|
Loading…
Reference in New Issue