mirror of
https://github.com/Snigdha-OS/snigdhaos-gnome-config.git
synced 2025-09-20 20:24:56 +02:00
⚡️ perf(_imp): enhanced & error handling
This commit is contained in:
@@ -1,9 +1,40 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Description: Configures environment variables for Wayland and Qt applications.
|
||||||
|
# Author : Eshan Roy <m.eshanized@gmail.com>
|
||||||
|
# Author URL : https://eshanized.github.io/
|
||||||
|
|
||||||
|
# Function to log messages
|
||||||
|
log_message() {
|
||||||
|
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Log the start of the script
|
||||||
|
log_message "Starting environment configuration script..."
|
||||||
|
|
||||||
|
# Check if the session type is Wayland
|
||||||
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
||||||
export QT_QPA_PLATFORM=wayland
|
log_message "Wayland session detected."
|
||||||
export MOZ_ENABLE_WAYLAND=1
|
|
||||||
|
# Set the Qt platform to Wayland
|
||||||
|
export QT_QPA_PLATFORM=wayland
|
||||||
|
log_message "Set QT_QPA_PLATFORM to 'wayland'."
|
||||||
|
|
||||||
|
# Enable Wayland support for Mozilla applications
|
||||||
|
export MOZ_ENABLE_WAYLAND=1
|
||||||
|
log_message "Enabled Wayland support for Mozilla applications (MOZ_ENABLE_WAYLAND=1)."
|
||||||
|
else
|
||||||
|
log_message "Non-Wayland session detected. No Wayland-specific variables set."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set some other environment variables
|
# Set a custom Qt style engine to Kvantum
|
||||||
export QT_STYLE_OVERRIDE=kvantum
|
export QT_STYLE_OVERRIDE=kvantum
|
||||||
|
log_message "Set QT_STYLE_OVERRIDE to 'kvantum'."
|
||||||
|
|
||||||
|
# Verify environment variable settings
|
||||||
|
log_message "Verifying environment variables..."
|
||||||
|
log_message "QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-not set}"
|
||||||
|
log_message "MOZ_ENABLE_WAYLAND=${MOZ_ENABLE_WAYLAND:-not set}"
|
||||||
|
log_message "QT_STYLE_OVERRIDE=${QT_STYLE_OVERRIDE:-not set}"
|
||||||
|
|
||||||
|
# Log the end of the script
|
||||||
|
log_message "Environment configuration script completed."
|
||||||
|
Reference in New Issue
Block a user