summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs/xephyrify/default.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-04-10 18:17:58 +0200
committerjeschli <jeschli@gmail.com>2018-04-10 18:17:58 +0200
commitab7b04f55e9eb331e5f9ed254843ed8e0bcf9d78 (patch)
tree3c5811972b7fb1c58dbcdc3ac5f52a6bcf9f492b /lass/5pkgs/xephyrify/default.nix
parent3f9cbbc8d1f5420ef276633f087e63f700c386e7 (diff)
parent5b8c4d24e274bbf26e85420fc11b5bf7e24ac22d (diff)
Merge branch 'master' of prism.r:stockholm
Diffstat (limited to 'lass/5pkgs/xephyrify/default.nix')
-rw-r--r--lass/5pkgs/xephyrify/default.nix30
1 files changed, 25 insertions, 5 deletions
diff --git a/lass/5pkgs/xephyrify/default.nix b/lass/5pkgs/xephyrify/default.nix
index 8b18ea949..8d6036843 100644
--- a/lass/5pkgs/xephyrify/default.nix
+++ b/lass/5pkgs/xephyrify/default.nix
@@ -2,15 +2,18 @@
let
- minimalXmonad = writeHaskell "minimalXmonad" {
+ xephyrify-xmonad = writeHaskell "xephyrify-xmonad" {
executables.xmonad = {
extra-depends = [
"containers"
+ "unix"
"xmonad"
];
text = /* haskell */ ''
module Main where
import XMonad
+ import Data.Monoid
+ import System.Posix.Process (executeFile)
import qualified Data.Map as Map
main :: IO ()
@@ -21,8 +24,18 @@ let
, keys = myKeys
, normalBorderColor = "#000000"
, focusedBorderColor = "#000000"
+ , handleEventHook = myEventHook
}
+ myEventHook :: Event -> X All
+
+ myEventHook (ConfigureEvent { ev_event_type = 22 }) = do
+ spawn "${xorg.xrandr}/bin/xrandr >/dev/null 2>&1"
+ return (All True)
+
+ myEventHook _ = do
+ return (All True)
+
myLayoutHook = Full
myKeys _ = Map.fromList []
'';
@@ -30,13 +43,20 @@ let
};
in writeDashBin "xephyrify" ''
- NDISPLAY=:$(${coreutils}/bin/shuf -i 100-65536 -n 1)
+ NDISPLAY=''${NDISPLAY:-$(${coreutils}/bin/shuf -i 100-65536 -n 1)}
echo "using DISPLAY $NDISPLAY"
- ${xorg.xorgserver}/bin/Xephyr -br -ac -reset -terminate -resizeable $NDISPLAY &
+ ${xorg.xorgserver}/bin/Xephyr -br -ac -reset -terminate -resizeable -dpi 60 -nolisten local :$NDISPLAY &
+ if test -n $DROP_TO_USER; then
+ sleep 1
+ ls /tmp/.X11-unix/
+ id
+ ${coreutils}/bin/chgrp "$DROP_TO_USER" "/tmp/.X11-unix/X$NDISPLAY"
+ ${coreutils}/bin/chmod 770 "/tmp/.X11-unix/X$NDISPLAY"
+ fi
XEPHYR_PID=$!
- DISPLAY=$NDISPLAY ${minimalXmonad}/bin/xmonad &
+ DISPLAY=:$NDISPLAY ${xephyrify-xmonad}/bin/xmonad &
XMONAD_PID=$!
- DISPLAY=$NDISPLAY ${virtualgl}/bin/vglrun "$@"
+ DISPLAY=:$NDISPLAY ${virtualgl}/bin/vglrun "$@"
kill $XMONAD_PID
kill $XEPHYR_PID
''