Exemple #1
0
def menu9():

    # Init screen
    kalipi.screen()
    # Outer Border
    kalipi.border(tron_ora)

    #############################
    ##        Buttons          ##

    # Buttons and labels
    # See variables at the top of the document to adjust the menu

    # First Row
    # label 1
    label1.text=labelPadding * " " + kalipi.get_clock()
    label1.draw()


    # Second Row
    # Button 2
    label2.text=labelPadding * " " + kalipi.get_temp()
    label2.draw()

    # Third Row
    # Label 3
    label3.text=labelPadding * " " + kalipi.get_volts()
    label3.draw()

    # Fourth Row
    # Button 7
    button7.disable = 0  # "1" disables button

    if button7.disable == 1:
        button7.draw()
    else:
        # Add button launch code here
        button7.draw()

    # Button 9
    button9.disable = 0  # "1" disables button

    if button9.disable == 1:
        button9.draw()
    else:
        # Add button launch code here
        button9.draw()

    ##        Buttons          ##
    #############################


    #############################
    ##        Input loop       ##

    while 1:
        butNo=kalipi.inputLoop("menu-9.py")
        button(butNo)
Exemple #2
0
def menuPin(argv):

    global c

    # Init screen
    kalipi.screen()
    # Outer Border
    kalipi.border(tron_blu)

    #############################
    ##        Buttons          ##

    # Buttons and labels
    # See variables at the top of the document to adjust the menu

    # Title
    titleButton.draw()

    # First Row
    # Button 1
    button1.disable = 0  # "1" disables button

    if button1.disable == 1:
        button1.draw()
    else:
        # Add button launch code here
        button1.draw()

    # Button 2
    button2.disable = 0  # "1" disables button

    if button2.disable == 1:
        button2.draw()
    else:
        # Add button launch code here
        button2.draw()

    # Button 3
    button3.disable = 0  # "1" disables button

    if button3.disable == 1:
        button3.draw()
    else:
        # Add button launch code here
        button3.draw()

    # Second Row
    # Button 4
    button4.disable = 0  # "1" disables button

    if button4.disable == 1:
        button4.draw()
    else:
        # Add button launch code here
        button4.draw()

    # Button 5
    button5.disable = 0  # "1" disables button

    if button5.disable == 1:
        button5.draw()
    else:
        # Add button launch code here
        button5.draw()

    # Button 6
    button6.disable = 0  # "1" disables button

    if button6.disable == 1:
        button6.draw()
    else:
        # Add button launch code here
        button6.draw()

    # Third Row
    # Button 7
    button7.disable = 0  # "1" disables button

    if button7.disable == 1:
        button7.draw()
    else:
        # Add button launch code here
        button7.draw()

    # Button 8
    button8.disable = 0  # "1" disables button

    if button8.disable == 1:
        button8.draw()
    else:
        # Add button launch code here
        button8.draw()

    # Button 9
    button9.disable = 0  # "1" disables button

    if button9.disable == 1:
        button9.draw()
    else:
        # Add button launch code here
        button9.draw()

    # Button c
    buttonc.disable = 0  # "1" disables button

    if buttonc.disable == 1:
        buttonc.draw()
    else:
        # Add button launch code here
        buttonc.draw()

    # Button 0
    button0.disable = 0  # "1" disables button

    if button0.disable == 1:
        button0.draw()
    else:
        # Add button launch code here
        button0.draw()

    # Button e
    buttone.disable = 0  # "1" disables button

    if buttone.disable == 1:
        buttone.draw()
    else:
        # Add button launch code here
        buttone.draw()

    ##        Buttons          ##
    #############################

    #############################
    ##        Input loop       ##

    if "KPTIMEOUT" in os.environ:
        timeout = float(
            os.environ["KPTIMEOUT"]) * 60 / 3  # Convert timeout to seconds

        #While loop to manage touch screen inputs
        t = timeout

        while True:
            for event in pygame.event.get():
                if event.type == pygame.MOUSEBUTTONDOWN:
                    t = timeout
                    pos = (pygame.mouse.get_pos()[0],
                           pygame.mouse.get_pos()[1])
                    num = local_on_touch()
                    button(num)
                    if c > 0:
                        pygame.draw.rect(screen.canvas, black,
                                         (newOriginX, newOriginX,
                                          buttonWidth * 3, buttonHeight), 0)
                        new_titleButton = Button("      " + c * "* ",
                                                 newOriginX, newOriginX,
                                                 buttonHeight,
                                                 buttonWidth * 3 + spacing * 2,
                                                 tron_blu, green,
                                                 newTitleFont * 2)
                        new_titleButton.draw()
                        if c > 15:
                            c = 0
                    else:
                        pygame.draw.rect(screen.canvas, black,
                                         (newOriginX, newOriginX,
                                          buttonWidth * 3, buttonHeight), 0)
                        titleButton.draw()

                #Debug:
                #ensure there is always a safe way to end the program if the touch screen fails
                ##if event.type == KEYDOWN:
                ##    if event.key == K_ESCAPE:
                ##        sys.exit()
            pygame.display.update()

            ## Reduce CPU utilisation
            time.sleep(0.1)
            t = t - 0.1

            if t <= 0:
                break

        ## Screensaver
        retPage = kalipi.get_retPage()
        kalipi.screensaver(retPage)
        menuPin()

    else:

        #While loop to manage touch screen inputs
        while True:
            for event in pygame.event.get():
                if event.type == pygame.MOUSEBUTTONDOWN:
                    pos = (pygame.mouse.get_pos()[0],
                           pygame.mouse.get_pos()[1])
                    num = local_on_touch()
                    button(num)
                    if c > 0:
                        pygame.draw.rect(screen, black,
                                         (newOriginX, newOriginX,
                                          buttonWidth * 3, buttonHeight), 0)
                        new_titleButton = Button("      " + c * "* ",
                                                 newOriginX, newOriginX,
                                                 buttonHeight,
                                                 buttonWidth * 3 + spacing * 2,
                                                 green, newTitleFont * 2)
                        make_button(new_titleButton)
                        if c > 15:
                            c = 0
                    else:
                        pygame.draw.rect(screen, black,
                                         (newOriginX, newOriginX,
                                          buttonWidth * 3, buttonHeight), 0)
                        make_button(titleButton)

            #Debug:
            #ensure there is always a safe way to end the program if the touch screen fails
            ## if event.type == KEYDOWN:
            ##     if event.key == K_ESCAPE:
            ##         sys.exit()

            pygame.display.update()

            ## Reduce CPU utilisation
            time.sleep(0.1)
Exemple #3
0
def menu3():

    # Init screen
    kalipi.screen()
    # Outer Border
    kalipi.border(tron_blu)

    #############################
    ##        Buttons          ##

    # Buttons and labels
    # See variables at the top of the document to adjust the menu

    # Title
    titleButton.draw()

    # First Row
    # Button 1
    button1.disable = 0  # "1" disables button

    if button1.disable == 1:
        button1.draw()
    else:
        # Add button launch code here
        if check_msf():
            button1.fntColor = green
            button1.draw()
        else:
            button1.fntColor = tron_whi
            button1.draw()

    # Button 2
    button2.disable = 0  # "1" disables button

    if button2.disable == 1:
        button2.draw()
    else:
        # Add button launch code here
        button2.draw()

    # Button 3
    button3.disable = 0  # "1" disables button

    if button3.disable == 1:
        button3.draw()
    else:
        # Add button launch code here
        if check_kismet():
            button3.fntColor = green
            button3.draw()
        else:
            button3.fntColor = tron_whi
            button3.draw()

    # Second Row
    # Button 4
    button4.disable = 1  # "1" disables button

    if button4.disable == 1:
        button4.draw()
    else:
        # Add button launch code here
        if check_service("openvas-manager"):
            button4.fntColor = green
            button4.draw()
        else:
            button4.fntColor = tron_whi
            button4.draw()

    # Button 5
    button5.disable = 1  # "1" disables button

    if button5.disable == 1:
        button5.draw()
    else:
        # Add button launch code here
        if check_service("snortbarn"):
            button5.fntColor = green
            button5.draw()
        else:
            button5.fntColor = tron_whi
            button5.draw()

    # Button 6
    button6.disable = 1  # "1" disables button

    if button6.disable == 1:
        button6.draw()
    else:
        # Add button launch code here
        button6.draw()

    # Third Row
    # Button 7
    button7.disable = 0  # "1" disables button

    if button7.disable == 1:
        button7.draw()
    else:
        # Add button launch code here
        button7.draw()

    # Button 8
    button8.disable = 0  # "1" disables button

    if button8.disable == 1:
        button8.draw()
    else:
        # Add button launch code here
        button8.draw()

    # Button 9
    button9.disable = 0  # "1" disables button

    if button9.disable == 1:
        button9.draw()
    else:
        # Add button launch code here
        button9.draw()

    ##        Buttons          ##
    #############################

    #############################
    ##        Input loop       ##

    while 1:
        butNo = kalipi.inputLoop("menu-3.py")
        button(butNo)
Exemple #4
0
def menu4():

    # Init screen
    kalipi.screen()
    # Outer Border
    kalipi.border(tron_blu)

    #############################
    ##        Buttons          ##

    # Buttons and labels
    # See variables at the top of the document to adjust the menu

    # Title
    titleButton.draw()

    # First Row
    # Button 1
    button1.disable = 0  # "1" disables button

    if button1.disable == 1:
        button1.draw()
    else:
        # Add button launch code here
        script="/usr/bin/sudo /bin/bash " + os.environ["MENUDIR"] + "mana/kalipi-nat-full.sh"
        if kalipi.check_script(script):
            button1.fntColor = green
            button1.draw()
        else:
            button1.draw()


    # Button 2
    button2.disable = 0  # "1" disables button

    if button2.disable == 1:
        button2.draw()
    else:
        # Add button launch code here
        script="/usr/bin/sudo /bin/bash " + os.environ["MENUDIR"] + "mana/kalipi-nat-simple.sh"
        if kalipi.check_script(script):
            button2.fntColor = green
            button2.draw()
        else:
            button2.draw()


    # Button 3
    button3.disable = 0  # "1" disables button

    if button3.disable == 1:
        button3.draw()
    else:
        script="/usr/bin/sudo /bin/bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream.sh"
        if kalipi.check_script(script):
            button3.fntColor = green
            button3.draw()
        else:
            button3.draw()


    # Second Row
    # Button 4
    button4.disable = 0  # "1" disables button

    if button4.disable == 1:
        button4.draw()
    else:
        # Add button launch code here
        script="/usr/bin/sudo /bin/bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-eap.sh"
        if kalipi.check_script(script):
            button4.fntColor = green
            button4.draw()
        else:
            button4.draw()


    # Button 5
    button5.disable = 0  # "1" disables button

    if button5.disable == 1:
        button5.draw()
    else:
        # Add button launch code here
        script="/usr/bin/sudo /bin/bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-eaponly.sh"
        if kalipi.check_script(script):
            button5.fntColor = green
            button5.draw()
        else:
            button5.draw()

    # Button 6
    button6.disable = 0  # "1" disables button

    if button6.disable == 1:
        button6.draw()
    else:
        # Add button launch code here
        script="/usr/bin/sudo /bin/bash " + os.environ["MENUDIR"] + "mana/kalipi-noupstream-eaponly.sh"
        if kalipi.check_script(script):
            button6.fntColor = green
            button6.draw()
        else:
            button6.draw()

    # Third Row
    # Button 7
    button7.disable = 0  # "1" disables button

    if button7.disable == 1:
        button7.draw()
    else:
        # Add button launch code here
        button7.draw()

    # Button 8
    button8.disable = 0  # "1" disables button

    if button8.disable == 1:
        button8.draw()
    else:
        # Add button launch code here
        button8.draw()

    # Button 9
    button9.disable = 0  # "1" disables button

    if button9.disable == 1:
        button9.draw()
    else:
        # Add button launch code here
        button9.draw()

    ##        Buttons          ##
    #############################


    #############################
    ##        Input loop       ##

    while 1:
        butNo=kalipi.inputLoop("menu-4.py")
        button(butNo)
Exemple #5
0
def menu1():

    # Init Pygame
    kalipi.screen()
    # Outer Border
    kalipi.border(tron_blu)

    #############################
    ##        Buttons          ##

    # Buttons and labels
    # See variables at the top of the document to adjust the menu

    # Title
    titleButton.draw()

    # First Row
    # Button 1
    button1.disable = 0  # "1" disables button

    if button1.disable == 1:
        button1.draw()
    else:
        # Add button launch code here
        button1.fntColor = yellow
        button1.draw()

    # Button 2
    button2.disable = 0  # "1" disables button

    if button2.disable == 1:
        button2.draw()
    else:
        # Add button launch code here
        button2.draw()

    # Button 3
    button3.disable = 0  # "1" disables button

    if button3.disable == 1:
        button3.draw()
    else:
        # Add button launch code here
        button3.draw()


    # Second Row
    # Button 4
    button4.disable = 0  # "1" disables button

    if button4.disable == 1:
        button4.draw()
    else:
        # Add button launch code here
        button4.fntColor = yellow
        button4.draw()

    # Button 5
    button5.disable = 0  # "1" disables button

    if button5.disable == 1:
        button5.draw()
    else:
        # Add button launch code here
        if check_vnc():
	    button5.fntColor = green
	    button5.draw()
        else:
	    button5.fntColor = tron_whi
	    button5.draw()

    # Button 6
    button6.disable = 0  # "1" disables button

    if button6.disable == 1:
        button6.draw()
    else:
        # Add button launch code here
        if check_terminal():
            button6.fntColor = green
            button6.draw()
        else:
            button6.fntColor = tron_whi
            button6.draw()

    # Third Row
    # Button 7
    button7.disable = 0  # "1" disables button

    if button7.disable == 1:
        button7.draw()
    else:
        # Add button launch code here
        button7.fntColor = yellow
        button7.draw()

    # Button 8
    button8.disable = 0  # "1" disables button

    if button8.disable == 1:
        button8.draw()
    else:
        # Add button launch code here
        button8.draw()

    # Button 9
    button9.disable = 0  # "1" disables button

    if button9.disable == 1:
        button9.draw()
    else:
        # Add button launch code here
        button9.draw()

    ##        Buttons          ##
    #############################

    #############################
    ##        Input loop       ##

    while 1:
        butNo=kalipi.inputLoop("menu-1.py")
        button(butNo)
Exemple #6
0
def menu2():

    # Init screen
    kalipi.screen()
    # Outer Border
    kalipi.border(tron_blu)

    #############################
    ##        Buttons          ##

    # Buttons and labels
    # See variables at the top of the document to adjust the menu

    # Title
    titleButton.draw()

    # First Row
    # Button 1
    button1.disable = 0  # "1" disables button

    if button1.disable == 1:
        button1.draw()
    else:
        # Add button launch code here
        if kalipi.check_service("apache2"):
            button1.fntColor = green
            button1.draw()
        else:
            button1.fntColor = tron_whi
            button1.draw()

    # Button 2
    button2.disable = 0  # "1" disables button

    if button2.disable == 1:
        button2.draw()
    else:
        # Add button launch code here
        if kalipi.check_service("pure-ftpd"):
            button2.fntColor = green
            button2.draw()
        else:
            button2.fntColor = tron_whi
            button2.draw()

    # Button 3
    button3.disable = 0  # "1" disables button

    if button3.disable == 1:
        button3.draw()
    else:
        # Add button launch code here
        if kalipi.check_service("mysql"):
            button3.fntColor = green
            button3.draw()
        else:
            button3.fntColor = tron_whi
            button3.draw()

    # Button 4
    button4.disable = 0  # "1" disables button

    if button4.disable == 1:
        button4.draw()
    else:
        # Add button launch code here
        if kalipi.check_process("hostapd", "ras-ap.conf"):
            button4.fntColor = green
            button4.draw()
        else:
            button4.fntColor = tron_whi
            button4.draw()

    # Second Row
    # Button 5
    button5.disable = 0  # "1" disables button

    if button5.disable == 1:
        button5.draw()
    else:
        # Add button launch code here
        if kalipi.check_service("darkstat"):
            button5.fntColor = green
            button5.draw()
        else:
            button5.fntColor = tron_whi
            button5.draw()

    # Button 6
    button6.disable = 0  # "1" disables button

    if button6.disable == 1:
        button6.draw()
    else:
        # Add button launch code here
        if kalipi.check_service("ntopng"):
            button6.fntColor = green
            button6.draw()
        else:
            button6.fntColor = tron_whi
            button6.draw()

    # Third Row
    # Button 7
    button7.disable = 0  # "1" disables button

    if button7.disable == 1:
        button7.draw()
    else:
        # Add button launch code here
        button7.draw()

    # Button 8
    button8.disable = 0  # "1" disables button

    if button8.disable == 1:
        button8.draw()
    else:
        # Add button launch code here
        button8.draw()

    # Button 9
    button9.disable = 0  # "1" disables button

    if button9.disable == 1:
        button9.draw()
    else:
        # Add button launch code here
        button9.draw()

    ##        Buttons          ##
    #############################

    #############################
    ##        Input loop       ##

    while 1:
        butNo = kalipi.inputLoop("menu-2.py")
        button(butNo)