Skip to content

Instantly share code, notes, and snippets.

@bdeshi
Created August 23, 2019 17:33
Show Gist options
  • Save bdeshi/1bda09bceac4b62b03bcb955dc05437a to your computer and use it in GitHub Desktop.
Save bdeshi/1bda09bceac4b62b03bcb955dc05437a to your computer and use it in GitHub Desktop.
a simple script to livetest awesomewm config in nested Xephyr
#!/bin/sh
# a simple script to livetest awesomerc in nested Xephyr
# all arguments are passed to awesome verbatim
# requirements: xprop, Xephyr, awesome
XEPHYR_DISPLAY=":173"
XEHPYR_SIZEX=1280
XEPHYR_SIZEY=800
XEPHYR_TITLE="awesomerc-tester"
_clients=`xprop -root | grep "^_NET_CLIENT_LIST" | cut -d# -f2`
_classes=""
for ID in $(IFS=", " echo $_clients); do
_classes=$_classes" "`xprop -id "$ID" | grep "^WM_CLASS" | cut -d'=' -f2-`
done
echo "Press CTRL+SHIFT+G to lock input within Xephyr (${XEPHYR_TITLE})"
if [ 0 = `echo $_classes | grep -c -E "${XEPHYR_TITLE}"` ]; then
(Xephyr $XEPHYR_DISPLAY -screen ${XEHPYR_SIZEX}x${XEPHYR_SIZEY} -name $XEPHYR_TITLE &)
sleep 2
DISPLAY=${XEPHYR_DISPLAY} awesome $@
else
echo "Xephyr (${XEPHYR_TITLE}) is already running."
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment