|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Disable compositing and screen lock |
| 4 | +if [ ! -f $HOME/.config/kwinrc ]; then |
| 5 | + kwriteconfig5 --file $HOME/.config/kwinrc --group Compositing --key Enabled false |
| 6 | +fi |
| 7 | +if [ ! -f $HOME/.config/kscreenlockerrc ]; then |
| 8 | + kwriteconfig5 --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 | +# Start DE |
| 46 | +WAYLAND_DISPLAY=wayland-1 Xwayland :1 & |
| 47 | +sleep 2 |
| 48 | +exec dbus-launch --exit-with-session /usr/bin/startplasma-x11 > /dev/null 2>&1 |
0 commit comments