#! /bin/ash
#180224 sfs
d=/tmp/setman
rm -R $d
mkdir -p $d/{desk,hard,pm,sys,other}
cp `egrep -l '^Categories=.*Settings|^Categories=.*System' /usr/share/applications/*.desktop /usr/local/share/applications/*.desktop` $d/other

rm $d/other/settings-manager.desktop
rm `egrep -l '^Categories=.*Terminal|^Categories=.*FileMan' $d/other/*` 
mv `egrep -l '^Categories=.*PackageMan' $d/other/*` $d/pm
mv `egrep -l '^Categories=.*System' $d/other/*` $d/sys
mv `egrep -l '^Categories=.*HardwareSettings' $d/other/*` $d/hard
mv `egrep -l '^Categories=.*DesktopSettings' $d/other/*` $d/desk

w="--item-width=140" # --compact"
#exit
#yad --plug=$$ --tabnum=1 --text="first tab with text" &> res1 &
yad --plug=$$ --tabnum=1 --icons --read-dir=$d/desk $w &#> res2 &
yad --plug=$$ --tabnum=2 --icons --read-dir=$d/hard $w &#> res2 &
yad --plug=$$ --tabnum=3 --icons --read-dir=$d/pm $w &#> res2 &
yad --plug=$$ --tabnum=4 --icons --read-dir=$d/sys $w &#> res2 &
yad --plug=$$ --tabnum=5 --icons --read-dir=$d/other $w &#> res2 &
#yad --plug=$$ --tabnum=6 --text "`inxi -CDND -c0 |tail -n+2`" &
yad --geometry=650x450  \
    --notebook --key=$$  \
    --tab="Персонализация"!desktop \
    --tab="Оборудование"!gtk-harddisk \
    --tab="Программы"!package \
    --tab="Система"!gtk-execute \
    --tab="Прочее"!gtk-add \
    --button=gtk-quit \
    --title="Настройки" \
    --text="Настройки системы и оборудования" \
    --image="gtk-preferences" \
    --window-icon="gtk-preferences" \
    --image-on-top --center \

rm -R $d

