from krita import *
#https://krita-artists.org/t/set-hotkey-for-specific-brush-size-and-or-custom-set-of-brush-sizes-to-increment-decrement-among/77962/14
# Script configuration:
BRUSH_SIZES = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 125, 150, 175, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000] # brush sizes to cycle through
MODE_INCREASE = True             # change to False to decrease the size instead
def main():
    krita = Krita.instance()
    window = krita.activeWindow()
    view = window.activeView()
    size = view.brushSize()
    size = round(size)
    if MODE_INCREASE:
        size = next((s for s in BRUSH_SIZES if s > size), BRUSH_SIZES[-1])
    else:
        size = next((s for s in reversed(BRUSH_SIZES) if s < size), BRUSH_SIZES[0])

    view.setBrushSize(size)
    # monkey patching View class
    def message_eating_monkey(*args, **kwargs):
        pass  # nom nom ...
    type(view).showFloatingMessage = message_eating_monkey