Patch resource files + add prefix directory

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2024-07-31 22:35:36 +02:00
parent 598fa6a505
commit ee0c00574a
12 changed files with 209 additions and 120 deletions

View File

@@ -100,7 +100,7 @@ save = true
# New save files are now loaded from the same directory as the config
# Currently used to migrate old save files to the new version
# File in which to save and load the default desktop and login
save_file = /etc/ly/save
save_file = $CONFIG_DIRECTORY/ly/save
# Remove power management command hints
hide_key_hints = false
@@ -124,11 +124,11 @@ restart_cmd = /sbin/shutdown -r now
sleep_cmd = null
# Active language
# Available languages are found in /etc/ly/lang/
# Available languages are found in $CONFIG_DIRECTORY/ly/lang/
lang = en
# TTY in use
tty = 2
tty = $DEFAULT_TTY
# Console path
console_dev = /dev/console
@@ -147,35 +147,35 @@ numlock = false
service_name = ly
# Terminal reset command (tput is faster)
term_reset_cmd = /usr/bin/tput reset
term_reset_cmd = $PREFIX_DIRECTORY/bin/tput reset
# Terminal restore cursor command
term_restore_cursor_cmd = /usr/bin/tput cnorm
term_restore_cursor_cmd = $PREFIX_DIRECTORY/bin/tput cnorm
# Cookie generator
mcookie_cmd = /usr/bin/mcookie
mcookie_cmd = $PREFIX_DIRECTORY/bin/mcookie
# Wayland setup command
wayland_cmd = /etc/ly/wsetup.sh
wayland_cmd = $CONFIG_DIRECTORY/ly/wsetup.sh
# Wayland desktop environments
waylandsessions = /usr/share/wayland-sessions
waylandsessions = $PREFIX_DIRECTORY/share/wayland-sessions
# xinitrc
# If null, the xinitrc session will be hidden
xinitrc = ~/.xinitrc
# Xorg server command
x_cmd = /usr/bin/X
x_cmd = $PREFIX_DIRECTORY/bin/X
# Xorg setup command
x_cmd_setup = /etc/ly/xsetup.sh
x_cmd_setup = $CONFIG_DIRECTORY/ly/xsetup.sh
# Xorg xauthority edition tool
xauth_cmd = /usr/bin/xauth
xauth_cmd = $PREFIX_DIRECTORY/bin/xauth
# Xorg desktop environments
xsessions = /usr/share/xsessions
xsessions = $PREFIX_DIRECTORY/share/xsessions
# Brightness control
brightness_down_key = F5

View File

@@ -1,8 +1,7 @@
type = process
restart = true
smooth-recovery = true
# note: /usr/bin/ly-dm when installing from pacman on artix, /usr/bin/ly when building from source
command = /usr/bin/ly
command = $PREFIX_DIRECTORY/bin/$EXE_NAME
depends-on = loginready
termsignal = HUP
# ly needs access to the console while loginready already occupies it

View File

@@ -23,13 +23,13 @@ fi
CONFTTY=$(cat /etc/ly/config.ini | sed -n 's/^tty.*=[^1-9]*// p')
## The execution vars
# If CONFTTY is empty then default to 2
TTY="tty${CONFTTY:-2}"
# If CONFTTY is empty then default to $DEFAULT_TTY
TTY="tty${CONFTTY:-$DEFAULT_TTY}"
TERM=linux
BAUD=38400
# If we don't have getty then we should have agetty
command=${commandB:-$commandUL}
command_args_foreground="-nl /usr/bin/ly $TTY $BAUD $TERM"
command_args_foreground="-nl $PREFIX_DIRECTORY/bin/$EXE_NAME $TTY $BAUD $TERM"
depend() {
after agetty

View File

@@ -8,5 +8,5 @@ fi
BAUD_RATE=38400
TERM_NAME=linux
auxtty=$(/bin/cat /etc/ly/config.ini 2>/dev/null 1| /bin/sed -n 's/\(^[[:space:]]*tty[[:space:]]*=[[:space:]]*\)\([[:digit:]][[:digit:]]*\)\(.*\)/\2/p')
TTY=tty${auxtty:-2}
auxtty=$(/bin/cat $CONFIG_DIRECTORY/ly/config.ini 2>/dev/null 1| /bin/sed -n 's/\(^[[:space:]]*tty[[:space:]]*=[[:space:]]*\)\([[:digit:]][[:digit:]]*\)\(.*\)/\2/p')
TTY=tty${auxtty:-$DEFAULT_TTY}

View File

@@ -10,4 +10,4 @@ elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
GETTY=agetty
fi
exec setsid ${GETTY} ${GETTY_ARGS} -nl /usr/bin/ly "${TTY}" "${BAUD_RATE}" "${TERM_NAME}"
exec setsid ${GETTY} ${GETTY_ARGS} -nl $PREFIX_DIRECTORY/bin/$EXECUTABLE_NAME "${TTY}" "${BAUD_RATE}" "${TERM_NAME}"

View File

@@ -1,2 +1,2 @@
#!/bin/execlineb -P
exec agetty -L -8 -n -l /usr/bin/ly tty2 115200
exec agetty -L -8 -n -l $PREFIX_DIRECTORY/bin/$EXE_NAME tty$DEFAULT_TTY 115200

View File

@@ -1,14 +1,14 @@
[Unit]
Description=TUI display manager
After=systemd-user-sessions.service plymouth-quit-wait.service
After=getty@tty2.service
Conflicts=getty@tty2.service
After=getty@tty$DEFAULT_TTY.service
Conflicts=getty@tty$DEFAULT_TTY.service
[Service]
Type=idle
ExecStart=/usr/bin/ly
ExecStart=$PREFIX_DIRECTORY/bin/$EXECUTABLE_NAME
StandardInput=tty
TTYPath=/dev/tty2
TTYPath=/dev/tty$DEFAULT_TTY
TTYReset=yes
TTYVHangup=yes

View File

@@ -10,7 +10,7 @@ case $SHELL in
*/bash)
[ -z "$BASH" ] && exec $SHELL $0 "$@"
set +o posix
[ -f /etc/profile ] && . /etc/profile
[ -f $CONFIG_DIRECTORY/profile ] && . $CONFIG_DIRECTORY/profile
if [ -f $HOME/.bash_profile ]; then
. $HOME/.bash_profile
elif [ -f $HOME/.bash_login ]; then
@@ -21,7 +21,7 @@ case $SHELL in
;;
*/zsh)
[ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
[ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
[ -d $CONFIG_DIRECTORY/zsh ] && zdir=$CONFIG_DIRECTORY/zsh || zdir=$CONFIG_DIRECTORY
zhome=${ZDOTDIR:-$HOME}
# zshenv is always sourced automatically.
[ -f $zdir/zprofile ] && . $zdir/zprofile
@@ -34,12 +34,12 @@ case $SHELL in
# [t]cshrc is always sourced automatically.
# Note that sourcing csh.login after .cshrc is non-standard.
wlsess_tmp=`mktemp /tmp/wlsess-env-XXXXXX`
$SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $wlsess_tmp"
$SHELL -c "if (-f $CONFIG_DIRECTORY/csh.login) source $CONFIG_DIRECTORY/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $wlsess_tmp"
. $wlsess_tmp
rm -f $wlsess_tmp
;;
*/fish)
[ -f /etc/profile ] && . /etc/profile
[ -f $CONFIG_DIRECTORY/profile ] && . $CONFIG_DIRECTORY/profile
[ -f $HOME/.profile ] && . $HOME/.profile
xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
$SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
@@ -47,7 +47,7 @@ case $SHELL in
rm -f $xsess_tmp
;;
*) # Plain sh, ksh, and anything we do not know.
[ -f /etc/profile ] && . /etc/profile
[ -f $CONFIG_DIRECTORY/profile ] && . $CONFIG_DIRECTORY/profile
[ -f $HOME/.profile ] && . $HOME/.profile
;;
esac

View File

@@ -10,7 +10,7 @@ case $SHELL in
*/bash)
[ -z "$BASH" ] && exec $SHELL $0 "$@"
set +o posix
[ -f /etc/profile ] && . /etc/profile
[ -f $CONFIG_DIRECTORY/profile ] && . $CONFIG_DIRECTORY/profile
if [ -f $HOME/.bash_profile ]; then
. $HOME/.bash_profile
elif [ -f $HOME/.bash_login ]; then
@@ -21,7 +21,7 @@ case $SHELL in
;;
*/zsh)
[ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
[ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
[ -d $CONFIG_DIRECTORY/zsh ] && zdir=$CONFIG_DIRECTORY/zsh || zdir=$CONFIG_DIRECTORY
zhome=${ZDOTDIR:-$HOME}
# zshenv is always sourced automatically.
[ -f $zdir/zprofile ] && . $zdir/zprofile
@@ -34,12 +34,12 @@ case $SHELL in
# [t]cshrc is always sourced automatically.
# Note that sourcing csh.login after .cshrc is non-standard.
xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
$SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $xsess_tmp"
$SHELL -c "if (-f $CONFIG_DIRECTORY/csh.login) source $CONFIG_DIRECTORY/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $xsess_tmp"
. $xsess_tmp
rm -f $xsess_tmp
;;
*/fish)
[ -f /etc/profile ] && . /etc/profile
[ -f $CONFIG_DIRECTORY/profile ] && . $CONFIG_DIRECTORY/profile
[ -f $HOME/.profile ] && . $HOME/.profile
xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
$SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
@@ -47,17 +47,17 @@ case $SHELL in
rm -f $xsess_tmp
;;
*) # Plain sh, ksh, and anything we do not know.
[ -f /etc/profile ] && . /etc/profile
[ -f $CONFIG_DIRECTORY/profile ] && . $CONFIG_DIRECTORY/profile
[ -f $HOME/.profile ] && . $HOME/.profile
;;
esac
[ -f /etc/xprofile ] && . /etc/xprofile
[ -f $CONFIG_DIRECTORY/xprofile ] && . $CONFIG_DIRECTORY/xprofile
[ -f $HOME/.xprofile ] && . $HOME/.xprofile
# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for i in /etc/X11/xinit/xinitrc.d/* ; do
if [ -d $CONFIG_DIRECTORY/X11/xinit/xinitrc.d ]; then
for i in $CONFIG_DIRECTORY/X11/xinit/xinitrc.d/* ; do
if [ -x "$i" ]; then
. "$i"
fi
@@ -67,8 +67,8 @@ fi
# Load Xsession scripts
# OPTIONFILE, USERXSESSION, USERXSESSIONRC and ALTUSERXSESSION are required
# by the scripts to work
xsessionddir="/etc/X11/Xsession.d"
OPTIONFILE=/etc/X11/Xsession.options
xsessionddir="$CONFIG_DIRECTORY/X11/Xsession.d"
OPTIONFILE=$CONFIG_DIRECTORY/X11/Xsession.options
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
@@ -83,12 +83,12 @@ if [ -d "$xsessionddir" ]; then
done
fi
if [ -d /etc/X11/Xresources ]; then
for i in /etc/X11/Xresources/*; do
if [ -d $CONFIG_DIRECTORY/X11/Xresources ]; then
for i in $CONFIG_DIRECTORY/X11/Xresources/*; do
[ -f $i ] && xrdb -merge $i
done
elif [ -f /etc/X11/Xresources ]; then
xrdb -merge /etc/X11/Xresources
elif [ -f $CONFIG_DIRECTORY/X11/Xresources ]; then
xrdb -merge $CONFIG_DIRECTORY/X11/Xresources
fi
[ -f $HOME/.Xresources ] && xrdb -merge $HOME/.Xresources
[ -f $XDG_CONFIG_HOME/X11/Xresources ] && xrdb -merge $XDG_CONFIG_HOME/X11/Xresources