HEX
Server: Apache/2.4.68 (codeit) OpenSSL/4.0.1
System: Linux societies-web 5.4.17-2136.353.3.el8uek.x86_64 #3 SMP Thu Feb 12 09:46:56 PST 2026 x86_64
User: yles (1028)
PHP: 8.3.31
Disabled: exec,shell_exec,passthru,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source,symlink,pcntl_exec
Upload Files
File: //usr/libexec/initial-setup/firstboot-windowmanager
#!/bin/sh

# This is the list of supported window manager binaries
WMS=("metacity" "kwin_x11" "kwin" "xfwm4" "openbox" "marco")

run_metacity()
{
    # Apply the anaconda overrides before running metacity
    if [ -z "$XDG_DATA_DIRS" ] ; then
        new_data_dirs="/usr/share/anaconda/window-manager:/usr/share"
    else
        new_data_dirs="/usr/share/anaconda/window-manager:${XDG_DATA_DIRS}"
    fi
    XDG_DATA_DIRS="$new_data_dirs" $1 &
}

# Get the application binary to start and remove it from
# the argument list
BINARY=$1
shift

for WM in ${WMS[@]}; do
    FILE=$(which $WM 2>/dev/null)
    FOUND=$?

    if [ $FOUND -eq 0 -a -x "$FILE" ]; then
        # start window manager
        if [ "$WM" == "metacity" ]; then
            # if running Metacity apply the Anaconda/Initial Setup custom overrides
            echo "Running Metacity with custom overrides" | systemd-cat -t initial-setup -p 6
            run_metacity "$FILE"
        else
            echo "Running window manager ($FILE)" | systemd-cat -t initial-setup -p 6
            "$FILE" &
        fi

        pid=$!

        # start the application
        echo "Running ($BINARY)" | systemd-cat -t initial-setup -p 6
        $BINARY "$@"
        res=$?

        # stop window manager
        echo "Stopping the window manager ($FILE)" | systemd-cat -t initial-setup -p 6
        ps -p $pid >/dev/null && kill $pid

        # return result
        exit $res
    fi
done

# No known window manager found
echo "No supported window manager found!" | systemd-cat -t initial-setup -p 3
exit 1