Skip to content

Commit

Permalink
Merge pull request #13 from KernelGhost/main
Browse files Browse the repository at this point in the history
Set GDK_BACKEND to 'x11' on systems running wayland
  • Loading branch information
freechelmi authored Oct 1, 2024
2 parents c21a86d + 6c20fd5 commit 9f5fbcb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions WinAppsLauncher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ declare -x WINAPPS_PATH="" # Generated programmatically following dependency che
declare -x WAFLAVOR="" # As specified within the WinApps configuration file.

### FUNCTIONS ###
# Check 'x11'/'wayland' Display Server Protocol
function check_dsp() {
if [[ -n "$XDG_SESSION_TYPE" && "$XDG_SESSION_TYPE" == "wayland" ]]; then
# Set GDK_BACKEND to 'x11' for 'yad' compatibility.
export GDK_BACKEND=x11
fi
}

# Check WinApps Configuration File Exists
function check_config_exists() {
if [[ ! -f "$CONFIG_FILE" ]]; then
Expand Down Expand Up @@ -179,7 +187,7 @@ function app_select() {
local SORTED_APP_LIST=()
local SORTED_APP_STRING=""
local SELECTED_APP=""

# Store the paths of all files within the directory 'WINAPPS_PATH'.
readarray -t ALL_FILES < <(find "$WINAPPS_PATH" -maxdepth 1 -type f)

Expand Down Expand Up @@ -493,7 +501,7 @@ function resume_windows() {
if [[ "$WAFLAVOR" == "libvirt" ]]; then
virsh resume "$VM_NAME" &>/dev/null &
wait $!
echo -e "${DEBUG_TEXT}> RESUMED '${VM_NAME}'${RESET_TEXT}"
echo -e "${DEBUG_TEXT}> RESUMED '${VM_NAME}'${RESET_TEXT}"
elif [[ "$WAFLAVOR" == "podman" ]]; then
podman-compose --file "$COMPOSE_FILE" unpause &>/dev/null &
wait $!
Expand Down Expand Up @@ -635,6 +643,9 @@ function refresh_menu() {
export -f refresh_menu

### SEQUENTIAL LOGIC ###
# Check display server protocol.
check_dsp

# Check 'DISPLAY' variable.
[ -n "$DISPLAY" ] || exit "$EC_DSPLY_UNSET"

Expand Down

0 comments on commit 9f5fbcb

Please sign in to comment.