Starting from a similar extension: https://github.com/kustodian/extended-statusbar i have imported its code