Add startup scripts

This commit is contained in:
Sasha Koshka 2023-11-14 16:30:32 -05:00
parent daa80065c6
commit 1a60d903b2
5 changed files with 57 additions and 0 deletions

3
session/install.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
. ../scripts/flags.sh
cp src/* "$PREFIX/bin"

29
session/src/xmd Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
export XMD_USERDIR="${HOME}/.Xmd"
mkdir -p "${XMD_USERDIR}"
export XMD_REPLICANT_PATH="/usr/lib/Xmd/replicants:/usr/local/lib/Xmd/replicants"
localReplicantDir="$HOME/.local/lib/Xmd/replicants"
if [ -d "$localReplicantDir" ]; then
export XMD_REPLICANT_PATH="$localReplicantDir:$XMD_REPLICANT_PATH"
fi
xmd-load-xresources
appDefaults="${XMD_USERDIR}/app-defaults"
if [ -d "$appDefaults" ]; then
export XAPPLRESDIR="$appDefaults"
else
echo "!!! cant find $appDefaults"
fi
xmd-load-wallpaper
startupDir="$XMD_USERDIR/startup"
if [ -d "$startupDir" ]; then
export XMD_STARTUPDIR="$startupDir"
xmd-run-startup-items
else
echo "!!! cant find $startupDir"
fi
exec mwm

4
session/src/xmd-load-wallpaper Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. $XMD_USERDIR/wallpaper
xwallpaper "--${mode}" "$file"

10
session/src/xmd-load-xresources Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
xrdb -remove
xResources="${XMD_USERDIR}/Xresources"
if [ -r "$xResources" ]; then
xrdb -cpp /usr/bin/cpp < "$xResources"
else
echo "!!! can't find $xResources"
fi

View File

@ -0,0 +1,11 @@
#!/bin/sh
if [ -z "$XMD_STARTUPDIR" ]; then
echo "!!! \$XMD_STARTUPDIR not set"
exit 1
fi
for item in $XMD_STARTUPDIR/*; do
if [ -x "$item" ]; then
"$item" &
fi
done