Skip to content

Instantly share code, notes, and snippets.

@bng44270
Created March 22, 2023 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bng44270/76c5413ebf4d24925c2b583bb734b5a5 to your computer and use it in GitHub Desktop.
Save bng44270/76c5413ebf4d24925c2b583bb734b5a5 to your computer and use it in GitHub Desktop.
Launch nested X windows session
#!/bin/bash
##################################
#
# Launch nested X windows session
#
# Usage:
#
# 1) Determine window manager executable (i.e. wmaker)
#
# 2) Create symbolic link of xnest.sh
#
# $ ln -s xnest.sh xnest-wmaker.sh
#
# 3) Update the GEOMETRY and DISPLAY_VALUE variables to
# reflect the desired X windows resolution and display
# name respectively
#
##################################
GEOMETRY="1024x768+64+0"
DISPLAY_VALUE=":1"
###############################
# Edit nothing below here
###############################
WMGR="$(basename $0 | sed 's/^xnest[-]*//g;s/\.sh$//g')"
if [ -z "$WMGR" ]; then
echo "usage: xnest-<window_manager>.sh"
echo " ln -s xnest.sh xnest-<window_manager>.sh"
else
Xnest -geometry $GEOMETRY $DISPLAY_VALUE -ac &
NESTPID="$(jobs -l | awk '/Xnest/ { print $2 }')"
DISPLAY="$DISPLAY_VALUE" $WMGR
kill -9 $NESTPID
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment