Skip to content

Commit

Permalink
[𝚫] (penrose): added xephyr.sh for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Icy-Thought committed Jul 5, 2023
1 parent 5ff3084 commit 80eabc6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
result
result-bin
dist-newstyle
__pycache__
7 changes: 6 additions & 1 deletion packages/orcinusWM/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
name = "orcinus-wm";
overrideAttrs = drv: {
propagatedNativeBuildInputs =
drv.propagatedNativeBuildInputs or [] ++ [pkgs.xorg.libxcb];
drv.propagatedNativeBuildInputs
or []
++ [
pkgs.xorg.libxcb
pkgs.xorg.xmodmap
];
};
})
];
Expand Down
35 changes: 35 additions & 0 deletions packages/orcinusWM/xephyr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Run an example build of penrose in an embeded Xephyr session.
#
# This is intended to be run via the `run-embeded` makefile target
# which will also handle compilation of the examples themselves.
# You will need to have the xephyr utility installed on your system
# for this script to run:
# https://wiki.archlinux.org/title/Xephyr
#
# usage:
# EXAMPLE=with_layout_transformers APP=st make run-embeded
#
CUR_DIR="$(dirname $(readlink -f $0))"
SCREEN_SIZE=${SCREEN_SIZE:-800x600}
XDISPLAY=${XDISPLAY:-:1}
EXAMPLE=${EXAMPLE:-orcinus-wm}
APP=${APP:-st}

touch $CUR_DIR/../xephyr.log

Xephyr +extension RANDR -screen ${SCREEN_SIZE} ${XDISPLAY} -ac &
XEPHYR_PID=$!

sleep 1
env DISPLAY=${XDISPLAY} "$CUR_DIR/result-bin/bin/$EXAMPLE" 2>&1 $CUR_DIR/xephyr.log &
WM_PID=$!

trap "kill $XEPHYR_PID && kill $WM_PID && rm $CUR_DIR/xephyr.log" SIGINT SIGTERM exit

env DISPLAY=${XDISPLAY} ${APP} &

tail -f $CUR_DIR/../xephyr.log

wait $WM_PID
kill $XEPHYR_PID

0 comments on commit 80eabc6

Please sign in to comment.