Guest User

exit_menu.py

a guest
Jan 31st, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import sys
  4. import os
  5. from tkinter import *
  6. def mbexit():
  7.     os.system("notify-send 'Logging Out'")
  8.     os.system('sleep 0.5')
  9.     os.system('urxvt')
  10. def mbrestart():
  11.     os.system("notify-send 'Restarting'")
  12.     os.system('sleep 0.5')
  13.     os.system('urxvt')
  14. def mbshutdown():
  15.     os.system("notify-send 'Shutting Down'")
  16.     os.system('sleep 0.5')
  17.     os.system('urxvt')
  18.  
  19. mIcon = ''
  20. mGui = Tk()
  21. img = PhotoImage(file = r'/home/chris/Pictures/letter-z.gif')
  22.  
  23. mGui.geometry('450x450+600+200')
  24. mGui.title('ZDM Logout')
  25. mGui.call('wm', 'iconphoto', mGui._w, img)
  26.  
  27. mbutton = Button(text='Restart', command = mbrestart).pack(fill=X, pady=85, padx=60)
  28. mbutton = Button(text='Shutdown', command = mbshutdown).pack(fill=X, pady=10, padx=60)
  29. mbutton = Button(text='Logout', command = mbexit).pack(fill=X, pady=85, padx=60)
  30. mGui.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment