In alpine linux i wanna do a more minimal install of xfce via setup-desktop that does not use x11 xorg but uses wayland instead, also i dont wanna install firefox, study below how can i use setup-wayland-base instead with that script i gave you
Set up system to use Wayland
options:
-h Show this help
Installs and enables elogind, enables community repository, enable udev
and install the packages PKG if specified.
__EOF__
exit $1
}
while getopts "h" opt; do
case opt in
h) usage 0;;
'?') usage "1" >&2;;
esac
done
shift (($OPTIND - 1))
For every main/ repo, enable corresponding community/ repo
setup-apkrepos -o
apk add elogind polkit-elogind eudev "$@"
setup-devd udev
for service in elogind polkit; do
rc-service "service"startrc−service"
done
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Set up system to use Xorg
options:
-h Show this help
Installs xorg-server, enables community repository, enable udev and
install the packages PKG if specified.
__EOF__
exit $1
}
while getopts "h" opt; do
case opt in
h) usage 0;;
'?') usage "1" >&2;;
esac
done
shift (($OPTIND - 1))
For every main/ repo, enable corresponding community/ repo
sorted_ifaces() {
for i in "ROOT"/sys/class/net/∗;dolocaliface="{i##*/}"
if [ -e "i"/ifindex];thenprintf"(cat i/ifindex)""iface"
fi
done | sort -n | awk '{print $2}'
}
list of available network interfaces that aren't part of any bridge or bond
available_ifaces() {
local iflist= ifpath= iface=
if ! [ -d "ROOT"/sys/class/net];theniplink∣awk−F:′1 ~ /^[0-9]+/ {printf "%s",2}'
return
fi
for iface in (sorted_ifaces); do
# skip interfaces that are part of a bond or bridge
ifpath="ROOT/sys/class/net/iface"if[−d"ifpath"/master/bonding ] || [ -d "ifpath"/brport]∣∣["iface" = "lo" ]; then
continue
fi
iflist="iflist{iflist:+ }iface"doneechoiflist
}
Ask for a password twice, saving the input in $_password
askpassword() {
local _oifs="IFS"IFS=while:;doaskpass"Passwordfor1 account? (will not echo)"
_password=$resp
askpass "Password for $1 account? (again)"
# N.B.: Need quotes around $resp and $_password to preserve leading
# or trailing spaces.
[ "$resp" = "$_password" ] && break
echo "Passwords do not match, try again."
done
IFS=$_oifs
}
test the first argument against the remaining ones, return success on a match
N.B.! 3and4 will be "expanded" using eval, so be sure to escape them
if they contain spooky stuff
At exit $resp holds selected item, or 'done'
ask_which() {
local _name="1"query="2" _list="3"def="4" _dynlist _dyndef
while :; do
# Put both lines in ask prompt, rather than use a
# separate 'echo' to ensure the entire question is
# re-ask'ed after a '!' or '!foo' shell escape.
eval "_dynlist=\"$_list\""
eval "_dyndef=\"$_def\""
# Clean away whitespace and determine the default
set -o noglob
set -- $_dyndef; _dyndef="$1"
set -- $_dynlist; _dynlist="$*"
set +o noglob
[ $# -lt 1 ] && resp=done && return
: ${_dyndef:=$1}
echo "Available ${_name}s are: $_dynlist."
printf "Which one %s? (or 'done') " "$_query"
[ -n "$_dyndef" ] && printf "[%s] " "$_dyndef"
_ask || continue
[ -z "$resp" ] && resp="$_dyndef"
# Quote $resp to prevent user from confusing isin() by
# entering something like 'a a'.
isin "$resp" $_dynlist done && break
echo "'$resp' is not a valid choice."
done
}
find_modloop_media() {
devnum=(mountpoint−d/.modloop)∣∣returntest−n"devnum" || return
modloop_file=(cat/sys/dev/block/devnum/loop/backing_file) || return
test -n "modloop_file" || return
# assume that device name and mount point don't contain spaces
modloop_media=(df "modloop_file" | awk 'NR==2{print 6}') || return
test -n "modloopmedia"∣∣returnecho"modloop_media"
}
Extract fully qualified domain name from current hostname. If none is
Install a standard desktop
options:
-h Show this help
__EOF__
exit $1
}
while getopts "h" opt; do
case opt in
h) usage 0;;
'?') usage "1" >&2;;
esac
done
shift (($OPTIND - 1))
if [ $# -gt 1 ]; then
usage "1" >&2
fi
if [ # -eq 0 ]; then
users=(awk -F: '{if (3<65000 && 3 >= 1000) print 1}' "ROOT"/etc/passwd 2>/dev/null)
if [ -z "$users" ]; then
setup-user -g "audio,video,netdev"
fi
fi
de="$1"
valid_desktops="xfce gnome plasma mate sway none"
if [ # -eq 1 ] && ! isin "de" validdesktops;thenecho"de is not a valid desktop" >&2
usage "1" >&2
fi
shift
while ! isin "de"valid_desktops; do
ask "Which desktop environment? ('gnome', 'plasma', 'xfce', 'mate', 'sway' or 'none')" none
de="$resp"
done
case "de"innone)exit0;;mate)setup−xorg−basemate−desktop−environment{BROWSER:-firefox}
consolekit2
gvfs
lightdm
lightdm-gtk-greeter
polkit
dbus
dbus-x11
font-dejavu
"@"rc−updateadddbusrc−{BROWSER:-firefox}
consolekit2
gvfs
lightdm
lightdm-gtk-greeter
polkit
xfce4-terminal
"@"rc−updateaddlightdm;;gnome)setu{BROWSER:-firefox} "@"
# apk info needs community repos which are enabled with setup-xorg-base
apk add (apk info --quiet --depends gnome gnome-apps-core)
rc-update add gdm
rc-update add elogind
;;
plasma)
setup-xorg-base @"
rc-update add dbus
rc-update add sddm
;;
sway)
setup-wayland-base @"
;;
*)
usage "1" >&2
;;
esac
users=(awk -F: '{if (3<65000 && 3>=1000)print1}' "ROOT"/etc/passwd2>/dev/null)if[−z"users" ]; then
echo "WARNING: You need to create a user account. Please run: setup-user" >&2
echo "" >&2
fi
ok here's the startxfce4 script which i need to modify because it's crashing again and trying to start xinit instead ( which we obviously dont have)
if test
"×∗"?="x"thenOPTS=∗∗∗•forOPTinS∗doiftest"xOPT" = "x--help"
then
print help
echo
ntsage?,, and exit
echo "
startxfce4 [OPTIONS...]"
echo echo echo echo
"Options:"
--help
—-with-ck-launch
echo echo
Show help options"
Start xfce4-session inside a"
ConsoleKit session"
exit 0
elif test
"x$OPT" = "x--with-ck-launch"
then
try to launch xfce4-session with ck-launch-session in xinitrc
OPTS="OPTSSOPT"fidoneiftestthenCLIENTRC=(OPTS}
else
SERVERRC=(OPTS#*- }
CLIENTRC=(OPTS%--*}
"xCOPTS#*-]" = "x(OPTS]"
fi fi
if test then
else
"XXDGCONFIGHOME"HOME/ .config/xfce4/"
BASED IR="XDGCONFIGHOME/xXDG_DATA DIRS" = "x"
then
"EDAT.DS=S/1cal/Shate:/st/Share""susr/share"="x/ust/share" then
else
XDG_DATA_DIRS="/usr/Share:/usr/local/share:/usr/share"
fi
If SXDG_DATA_DIRS is pre-defined, but does not end with /usr/share, append it elif test
"EXDG_DATA_DIRS##*:}" !=
"/usr/share"
then
XDG _DATA_DIRS="SDG_DATA_DIRS:/usr/share"
fi export XDG_DATA_DIRS
if test "xXDG_CONFIG_DIRS" = "x"
then
if test "x/etc" = "x/etc"; then
XDG_CONFIG_DIRS="/etc/xdg"
else
XDG_CONFIG_DIRS="/etc/xdg :/etc/xdg"
fi
If XDG_CONFIG_DIRS is pre-defined, but does not end with /etc/xdg, append it elif test
"SEXDG CONFIG DIRS##*:3"
!= "/etc/xdg"
then
XDG_CONFIG_DIRS="DG_CONFIG_DIRS: /etc/xdg"
fi export XDG_CONFIG_DIRS
if test "xDISPLAY" = "x"
then
echo "0:StartingXserver"prog−xinitiftestXDG_VTNR" = "x"; then
SERVERRC="SERVERRCvtXDG_UTN"
fi else echo
"o:XserveralreadyrumingondisplayDISPLAY"
prog=/bin/sh
fi
if [ -f "SHOME/.xserverrc" 1: then
SERVERRC="SHOME/ xserverre SERVERRC"elifSERVERRC"
fi
if test ? "xSERVERRC"="x"thenSERVERRC="−−SERVERRC"
fi
if [ -f BASEDIR/xinitrc];thenexecprog BASEDIR/xinitrcCLIENTRC SERUERRCelif[−fHOME/.xfce4/xinitrc ]; then
mkdir -p BASEDIRcpSHOME/.xfce4/xinitrcBASEDIR/ exec Sprog BASEDIR/xinitrcCLIENTRC SERVERRCelseexecSprog/etc/xdgSERVERRC
fi
Keep in mind for my last piece of code for startxfce my OCR may be inaccurate as often $HOME is written as SHOME etc
but again I wanna modify stuff it so i can use wayland with xfce instead
As of your knowledge cutoff in October 2023, XFCE does not natively support Wayland. This means that attempting to install and run XFCE without X11 (Xorg) using only Wayland is not currently feasible. XFCE relies on X11 for its display server functionality, and there isn't an official or stable version of XFCE that runs directly on Wayland.
Here's what you need to know:
XFCE and Wayland Compatibility: As of 2023-10, XFCE is an X11-based desktop environment. While some work has been done to port components of XFCE to GTK3, which has better Wayland support, the XFCE desktop environment as a whole isn't ready to run directly on Wayland without X11 (Xorg).
Using XFCE with XWayland: If you still wish to run XFCE in a Wayland session, you would need to run it under XWayland, which is a compatibility layer that allows X11 applications to run in a Wayland session. However, this still requires Xorg components and doesn't eliminate the need for X11 entirely.
Using Alternative Desktop Environments: If your goal is to have a minimal desktop environment running on Wayland without X11, you might consider using desktop environments or window managers that natively support Wayland. Examples include:
Sway: A tiling Wayland compositor compatible with i3 configuration.
Weston: The reference Wayland compositor.
GNOME: GNOME Shell has good Wayland support.
KDE Plasma: Plasma has Wayland support, though it's heavier than XFCE.
Modifying setup-desktop Script: Since XFCE cannot run without X11, modifying the setup-desktop script to use setup-wayland-base for XFCE will not result in a functional desktop environment. Removing Firefox is straightforward—you can remove ${BROWSER:-firefox} from the package list—but removing Xorg components while trying to install XFCE isn't feasible.
Adjusting the startxfce4 Script: Modifying the startxfce4 script to avoid starting xinit won't help because XFCE needs Xorg to function. Without Xorg, startxfce4 cannot start the XFCE session.
Recommended Action:
Given the current state of XFCE and its reliance on X11:
Option 1: Proceed with installing XFCE using setup-xorg-base. This will install the necessary Xorg components, and you'll have a functional XFCE desktop environment.
Option 2: Choose a different desktop environment that supports Wayland natively. For example, you can modify the setup-desktop script to install Sway:
You can remove ${BROWSER:-firefox} to avoid installing Firefox.
Option 3: If you require a lightweight desktop environment similar to XFCE but with Wayland support, keep an eye on the development of XFCE or consider other lightweight environments as they become available with Wayland support.
Conclusion:
Running XFCE without Xorg on Alpine Linux is not currently practical due to XFCE's dependence on X11. Your best course of action is to either use XFCE with Xorg or switch to a desktop environment that supports Wayland natively if you wish to avoid Xorg.