Skip to content

A hardened Linux desktop, rebuilt from scratch, with your Windows apps built in. Free and open source.

2.0 KB
Raw Blame
#!/bin/sh
set -e

# Older versions moved Plasma's desktop main.qml aside and put a patched copy
# in its place, so the desktop's "Personalise" opened Settings. The Wild OS
# desktop (wildos-desktop-view) now draws its own menu, so on upgrade the
# patched copy goes and Plasma's own file comes back.
MENU=/usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/main.qml

if [ "$1" = "configure" ]; then
    if dpkg-divert --listpackage "$MENU" | grep -qx wildos-settings; then
        rm -f "$MENU"
        dpkg-divert --package wildos-settings --remove --rename --divert "$MENU.plasma" "$MENU" >/dev/null
    fi
    # NetworkManager reads its new defaults (lookups through
    # systemd-resolved, private Wi-Fi addresses) without dropping the
    # connections it has up.
    if [ -d /run/systemd/system ] && systemctl is-active --quiet NetworkManager.service; then
        nmcli general reload >/dev/null 2>&1 || true
    fi
    # The firewall's rules change with the package; loaded again now rather
    # than at the next start-up.
    if [ -d /run/systemd/system ] && [ -x /usr/libexec/wildos/settings-protection ] && command -v nft >/dev/null; then
        /usr/libexec/wildos/settings-protection boot || true
    fi
    # Steam's controller rules follow the 32-bit choice, including on PCs
    # that turned it on before the rules came with it.
    /usr/libexec/wildos/settings-32bit devices || true
    # PCs that turned Steam and 32-bit apps on before games got the split
    # lock setting with it.
    SYSCTL32=/etc/sysctl.d/991-wildos-32bit.conf
    if [ -e /etc/wildos/32bit ] && [ -f "$SYSCTL32" ] && ! grep -q split_lock_mitigate "$SYSCTL32"; then
        printf '%s\n' '# Some games use split locks, which newer Intel processors otherwise punish' \
            '# with a delay that shows as stutter. The delay only guards against one' \
            '# program slowing others down, not against reading them.' \
            '-kernel.split_lock_mitigate = 0' >> "$SYSCTL32"
        sysctl -q -w kernel.split_lock_mitigate=0 2>/dev/null || true
    fi
fi

#DEBHELPER#