from typing import OrderedDict


def read_config(config):
    """Parse config (configparser) and return a dict of sections : 
    {'section_name' : [list of launchers] }

    Each launcher is : 
    launcher = ['name','cmd','icon']

    In the end : 
    config = {'section_name' [ [name, cmd, icon], [name, cmd, icon]] ... }
    """

    cf = OrderedDict()
    for s in config.sections():
        cf[s] = [ [i.strip() for i in infos.split(',') ] 
                        for option, infos in config.items(s)
                        if option != "closeafterrun" \
                                and option != "theme" \
                                and option != "titlebar" \
                                and option != "title" ]
    return cf