mirror of
https://github.com/Snigdha-OS/snigdhaos-welcome.git
synced 2025-09-20 22:14:56 +02:00
🐛 fix(block): where intend block was not working
This commit is contained in:
@@ -47,7 +47,7 @@ label#label_style {
|
|||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: pink;
|
color: #6495ed;
|
||||||
}
|
}
|
||||||
label#label_style_eshan {
|
label#label_style_eshan {
|
||||||
background-color: @theme_base_color;
|
background-color: @theme_base_color;
|
||||||
@@ -65,58 +65,58 @@ label#label_style_eshan {
|
|||||||
|
|
||||||
class Main(Gtk.Window):
|
class Main(Gtk.Window):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Main, self).__init__(title="Snigdha OS Welcome")
|
super(Main, self).__init__(title="Snigdha OS Welcome")
|
||||||
|
|
||||||
# Basic Window Configuration
|
# Basic Window Configuration
|
||||||
self.set_border_width(10) # Set the border width of the window
|
self.set_border_width(10) # Set the border width of the window
|
||||||
self.set_default_size(860, 450) # Set the default size of the window
|
self.set_default_size(860, 450) # Set the default size of the window
|
||||||
self.set_icon_from_file(os.path.join(base_dir, "images/snigdhaos-welcome-small.png")) # Set the window icon
|
self.set_icon_from_file(os.path.join(base_dir, "images/snigdhaos-welcome-small.png")) # Set the window icon
|
||||||
self.set_position(Gtk.WindowPosition.CENTER) # Center the window on the screen
|
self.set_position(Gtk.WindowPosition.CENTER) # Center the window on the screen
|
||||||
self.results = "" # Initialize results to an empty string
|
self.results = "" # Initialize results to an empty string
|
||||||
|
|
||||||
# Initialize Configuration Directory and Settings
|
# Initialize Configuration Directory and Settings
|
||||||
config_dir = os.path.join(GUI.home, ".config/snigdhaos-welcome/") # Define the configuration directory path
|
config_dir = os.path.join(GUI.home, ".config/snigdhaos-welcome/") # Define the configuration directory path
|
||||||
if not os.path.exists(config_dir): # Check if the directory exists
|
if not os.path.exists(config_dir): # Check if the directory exists
|
||||||
|
try:
|
||||||
|
os.makedirs(config_dir, exist_ok=True) # Create the directory if it doesn't exist
|
||||||
|
with open(GUI.Settings, "w") as f: # Open the settings file in write mode
|
||||||
|
f.write("autostart=True") # Write default settings
|
||||||
|
except OSError as e:
|
||||||
|
print(f"Error initializing configuration: {e}") # Handle any file/directory creation errors
|
||||||
|
|
||||||
|
# CSS Styling
|
||||||
|
self.style_provider = Gtk.CssProvider() # Create a CSS provider
|
||||||
try:
|
try:
|
||||||
os.makedirs(config_dir, exist_ok=True) # Create the directory if it doesn't exist
|
# Load the CSS data into the style provider
|
||||||
with open(GUI.Settings, "w") as f: # Open the settings file in write mode
|
self.style_provider.load_from_data(css, len(css))
|
||||||
f.write("autostart=True") # Write default settings
|
# Apply the style provider to the default screen
|
||||||
except OSError as e:
|
Gtk.StyleContext.add_provider_for_screen(
|
||||||
print(f"Error initializing configuration: {e}") # Handle any file/directory creation errors
|
Gdk.Screen.get_default(),
|
||||||
|
self.style_provider,
|
||||||
|
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION, # Set priority for application-specific styles
|
||||||
|
)
|
||||||
|
except GLib.Error as e:
|
||||||
|
print(f"Error loading CSS: {e}") # Handle CSS loading errors
|
||||||
|
|
||||||
# CSS Styling
|
# Initialize Internal Attributes
|
||||||
self.style_provider = Gtk.CssProvider() # Create a CSS provider
|
self.pkg_queue = Queue() # Initialize a queue for package operations
|
||||||
try:
|
self.pacman_lockfile = "/var/lib/pacman/db.lck" # Define the lockfile path for pacman
|
||||||
# Load the CSS data into the style provider
|
self.sudo_username = os.getlogin() # Get the username of the user running the script
|
||||||
self.style_provider.load_from_data(css, len(css))
|
self.calamares_polkit = "/usr/bin/calamares_polkit" # Path to the Calamares Polkit executable
|
||||||
# Apply the style provider to the default screen
|
self.session = None # Initialize session attribute
|
||||||
Gtk.StyleContext.add_provider_for_screen(
|
|
||||||
Gdk.Screen.get_default(),
|
|
||||||
self.style_provider,
|
|
||||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION, # Set priority for application-specific styles
|
|
||||||
)
|
|
||||||
except GLib.Error as e:
|
|
||||||
print(f"Error loading CSS: {e}") # Handle CSS loading errors
|
|
||||||
|
|
||||||
# Initialize Internal Attributes
|
# Retrieve Session Information
|
||||||
self.pkg_queue = Queue() # Initialize a queue for package operations
|
self.get_session() # Fetch the session information (implementation not shown here)
|
||||||
self.pacman_lockfile = "/var/lib/pacman/db.lck" # Define the lockfile path for pacman
|
|
||||||
self.sudo_username = os.getlogin() # Get the username of the user running the script
|
|
||||||
self.calamares_polkit = "/usr/bin/calamares_polkit" # Path to the Calamares Polkit executable
|
|
||||||
self.session = None # Initialize session attribute
|
|
||||||
|
|
||||||
# Retrieve Session Information
|
# Initialize GUI
|
||||||
self.get_session() # Fetch the session information (implementation not shown here)
|
GUI.GUI(self, Gtk, GdkPixbuf) # Initialize the graphical user interface components
|
||||||
|
|
||||||
# Initialize GUI
|
# Start Internet Notifier Thread if the user matches the GUI user
|
||||||
GUI.GUI(self, Gtk, GdkPixbuf) # Initialize the graphical user interface components
|
if GUI.username == GUI.user: # Check if the username matches
|
||||||
|
internet_notifier_thread = threading.Thread(
|
||||||
# Start Internet Notifier Thread if the user matches the GUI user
|
target=self.internet_notifier, daemon=True # Create a thread for the internet notifier
|
||||||
if GUI.username == GUI.user: # Check if the username matches
|
)
|
||||||
internet_notifier_thread = threading.Thread(
|
internet_notifier_thread.start() # Start the thread
|
||||||
target=self.internet_notifier, daemon=True # Create a thread for the internet notifier
|
|
||||||
)
|
|
||||||
internet_notifier_thread.start() # Start the thread
|
|
||||||
|
|
||||||
def get_session(self):
|
def get_session(self):
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user