From 74a01081ace22409b11d548f0750942ace2347a7 Mon Sep 17 00:00:00 2001 From: Eshan Roy Date: Sat, 14 Dec 2024 01:48:23 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20perf(=5Fimp):=20enhanced?= =?UTF-8?q?=20&=20error=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/profile.d/environment.sh | 37 +++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/etc/profile.d/environment.sh b/etc/profile.d/environment.sh index d05af89..3357fb2 100644 --- a/etc/profile.d/environment.sh +++ b/etc/profile.d/environment.sh @@ -1,9 +1,40 @@ #!/bin/bash +# Description: Configures environment variables for Wayland and Qt applications. +# Author : Eshan Roy +# 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 - export QT_QPA_PLATFORM=wayland - export MOZ_ENABLE_WAYLAND=1 + log_message "Wayland session detected." + + # 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 -# Set some other environment variables +# Set a custom Qt style engine to 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."