I am making an OnDemand app that uses Firefox through VNC and the Firefox window will not take up all the space it is given. I can manually set the size of the Firefox window like this firefox --width 1000 --height 800
but I want it to be dynamic so if users have bigger or smaller screens it will adjust accordingly. Our interactive desktop does this by default but windowed apps don’t seem to be allowed to do this? Is there a setting that allows this?
Does “firefox -maximize” do what you want?
Hi and welcome!
It looks like you don’t have a window manager running. Notice that you don’t even have minimize/maximize/close buttons at the top of the firefox panel. Which is to say - it has no boundaries to expand to (or panel to minimize to).
So your template/script.sh.erb
should be booting up not only Firefox, but also a window manager like XFCE (all/most of the examples you’ll find boot XFCE as the window manager. I’m sure MATE or Gnome may work, I just don’t have the examples/expertise to do it on hand).
I literally just fixed this issue at OSC where the window manager wasn’t booting up correctly for EL9. You can reference our MATLAB application for how it boots up XFCE in a way that’s EL8 & EL9 compatible.
Thanks for the suggestion but -maximize
and --maximize
both do not work
Here is my full script, I have some code that looks like that in my script. I am not too familiar with this but it looks like it should be doing the same things, besides checking what OS version and checking for GPU you have in your script.
#!/usr/bin/env bash
echo "Starting main script..."
echo "Start Time - $(date)"
module purge
<%- unless context.modules.blank? -%>
module load <%= context.modules %>
<%- end -%>
module list
echo "Time after module load - $(date)"
cd "${HOME}"
# Invoking your application
start_app() {
firefox --width 1000 --height 800 "http://0.0.0.0:8080"
# Wait for Firefox to launch
sleep 5
}
<% if context.is_vnc == 'true' -%>
# This is a VNC application, configure the Xfce window manager:
(
export SEND_256_COLORS_TO_REMOTE=1
export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"
export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"
export XDG_CACHE_HOME="$(mktemp -d)"
module restore
set -x
xfwm4 --compositor=off --daemon --sm-client-disable
xsetroot -solid "#D3D3D3"
xfsettingsd --sm-client-disable
xfce4-panel --sm-client-disable
) &
# Start the application:
set -x
start_app
<% else -%>
# This section is for non-vnc applications.
start_app
<% end -%>
Are you on EL9? If so that’s the important bit, that’s why that logic is there at all. XFCE boots slightly differently from EL8 to EL9. We support both, so we have logic to support both. What you have is only EL8 compatible and I’m guessing your running EL9 given your app’s behavior.
We are running Ubuntu 22.04.4
Oh! I’m not familiar with XFCE on Ubuntu, but even so - your app appears to have the same behavior it would if it were on EL9 without that toggle to boot XFCE differently.
Thank you! I figured it out. I used the code from your ‘else’ statement (the non version 9 case) and replaced my old code with it.
export SEND_256_COLORS_TO_REMOTE=1
export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"
export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"
export XDG_CACHE_HOME="$(mktemp -d)"
export $(dbus-launch)
xfwm4 --compositor=off --sm-client-disable &
xsetroot -solid "#D3D3D3"
xfsettingsd --sm-client-disable &
#xfce4-panel --sm-client-disable &
I commented out the last line since I don’t want the dock and menu bar showing.
Thank you very much for this Jeff, I was also just starting to poke at my desktops not starting properly on EL9!