dotfiles/xinitrc
Irrlicht 8c7f49cd53
[dunst][x11] Specify monitor where notification appear.
On Piston, wi only want notifications to appear on a specific monitor
and not follow the mouse. The monitor need to be specified in the
configuration. Dunst doesn't support the use of environment variable in
configuration file. So, the dunst configuration is genrated on startup
using `envsubst` command.

Two new environment variables are needed:

- PATH_DOTFILE_DIR: the base directory of the repository where there's the
Dunst configuration file (this very repository).
- NOTIFICATION_MONITOR: the name or number of the monitor where
notifications should appear as specified by Dunst configuration
documentation.
2026-10-23 18:26:59 +02:00

34 lines
600 B
Shell

#!/bin/bash
PATH_XSESSION=$HOME/.xsession
PATH_FEH=$HOME/.feh-bg
PATH_DUNST_DIR="$HOME/.config/dunst"
xinitdir="/etc/X11/xinit"
if [ -f $PATH_XSESSION ]
then
. $PATH_XSESSION
fi
if [ -f $PATH_FEH ]
then
. $PATH_FEH
fi
# Load of configuration for
if [ -d "$xinitdir"/xinitrc.d ] ; then
for f in "$xinitdir/xinitrc.d"/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# Generate dunst configuration
if [ ! -d "${PATH_DUNST_DIR}" ]; then
mkdir -p "${PATH_DUNST_DIR}"
fi
envsubst < "${PATH_DOTFILE_DIR}/dunst/dunstrc" > "${PATH_DUNST_DIR}/dunstrc"
# Launch window manager
exec i3