Hey Guys, we have a works council topic where users need to be able to start a Citrix session in HighRes (1920×1200) or in LowRes (1440×900) because of people not being able to read everything on screen otherwise.
We have created a solution using xrandr and wanted to share it with you guys.
With the adding of 2 scripts to the igel folders we have got a solution for the High Res & Low Res
In the UMS profile/igel setup browse to System->Firmware Customization->Custom Commands->Desktop Commands->Custom Command Desktop Final and add the following script.
LowRes Script:
#Generate 1440×900 script
echo “#!/bin/sh” > /config/sessions/res0
echo “gtf 1440 900 59.9” >> /config/sessions/res0
echo “xrandr –newmode “1440×900” 106.29 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync” >> /config/sessions/res0
echo “xrandr –addmode HDMI-0 1440×900” >> /config/sessions/res0
echo “xrandr –addmode DisplayPort-0 1440×900” >> /config/sessions/res0
echo “xrandr –-output DisplayPort-0 -–mode 1440×900 -–pos 0x0 -–rotate normal” >> /config/sessions/res0
echo “xrandr –-output HDMI-0 -–mode 1440×900 -–pos 0x0 -–rotate normal” >> /config/sessions/res0
chmod 777 /config/sessions/res0
HighRes Script:
#Generate 1920×1200 script
echo “#!/bin/sh” > /config/sessions/res1
echo “xrandr -–output HMDI-0 -–mode 1920×1200 -–pos 0x0 -–rotate normal” >> /config/sessions/res1
echo “xrandr -–output DisplayPort-0 -–mode 1920×1200 -–pos 0x0 -–rotate normal” >> /config/sessions/res1
chmod 777 /config/sessions/res1
If you want to start the last user display configuration to be persistent after a thin client restart add this to the scripts:
echo “cp /config/sessions/res0 /wfs/lastres”>>/config/sessions/res0
echo “chmod 777 /wfs/lastres” >> /config/sessions/res0
chmod 777 /config/sessions/res0
we then add this script / as a custom post and pre session command to a session type called Citrix HighRes and Citrix LowRes
Feedback is welcome!
nice work, looks awesome!
ah yes forgot to mention this works for the output ports on a UD3 use `xrandr -q` to check output names on other devices to adjust the script to the availible outputs you have.
Looks like a great project, congrats!!
@member @member thanks.. sometimes the customer demands something not standard. but with some help from google and some online blogs and some ubuntu man pages for xrandr us *nix heads can fix it..
Really nice!!
I hope the new Display Switcher with profile support, will help a bit in this use case scenario. I keep my fingers crossed!
Well done guys, this will be a great help to the community
Pretty cool stuff @member, am sure we can use this in the future as well 🤙:skin-tone-2:😎
Feel free to connect if help is needed Guys. We are testing this now if the scripts get newer versions in the future ill keep you updated.
That‘s real community🙏
That does look good. You can actually get rid of all of the echo statements by using something like this:
cat << EOF > /config/sessions/res0
(add the lines that you want)
(when you are done, put ‘EOF’ at the bottom:)
EOF
An alternate method would be to make the script a ‘File’ that is distributed by the U.M.S., and use the startup command just to initiate the script.
I was also wondering… if they are connected to Windows sessions, they might also be able to set the D.P.I. inside the session.
@member correct, and ive tested the DPI stuff but it was not giving us the same results in the end because still not all windows applications get along with DPI settings correctly.
changing resolution kept the screens also going back to mirrored mode, so we have added the following line to the scripts
xrandr –output $EXTERN1 –primary –output $EXTERN2 –pos 0x0 –right-of $EXTERN1 –pos 0x0
and had a good look at @member his mods as an example and are now reading the output names now before firing off the scripts
#!/bin/bash
# SET Variables
connectedOutputs=$(xrandr | grep ” connected” | sed -e “s/([A-Z0-9]+) connected.*/1/”)
activeOutput=$(xrandr | grep -E ” connected (primary )?[1-9]+” | sed -e “s/([A-Z0-9]+) connected.*/1/”)
#add resolution
gtf 1440 900 59.9
xrandr –newmode “1440x900_59.90” 106.29 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync
for name in $connectedOutputs
do
if [ “$name” == “DisplayPort-0” ];then
xrandr –addmode $name 1440x900_59.90
xrandr –output $name –mode 1440x900_59.90
EXTERN1=$name
elif [ “$name” == “HDMI-0” ];then
xrandr –addmode $name 1440x900_59.90
xrandr –output $name –mode 1440x900_59.90
EXTERN1=$name
fi
if [ “$name” == “HDMI-0” ];then
xrandr –addmode $name 1440x900_59.90
xrandr –output $name –mode 1440x900_59.90
EXTERN2=$name
fi
done
xrandr –output $EXTERN1 –primary –output $EXTERN2 –pos 0x0 –right-of $EXTERN1 –pos 0x0
#EOF
need to clean up the for loop, but for now it workes like a charm.
Continue reading and comment on the thread ‘Script to start a Citrix session in HighRes, configurable, from IGEL OS’. Not a member? Join Here!
Learn more, search the IGEL Knowledge Base
Ask a question or comment on the above message thread?
Join or log in to the IGEL Community to ask us anything and meet other IGEL customers, partners, and EUC enthusiasts.Submit a question, or Join Today!