Skip to content

Instantly share code, notes, and snippets.

@thybzi
Last active July 13, 2026 14:41
Show Gist options
  • Select an option

  • Save thybzi/6dadc90e98439672ace6adfd25451694 to your computer and use it in GitHub Desktop.

Select an option

Save thybzi/6dadc90e98439672ace6adfd25451694 to your computer and use it in GitHub Desktop.
Xubuntu 26
#!/bin/bash
set -e
echo "===== BASE UTILITIES ====="
sudo apt update
sudo apt install -y curl wget git vim mousepad xdotool blueman libspa-0.2-bluetooth xfce4-xkb-plugin libnotify-bin make python3-venv python3-pip
echo "===== FIREFOX (NON-SNAP) ====="
sudo install -d -m 0755 /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
sudo tee /etc/apt/sources.list.d/mozilla.sources > /dev/null << EOF
Types: deb
URIs: https://packages.mozilla.org/apt
Suites: mozilla
Components: main
Signed-By: /etc/apt/keyrings/packages.mozilla.org.asc
EOF
echo -e "Package: *\nPin: origin packages.mozilla.org\nPin-Priority: 1000" | sudo tee /etc/apt/preferences.d/mozilla
echo -e "Package: firefox\nPin: release o=Ubuntu\nPin-Priority: -1" | sudo tee /etc/apt/preferences.d/block-snap-firefox
echo "===== BRAVE ====="
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
sudo curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources https://brave-browser-apt-release.s3.brave.com/brave-browser.sources
echo "===== VS CODE ====="
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo tee /etc/apt/sources.list.d/vscode.sources > /dev/null << EOF
Types: deb
URIs: https://packages.microsoft.com/repos/code
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/packages.microsoft.gpg
EOF
rm -f packages.microsoft.gpg
echo "===== INSTALLING PACKAGES ====="
sudo apt update
sudo apt install -y firefox brave-browser code
echo "===== BLUETOOTH ====="
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/blueman-applet.desktop << 'EOF'
[Desktop Entry]
Type=Application
Name=Blueman Applet
Exec=blueman-applet
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
EOF
echo "===== WIN+D SCRIPT ====="
sudo tee /usr/local/bin/show-desktop > /dev/null << 'EOF'
#!/bin/bash
sleep 0.15
xdotool key --clearmodifiers Ctrl+Alt+d
EOF
sudo chmod +x /usr/local/bin/show-desktop
echo "===== TOUCHPAD TOGGLE (F8) ====="
sudo tee /usr/local/bin/toggle-touchpad > /dev/null << 'EOF'
#!/bin/bash
# Automatically find touchpad ID by name pattern
TOUCHPAD_ID=$(xinput list | grep -i "touchpad" | grep -o "id=[0-9]*" | grep -o "[0-9]*" | head -1)
# If no touchpad found, show error
if [ -z "$TOUCHPAD_ID" ]; then
notify-send "Touchpad" "Touchpad not found" -i error
exit 1
fi
# Get current state (1 = enabled, 0 = disabled)
STATE=$(xinput list-props $TOUCHPAD_ID | grep "Device Enabled" | awk '{print $4}')
if [ "$STATE" = "1" ]; then
# If enabled → disable
xinput disable $TOUCHPAD_ID
notify-send "Touchpad" "Touchpad is now OFF" -i input-touchpad
else
# If disabled → enable
xinput enable $TOUCHPAD_ID
notify-send "Touchpad" "Touchpad is now ON" -i input-touchpad
fi
EOF
sudo chmod +x /usr/local/bin/toggle-touchpad
echo "===== RESTARTING AUDIO SERVER ====="
systemctl --user restart pipewire 2>/dev/null || true
systemctl --user restart pipewire-pulse 2>/dev/null || true
sudo systemctl restart bluetooth
echo "=========================================="
echo "✅ ALL DONE!"
echo "=========================================="
echo ""
echo "📌 NEXT STEPS (DO MANUALLY):"
echo ""
echo "1️⃣ Disable Win for Whisker Menu (remove Super L / Super R)"
echo "2️⃣ Set up Win+D → /usr/local/bin/show-desktop"
echo "3️⃣ Set up F8 → /usr/local/bin/toggle-touchpad"
echo "4️⃣ Add Keyboard Layout indicator to panel"
echo "5️⃣ Enable two-finger tap for right click"
echo "6️⃣ Reboot your system"
echo ""
echo "📖 For detailed instructions, see 2_xubuntu26_min_manual.md"
echo "=========================================="

Manual Setup Steps for Xubuntu 26 Minimal

After running 1_xubuntu26_min_after_install.sh, follow these steps manually.


Essential Setup

1️⃣ Disable Win Key for Whisker Menu

  • Open SettingsKeyboardApplication Shortcuts tab
  • Find three entries for xfce4-popup-whiskermenu:
    • Super LREMOVE (select and click Remove)
    • Super RREMOVE
    • Ctrl+EscapeKEEP (or remove if you don't need it)

Why? This frees the Win (Super) key so it can be used for custom shortcuts without interference.


2️⃣ Set Up Win+D (Show Desktop)

  • Open SettingsKeyboardApplication Shortcuts tab
  • Click Add
  • Command: /usr/local/bin/show-desktop
  • Click OK
  • Press Win+D on your keyboard

What it does: Toggles "Show Desktop" — minimizes all windows on first press, restores them on second press.


3️⃣ Set Up F8 (Touchpad Toggle)

  • Open SettingsKeyboardApplication Shortcuts tab
  • Click Add
  • Command: /usr/local/bin/toggle-touchpad
  • Click OK
  • Press F8 (or Fn+F8 depending on your laptop)

What it does: Enables/disables the touchpad. A notification will appear showing the new state.


4️⃣ Add Keyboard Layout Indicator

  • Right-click on the panel (taskbar)
  • Select PanelAdd New Items
  • Find "Keyboard Layouts" in the list
  • Click Add

What it does: Shows current keyboard layout (e.g., EN, RU) and allows you to switch between layouts.


5️⃣ Enable Two-Finger Tap for Right Click

  • Open SettingsMouse and Touchpad
  • Go to the Touchpad tab
  • Enable: Enable tap-to-click
  • Enable: Click with 1, 2 or 3 fingers as a left, right, or middle click

What it does: Tapping with one finger = left click, two fingers = right click (context menu), three fingers = middle click.


6️⃣ Reboot Your System

sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment