#! /bin/bash

ACCESS="Accesories"
OFFICE="Office"
GRAPH="Graphics"
GAMES="Games"
INET="Internet"
MMEDIA="Multimedia"
MXTOOLS="MX-Tools"
SETTGS="Settings"
DEVPMNT="Development"
SYSTM="System"
ALLAPPS="ALL APPS"

ACCESSi="  $ACCESS"
OFFICEi="  $OFFICE"
GRAPHi="  $GRAPH"
GAMESi="  $GAMES"
INETi="  $INET"
MMEDIAi="  $MMEDIA"
MXTOOLSi="  $MXTOOLS"
SETTGSi="  $SETTGS"
DEVPMNTi="  $DEVPMNT"
SYSTMi="  $SYSTM"
ALLAPPSi="  Apps"

if [ x"$@" = x"$ALLAPPS" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "" -display-drun  "$ALLAPPSi"
fi

if [ x"$@" = x"$ACCESS" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "Utility,Accessories" -display-drun "$ACCESSi"
fi

if [ x"$@" = x"$OFFICE" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "Office,TextEditor" -display-drun "$OFFICEi"
fi

if [ x"$@" = x"$GRAPH" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "Graphics,Image,Photo" -display-drun "$GRAPHi"
fi

if [ x"$@" = x"$GAMES" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "Game" -display-drun "$GAMESi"
fi

if [ x"$@" = x"$INET" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "Network,WebBrowser" -display-drun "$INETi"
fi

if [ x"$@" = x"$MMEDIA" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "Music,Sound,Video,Audio,AudioVideo,Multimedia" -display-drun "$MMEDIAi"
fi

if [ x"$@" = x"$MXTOOLS" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "MX-Setup,MX-Maintenance,MX-Software,MX-Utilities,MX-Live" -display-drun "$MXTOOLSi"
fi

if [ x"$@" = x"$SETTGS" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories  "Settings" -display-drun "$SETTGSi"
fi

if [ x"$@" = x"$DEVPMNT" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "Development,TerminalEmulator"  -display-drun "$DEVPMNTi"
fi

if [ x"$@" = x"$SYSTM" ];
then
killall rofi
sleep 0.25
rofi -show drun  -drun-categories "System" -display-drun "$SYSTMi"
fi

echo -e "$ALLAPPS\0icon\x1fapplications-all"
echo -e "$ACCESS\0icon\x1fapplications-accessories"
echo -e "$DEVPMNT\0icon\x1fapplications-development"
echo -e "$GAMES\0icon\x1fapplications-games"
echo -e "$GRAPH\0icon\x1fapplications-graphics"
echo -e "$INET\0icon\x1fapplications-webbrowsers"
echo -e "$MMEDIA\0icon\x1fapplications-multimedia"
echo -e "$MXTOOLS\0icon\x1fmx-tools"
echo -e "$OFFICE\0icon\x1fapplications-office"
echo -e "$SETTGS\0icon\x1fpreferences-desktop"
echo -e "$SYSTM\0icon\x1fapplications-system"
