1. vi /etc/xdg/autostart/myscript.desktop
[Desktop Entry]
Name=TeXInfo
Comment=The viewer for TexInfo documents
Exec=/home/gdwave/startup.sh
Icon=dialog-information
Type=Application
Categories=Utility;Documentation;ConsoleOnly;
Terminal=true
X-Desktop-File-Install-Version=0.26
2. vi startup.sh
#!/bin/bash
python3 login.py
exit 0
3. vi login.py
import tkinter as tk
from tkinter import messagebox # python3.0的messagebox,属于tkinter的一个组件
def box():
return messagebox.askyesno(title='弹窗', message='内容')
class Fullscreen_Example:
def __init__(self):
self.window = tk.Tk()
self.window.attributes('-fullscreen', True)
self.window.bind("<F11>",
lambda event: self.window.attributes("-fullscreen",
not self.window.attributes("-fullscreen")))
self.window.bind("<Escape>",
lambda event: self.window.attributes("-fullscreen",
not self.window.attributes("-fullscreen")))
self.window.bind("<Alt_R>",
lambda event: box(), box())
self.window.mainloop()
if __name__ == '__main__':
app = Fullscreen_Example()