mirror of
https://github.com/MatMasIt/guestacct.git
synced 2026-01-20 12:06:52 +01:00
First commit
This commit is contained in:
31
notice.py
Executable file
31
notice.py
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
# To put in home directory autoexec
|
||||
import sys
|
||||
from PyQt5.QtWidgets import QApplication, QMessageBox
|
||||
from PyQt5.QtCore import Qt
|
||||
|
||||
# Create a Qt application
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
# Create a message box
|
||||
msg = QMessageBox()
|
||||
msg.setIcon(QMessageBox.Information)
|
||||
|
||||
msg.setWindowTitle("Welcome into the guest account!")
|
||||
msg.setText("Welcome!\nThis is an ephemeral session.\n\nAll the changes made will be reverted at logout.\nPlease save your work elsewhere.\n\nFor more information, contact the administrator.")
|
||||
msg.setStandardButtons(QMessageBox.Ok)
|
||||
|
||||
|
||||
|
||||
|
||||
# Set the window flags to remove all buttons (minimize, maximize, close)
|
||||
msg.setWindowFlags(Qt.Dialog | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
|
||||
|
||||
# Disable resizing by setting a fixed size
|
||||
msg.setFixedSize(400, 200)
|
||||
|
||||
# Make the window modal (optional, to block interaction with other windows)
|
||||
msg.setWindowModality(Qt.ApplicationModal)
|
||||
|
||||
# Show the message box in the center of the screen
|
||||
msg.exec_()
|
||||
Reference in New Issue
Block a user