slitaz-dev-tools view baba-scripts/edf @ rev 247
tazwikiss: large page support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Sep 02 21:21:36 2015 +0200 (2015-09-02) |
parents | |
children |
line source
1 #!/bin/sh
3 MAIN_DIALOG='
4 <window title="edf" window_position="1" decorated="false" width-request="600">
5 <vbox>
6 <text use-markup="true"><label>"<b>Enhanced df</b>"</label></text>
7 <text height-request="10"><label>""</label></text>
8 <tree>
9 <label>Device|Mount point|Total size|Occupied|Occ.ratio|Free</label>
10 '
11 I=$IFS; IFS=$'\n'
12 for line in `df -h | tail -n +2 | grep ^/dev/ | sed -e "s/ \+/|/g"`
13 do
14 device=`echo $line | cut -d'|' -f1`
15 total=`echo $line | cut -d'|' -f2`
16 occupied=`echo $line | cut -d'|' -f3`
17 free=`echo $line | cut -d'|' -f4`
18 ratio=`echo $line | cut -d'|' -f5`
19 mount=`echo $line | cut -d'|' -f6`
20 MAIN_DIALOG=$MAIN_DIALOG"
21 <item>$device|$mount|$total|$occupied|$ratio|$free</item>"
22 done
23 IFS=$I
24 MAIN_DIALOG=$MAIN_DIALOG'
25 </tree>
26 <button ok></button>
27 </vbox>
28 </window>
29 '
30 export MAIN_DIALOG
32 gtkdialog -p MAIN_DIALOG