Skip to content

Commit 2a2b8dc

Browse files
committed
add wayland init logic
1 parent 7d7e602 commit 2a2b8dc

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

root/defaults/startwm_wayland.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
# Disable compositing and screen locking
4+
if [ ! -f $HOME/.config/kwinrc ]; then
5+
kwriteconfig6 --file $HOME/.config/kwinrc --group Compositing --key Enabled false
6+
fi
7+
if [ ! -f $HOME/.config/kscreenlockerrc ]; then
8+
kwriteconfig6 --file $HOME/.config/kscreenlockerrc --group Daemon --key Autolock false
9+
fi
10+
11+
# Power related
12+
setterm blank 0
13+
setterm powerdown 0
14+
15+
# Directories
16+
sudo rm -f /usr/share/dbus-1/system-services/org.freedesktop.UDisks2.service
17+
mkdir -p "${HOME}/.config/autostart" "${HOME}/.XDG" "${HOME}/.local/share/"
18+
chmod 700 "${HOME}/.XDG"
19+
touch "${HOME}/.local/share/user-places.xbel"
20+
21+
# Background perm loop
22+
if [ ! -d $HOME/.config/kde.org ]; then
23+
(
24+
loop_end_time=$((SECONDS + 30))
25+
while [ $SECONDS -lt $loop_end_time ]; do
26+
find "$HOME/.cache" "$HOME/.config" "$HOME/.local" -type f -perm 000 -exec chmod 644 {} + 2>/dev/null
27+
sleep .1
28+
done
29+
) &
30+
fi
31+
32+
# Create startup script if it does not exist (keep in sync with openbox)
33+
STARTUP_FILE="${HOME}/.config/autostart/autostart.desktop"
34+
if [ ! -f "${STARTUP_FILE}" ]; then
35+
echo "[Desktop Entry]" > $STARTUP_FILE
36+
echo "Exec=bash /config/.config/openbox/autostart" >> $STARTUP_FILE
37+
echo "Icon=dialog-scripts" >> $STARTUP_FILE
38+
echo "Name=autostart" >> $STARTUP_FILE
39+
echo "Path=" >> $STARTUP_FILE
40+
echo "Type=Application" >> $STARTUP_FILE
41+
echo "X-KDE-AutostartScript=true" >> $STARTUP_FILE
42+
chmod +x $STARTUP_FILE
43+
fi
44+
45+
# Enable Nvidia GPU support if detected
46+
if which nvidia-smi > /dev/null 2>&1 && ls -A /dev/dri 2>/dev/null && [ "${DISABLE_ZINK}" == "false" ]; then
47+
export LIBGL_KOPPER_DRI2=1
48+
export MESA_LOADER_DRIVER_OVERRIDE=zink
49+
export GALLIUM_DRIVER=zink
50+
fi
51+
52+
# Start DE
53+
WAYLAND_DISPLAY=wayland-1 Xwayland :1 &
54+
sleep 2
55+
exec dbus-launch /usr/bin/startplasma-x11 > /dev/null 2>&1

0 commit comments

Comments
 (0)