This commit is contained in:
tavo-wasd 2024-01-29 21:24:29 -06:00
parent d3f21aac23
commit 29afc5c639
3 changed files with 241 additions and 8 deletions

View file

@ -0,0 +1,117 @@
# Guide to using Debian
I recommend both the GNOME and KDE desktop environments,
this guide is made around the assumption that you are using
one of those. However, this could also be used as a reference
for general tweaks & tips for any desktop environment.
## Script
I made a simple script that you can run on a debian install
to customize some basic features like locale, non-free
software for nvidia drivers or Steam, it basically automates
the steps detailed in this guide for a quicker setup.
### Script functionality"
You can select any option by pressing 'y' or skip by pressing
anything else or leaving it blank. It currently supports:
- De-bloat by removing games, default torrent program, etc.
- Add non-free repositories (e.g. for Steam)
- Setup custom locales.
- Install non-free codecs & fonts (e.g. Arial)
- Install Steam
- Install flatpak (e.g. for Discord)
In order to run this script, type:
```shell
wget -qO - "LINK" | sudo sh
```
## Manual steps
### Manual update
```shell
sudo apt update && apt upgrade -y
```
### De-bloat
```shell
sudo apt purge gnome-games gnome-music synaptic transmission-gtk evolution shotwell -y
sudo apt autoremove -y
```
### Non-free repositories
```shell
sudo apt-add-repository contrib non-free -y
```
### Custom locales.
First, look for your preferred locale in
the available locales with this command:
```shell
cat /usr/share/i18n/SUPPORTED
```
Choose the locale you prefer, and run:
```shell
echo "CHOSENLOCALE" | sudo tee -a '/etc/locale.gen'
# For EXAMPLE: echo "es_CR.UTF-8 UTF-8" | su...
```
You can add as many locales as you want.
Then, generate the locales selected by running:
```shell
sudo locale-gen
```
### Non-free codecs & fonts
```
sudo apt install vlc libavcodec-extra ttf-mscorefonts-installer
```
#### (Extra) Nvidia drivers
```
sudo apt install nvidia-driver
```
### Steam
```
sudo dpkg --add-architecture i386 # Add 32bit packages
sudo apt update # Apply changes
sudo apt install mesa-vulkan-drivers libglx-mesa0:i386 mesa-vulkan-drivers:i386 libgl1-mesa-dri:i386
sudo apt install steam-installer
```
### Flatpak (e.g. for Discord)
```
sudo apt install flatpak
# sudo apt install plasma-discover-backend-flatpak # For KDE users
# sudo apt install gnome-software-plugin-flatpak # For GNOME users
```
Remember flatpak is just a packaging format, [flathub](https://flathub.org) is just
a popular repository for software where you can find official
builds for [Discord](https://flathub.org/apps/com.discordapp.Discord) or [Telegram Desktop](https://flathub.org/apps/org.telegram.desktop), and unofficial builds
for [Miscrosoft Teams](https://flathub.org/apps/com.github.IsmaelMartinez.teams_for_linux) or [VSCode](https://flathub.org/apps/com.visualstudio.code).
You can add the 'flathub' repository this way:
```
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
```
### Restart
You should restart your computer after applying this changes,
especially for flatpak and gpu drivers.

View file

@ -0,0 +1,124 @@
#!/bin/sh
printf '\033[2m
_______ _______ ____ _ ____ _____ _
| ____\ \/ /_ _| _ \ / \ / ___|| ____| |
| _| \ / | | | |_) | / _ \ \___ \| _| | |
| |___ / \ | | | _ < / ___ \ ___) | |___| |___
|_____/_/\_\ |_| |_| \_\/_/ \_\____/|_____|_____|
\033[0m
'
show_dialog() {
TITLE="$1" CONTENT="$2"
printf "\033[1m%s\033[0m | %s" "$TITLE" "$CONTENT"
}
show_dialog_newline() {
TITLE="$1" CONTENT="$2"
printf "\033[1m%s\033[0m | %s\n" "$TITLE" "$CONTENT"
}
show_notification() {
CONTENT="$1"
printf "\n\033[1m\033[34mEXTRASEL:\033[0m \033[1m%s\033[0m" "$CONTENT"
for i in 1 2 3; do sleep 0.8 ; printf "." ; done
}
warning() {
CONTENT="$1"
printf "\033[31mWarning:\033[0m %s\n" "$CONTENT"
}
[ "$(whoami)" != "root" ] && warning "You should be superuser." && exit 1
show_notification "Performing update"
apt update && apt upgrade -y
func_debloat() {
show_notification "Debloating"
apt purge gnome-games gnome-music synaptic transmission-gtk evolution shotwell -y
apt autoremove -y
}
func_nonfree () {
show_notification "Adding non-free & contrib repositories"
apt-add-repository contrib non-free -y
}
func_locale_choose () {
CHOSEN_LOCALE="$(cat /usr/share/i18n/SUPPORTED | fzf --margin 10% --prompt='Install locale: ')"
grep -q "^$CHOSEN_LOCALE" /etc/locale.gen &&
! [ -z "$CHOSEN_LOCALE" ] &&
CHOSEN_LOCALE="None" &&
warning "Locale already installed"
[ -z "$CHOSEN_LOCALE" ] &&
CHOSEN_LOCALE="None" &&
warning "Not chosen"
}
func_locale_install () {
[ "$CHOSEN_LOCALE" = "None" ] && return 0
[ "$CHOSEN_LOCALE" = "" ] && return 0
show_notification "Installing locales..."
echo "$CHOSEN_LOCALE" | tee -a '/etc/locale.gen'
locale-gen
}
func_codecs_msfonts () {
show_notification "Installing multimedia codecs & microsoft fonts"
apt install vlc libavcodec-extra ttf-mscorefonts-installer
}
func_steam() {
[ "$nonfree" != "y" ] && warning "Steam requires non-free repositories, Steam not installed." && return 1
show_notification "Installing Steam"
dpkg --add-architecture i386
apt update
apt install mesa-vulkan-drivers libglx-mesa0:i386 mesa-vulkan-drivers:i386 libgl1-mesa-dri:i386
apt install steam-installer
}
func_flatpak() {
if [ "$XDG_CURRENT_DESKTOP" = "" ]
then
desktop=$(echo "$XDG_DATA_DIRS" | sed 's/.*\(xfce\|kde\|gnome\).*/\1/')
else
desktop=$XDG_CURRENT_DESKTOP
fi
desktop="$(echo "$desktop" | tr '[:upper:]' '[:lower:]')"
[ "$desktop" = "gnome" ] && store_plugin="gnome-software-plugin-flatpak"
[ "$desktop" = "kde" ] && store_plugin="plasma-discover-backend-flatpak"
show_notification "Installing flatpak"
apt install flatpak "$store_plugin"
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
}
printf '\033[2m
____ ___ _ _ _____ ___ ____
/ ___/ _ \| \ | | ___|_ _/ ___|
| | | | | | \| | |_ | | | _
| |__| |_| | |\ | _| | | |_| |
\____\___/|_| \_|_| |___\____|
\033[0m
'
show_dialog "DE-BLOAT" "Remove unnecessary packages (e.g. gnome-games) [y/n]:" && read -r debloat
show_dialog "NON-FREE" "Add non-free & contrib repositories (e.g. for Valve's Steam) [y/n]: " && read -r nonfree
func_locale_choose
show_dialog_newline "LOCALE" "Add locale: $CHOSEN_LOCALE"
show_dialog "CODECS & FONTS" "Add multimedia codecs & microsoft fonts (e.g. Arial) [y/n]: " && read -r codecs
show_dialog "STEAM" "Install the 'steam-installer' to launch steam installation [y/n]: " && read -r steaminstall
show_dialog "FLATPAK" "Install flatpak repositories (e.g. for Discord, Microsoft Teams...) [y/n]: " && read -r flatinstall
[ "$debloat" = "y" ] && func_debloat
[ "$nonfree" = "y" ] && func_nonfree
func_locale_install
[ "$codecs" = "y" ] && func_codecs_msfonts
[ "$steaminstall" = "y" ] && func_steam
[ "$flatinstall" = "y" ] && func_flatpak

View file

@ -1,8 +0,0 @@
# Guide to pimp out Gnome on Debian GNU/Linux
So Gnome is pretty and powerful out of the box,
here's some tips to make it even better.
### Checklist
- [] Arrange menu items