Xephyr without sleeping

Moderator: BarryK

Post Reply
fatdoguser
Posts: 175
Joined: Sat Aug 05, 2023 10:54 am
Has thanked: 22 times
Been thanked: 79 times

Xephyr without sleeping

Post by fatdoguser »

I see that easy OS (5.7) is using the 'regular' Xephyr ... sleep approach

ec-chroot lines 277-285

Code: Select all

   Xephyr :${CNTxephyr} -fullscreen -title "${EXE}" -name "Xephyr${CNTxephyr}" -dpi "$DPI" -nolisten tcp &
   #Xephyr :${CNTxephyr} -fullscreen -no-host-grab -title "${EXE}" -name "Xephyr${CNTxephyr}" -dpi "$DPI" -nolisten tcp &
   echo "${CNTxephyr} ${EXE}" >> /tmp/easy_containers/xephyr-windows
   #wait until ready to use...
   CNT=0
   while [ ! -S /tmp/.X11-unix/X${CNTxephyr} ];do
    sleep 0.1
    CNT=$(($CNT+1))
    [ $CNT -gt 20 ] && exit 2
   done

I've switched over to using xinit ... as indicated in

How to launch Xephyr without sleep-ing

https://unix.stackexchange.com/question ... -sleep-ing

xinit does this job. You can create a file your_xinitrc. Commands in your_xinitrc will be executed after Xephyr is initialized.

xinit your_xinitrc -- /usr/bin/Xephyr :4
The X server to run must be given with an absolute path if it is not X itself. See man xinit for details. After all commands in your_xinitrc are terminated, xinit terminates Xephyr.

Where in my Fatdog Xephyr session I run

Code: Select all

echo ". /etc/profile" > /tmp/my_xinitrc
echo "jwm" >> /tmp/my_xinitrc
xinit /tmp/my_xinitrc -- /usr/bin/Xephyr \
:2180 -ac -br -dpi 144 -glamor -fullscreen
rm /tmp/my_xinitrc

That said my prior code was more crude, just a 4 second wait time allowance for Xephyr to start before running jwm, which was hit and miss. I guess EasyOS code checking every 0.1 seconds for up to 20 seconds is just as good as using xinit, but thought I'd mention it as a point of possible interest.

User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: Xephyr without sleeping

Post by BarryK »

Yes, that is an interesting alternative method. Thanks for posting.

fatdoguser
Posts: 175
Joined: Sat Aug 05, 2023 10:54 am
Has thanked: 22 times
Been thanked: 79 times

Re: Xephyr another interesting feature

Post by fatdoguser »

In Fatdog, OpenBox with LXQT panel, where that panel is set to be at the bottom of screen, with a 1366x768 laptop, connected to a 1920x1080 HDMI, when I launch Xephyr it grabs the full combined screen area, as though a 1366+1920 wide, 1080 height screen, when Xephyr is set to 'fullscreen'. That can be a bit awkward in that there's no visibility of whether that Xephyr is set to mouse captured or not (ctrl-shift toggle).

Set that way however and the main sessions drive icons are displayed at the bottom of screen, out of visibility. So I revised the configuration to have the main sessions lxqt panel and drive icons to be displayed at the top of the screen. Now when I launch Xephyr it leaves the laptop display as normal, Xephyr is just displayed full-screen on the HDMI monitor. I have both root/main Fatdog session on the left/laptop display, and the Xephyr session on the larger HDMI monitor display.

In Xephyr I have everything running as spot, and that's within a chroot, so it can't open/access the HDD's. I also run jwm within that, in contrast to Openbox/LXQT running in the main fatdog session.

The attached 'screenshot' captures both in a single image, but where the actual view is the left hand side laptop view being much less tall, the display bottom ends at just below that last left hand side icon and stretches across to the first clock as its top/right of screen. To the right of that is the jwm/Xephyr/spot display. In effect a main/root session on the left, spot/contained session on the right. My openbox/main sessions windows decorations are different to the Xephyr/jwm sessions, I have black titles for the root/main/openbox, blue titles in the spot/Xephyr/jwm so a simple visible distinction between the two.

Makes a interesting/different and quite nice setup IMO. Left/laptop screen as a sys/file admin type view, right/monitor screen as larger spot/general desktop view.

I don't know why Xephyr works that way, different -fullscreen outcomes when lxqt panel is set to be at the bottom of screen compared to if its sets to be at the top of screen.

1.png
1.png (29.84 KiB) Viewed 189 times

One issue is that jwm does become confused and maximizes to outside of the HDMI's display area. Changing to twm as the Xephyr's window manager sorts that, due to its different style of managing windows (presents a initial 3x3 wireframe grid that you move/size to where you want the window to be shown/dropped).

2.png
2.png (88.72 KiB) Viewed 174 times
Post Reply

Return to “EasyOS”