#!/usr/bin/env python
import sys
import subprocess
from dmenuwrap import HandlerDMenu


class ByeOptions:

    def cancel():
        pass

    def shutdown():
        subprocess.call(["systemctl", "poweroff"])

    def suspend():
        subprocess.call(["systemctl", "suspend"])

    def hibernate():
        subprocess.call(["systemctl", "hibernate"])

    def reboot():
        subprocess.call(["systemctl", "reboot"])

    def logout():
        subprocess.call(["i3-msg", "exit"])


if __name__ == '__main__':
    menu = HandlerDMenu(ByeOptions)
    menu.run(sys.argv[1:])
