#!/bin/sh

set -x

tty="$(tty | tr -d '\n' | tail -c 1)"

#      -config /gnu/store/ifkq0wvdnnlqlssq61dp9gi3syc5802a-xserver.conf \
#      -configdir /gnu/store/zxpq72jsxrfirq3y9hq74zrkijb4wmf0-xorg.conf.d \

guile --no-auto-compile "$(guix gc -R /run/current-system | grep startx)" \
      -config "$(guix gc  --references "$(guix gc  --references "$(guix gc  --references "$(guix gc  --references "$(guix gc  --references "$(guix gc --references "$(readlink -f /run/current-system/boot)" | grep shepherd.conf)" | grep xorg-server-vt7)" | grep slim.cfg)" | grep startx)" | grep X-wrapper)" | grep xserver.conf)" \
      -configdir "$(guix gc  --references "$(guix gc  --references "$(guix gc  --references "$(guix gc  --references "$(guix gc  --references "$(guix gc --references "$(readlink -f /run/current-system/boot)" | grep shepherd.conf)" | grep xorg-server-vt7)" | grep slim.cfg)" | grep startx)" | grep X-wrapper)" | grep xorg.conf.d)" \
      -logverbose \
      -verbose \
      ":$tty" "vt$tty"
