dotfiles/system/.config/X11/xinitrc
Severin Kaderli 36842cf957
Add more XDG files
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
2019-05-26 21:45:22 +02:00

34 lines
No EOL
961 B
Bash

#!/usr/bin/env bash
#
# SCRIPT NAME:
# .config/X11/xinitrc
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# DESCRIPTION:
# This is the startup script when you start the x-server.
#
# USAGE:
# This script is executed when you start the x-server.
. "${XDG_CONFIG_HOME}/X11/xsetup"
# Load different i3 configuration depending on nvidia-xrun is used because
# the monitor names are different.
NVIDIA_CHECK="$(xrandr | grep "eDP-1-1 connected")"
if [ -z "${NVIDIA_CHECK}" ]; then
I3_SCREEN_CONFIG="${XDG_CONFIG_HOME}/i3/config.intel"
else
I3_SCREEN_CONFIG="${XDG_CONFIG_HOME}/i3/config.nvidia"
fi
# Load different i3 configuration depending on if it's a work computer.
if [ "${IS_WORK}" = "1" ]; then
LOCAL_I3_CONFIG="${XDG_CONFIG_HOME}/i3/config.work"
else
LOCAL_I3_CONFIG="${XDG_CONFIG_HOME}/i3/config.private"
fi
cat "${I3_SCREEN_CONFIG}" "${XDG_CONFIG_HOME}/i3/config.base" "${LOCAL_I3_CONFIG}" > "${XDG_CONFIG_HOME}/i3/config"
i3