Skip to content

Instantly share code, notes, and snippets.

@Veraxus
Last active May 28, 2025 01:34
Show Gist options
  • Select an option

  • Save Veraxus/4e4695114c67d0a9f6e8a81a9023f92e to your computer and use it in GitHub Desktop.

Select an option

Save Veraxus/4e4695114c67d0a9f6e8a81a9023f92e to your computer and use it in GitHub Desktop.
Kubuntu Setup Helper
#!/usr/bin/env bash
# This script will automatically set up a new Kubuntu Minimal system
sudo apt install vim curl flatpak kde-config-flatpak steam-devices timeshift -y
# Add flathub repo for flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# Install Firefox
flatpak install flathub org.mozilla.firefox -y
# Install Steam
# Don't do this via Flatpak. The sandboxing causes problems with secondary drives.
#flatpak install com.valvesoftware.Steam -y
# Ensure Steam has access to controllers/devices
flatpak override --user --device=all com.valvesoftware.Steam
# Install Discord
flatpak install flathub com.discordapp.Discord -y
# Install Heroic
flatpak install flathub com.heroicgameslauncher.hgl -y
# Install Lutris
flatpak install flathub net.lutris.Lutris -y
# Install LibreOffice
flatpak install org.libreoffice.LibreOffice -y
# Add XDG_DATA_DIRS to .profile with flatpak dirs
KSH_XDG_STR='export XDG_DATA_DIRS="$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share"'
if ! grep -Fxq "$KSH_XDG_STR" "$HOME/.profile"; then
echo -e "\n# Ensure Flatpak apps appear in menus\n$KSH_XDG_STR" >> "$HOME/.profile"
echo "Added Flatpak XDG_DATA_DIRS to ~/.profile"
else
echo "Flatpak XDG_DATA_DIRS already present in ~/.profile"
fi
# Update /etc/sysctl.conf for big memory-hungry games (e.g. Star Citizen)
# Ensure vm.max_map_count is set to at least 16777216
SCVMMAX_CURRENT=$(sysctl -n vm.max_map_count)
SCVMMAX_TARGET=16777216
# If the current setting/default is lower than we need...
if [ "$SCVMMAX_CURRENT" -lt "$SCVMMAX_TARGET" ]; then
echo "Current vm.max_map_count is $SCVMMAX_CURRENT, updating to $SCVMMAX_TARGET..."
# Does setting already exist in the conf?
if grep -q "^vm.max_map_count=" /etc/sysctl.conf; then
# Update it
sudo sed -i "s/^vm.max_map_count=.*/vm.max_map_count=$SCVMMAX_TARGET/" /etc/sysctl.conf
else
# Add new value
echo -e "\n# Updating /etc/sysctl.conf with vm.max_map_count=$SCVMMAX_TARGET" | sudo tee -a /etc/sysctl.conf > /dev/null
fi
# Make sure any changes are immediately applies
sudo sysctl --system
echo "vm.max_map_count updated and applied."
else
echo "vm.max_map_count is already >= $SCVMMAX_TARGET (current: $SCVMMAX_CURRENT)! No changes made."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment