# Workstation PC Maintenance

# Debian Workstation Personalization

[![Bootstraping a Debian Workstation](https://img.shields.io/badge/Bootstraping_a_Debian_Workstation-4F46E5?style=flat-square)](/books/debian-admin-guides/page/bootstraping-a-debian-workstation)

Installation
-------------

#### Install GNOME Shell Extensions

[![GNOME Shell Extensions](https://img.shields.io/badge/GNOME_Shell_Extensions-indigo?style=flat-square)](https://extensions.gnome.org/)

- [Media Controls](https://extensions.gnome.org/extension/4470/media-controls/)

  ###### Configure Media Controls Extension

  ```shell
  dconf load /org/gnome/shell/extensions/mediacontrols/ <<'EOF'
  [/]
  cache-art=false
  colored-player-icon=false
  extension-index=uint32 10
  extension-position='Left'
  show-label=false
  show-player-icon=true
  EOF
  ```

- [Auto Power Profile](https://extensions.gnome.org/extension/6583/auto-power-profile/)

- [Lenovo IdeaPad Goodies](https://extensions.gnome.org/extension/2992/ideapad/)*


  > \* When GNOME reaches 49 and kernel reaches 6.16 switch to
  > [Preserve Battery QT](https://extensions.gnome.org/extension/9227/preserve-battery-quicktoggle/).

Configuration
--------------

#### GNOME Settings

```shell
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
gsettings set org.gnome.desktop.interface accent-color 'red'
gsettings set org.gnome.desktop.peripherals.mouse natural-scroll true
gsettings set org.gnome.desktop.sound event-sounds false
gsettings set org.gnome.settings-daemon.plugins.power power-button-action 'nothing'
gsettings set org.gnome.desktop.privacy recent-files-max-age 7
gsettings set org.gnome.desktop.privacy remove-old-trash-files true
gsettings set org.gnome.desktop.privacy remove-old-temp-files true
gsettings set org.gnome.desktop.privacy old-files-age 7
gsettings set org.gnome.desktop.interface clock-format '24h'
gsettings set org.gnome.desktop.interface clock-show-weekday true
gsettings set org.gnome.desktop.interface clock-show-date true
gsettings set org.gnome.desktop.interface clock-show-seconds true
gsettings set org.gnome.desktop.interface clock-show-week-numbers true
gsettings set org.gnome.desktop.calendar show-weekdate true
gsettings set org.gnome.desktop.privacy disable-camera true
```

#### GNOME Text

```shell
gsettings set org.gnome.TextEditor show-line-numbers true
gsettings set org.gnome.TextEditor show-right-margin true
gsettings set org.gnome.TextEditor right-margin-position 100
gsettings set org.gnome.TextEditor restore-session false
```

#### GNOME Nautilus (Files)

```shell
gsettings set org.gtk.gtk4.Settings.FileChooser sort-directories-first true
```

#### Generate a New SSH Key

```shell
ssh-keygen -t ed25519
```

#### Initial Git Client Setup

[![Git Client Guide](https://img.shields.io/badge/Git_Client_Guide-4F46E5?style=flat-square)](/books/general-guides/page/git-client-guide)

```shell
git config --global user.name "Tomáš Havlas"
git config --global user.email "tomas@havlas.me"
git config --global core.editor "vim"
git config --global core.excludesFile "~/.gitignore"
git config --global init.defaultBranch "main"
```

```shell
tee ~/.gitignore >/dev/null <<'EOF'
.idea
.vscode
EOF
```

Theming
--------

#### Customize GRUB2 Theme

```shell
sudo rm --force /etc/grub.d/05_debian_theme
sudo ln --symbolic /dev/null /etc/grub.d/05_debian_theme
```

##### Debian GRUB2 Theme

[![Debian GRUB2 Theme](https://img.shields.io/badge/Debian_GRUB2_Theme-7B2C2C?style=flat-square)](https://github.com/AdisonCavani/distro-grub-themes)

```shell
wget --quiet -O debian.tar.xz https://kb.havlas.me/attachments/9
mkdir debian
tar --extract --file debian.tar.xz --directory debian
sudo mkdir -p /boot/grub/themes
sudo mv debian /boot/grub/themes/
sudo chown --recursive root:root /boot/grub/themes/debian
sudo chmod --recursive go-w /boot/grub/themes/debian
rm debian.tar.xz
```

```shell filename="/etc/default/grub"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

GRUB_GFXMODE=1920x1080x32
GRUB_GFXPAYLOAD_LINUX="keep"
GRUB_THEME="/boot/grub/themes/debian/theme.txt"
```

```shell
sudo update-grub
```

#### Customize Plymouth Theme

[![The Plymouth_Project](https://img.shields.io/badge/The_Plymouth_Project-indigo?style=flat-square)](https://www.freedesktop.org/wiki/Software/Plymouth/)
[![plymouth/plymouth](https://img.shields.io/badge/plymouth/plymouth-555555?style=flat-square&logo=gitlab)](https://gitlab.freedesktop.org/plymouth/plymouth)

```shell
sudo apt install plymouth plymouth-themes
```

##### Debian (macOS Style) Plymouth Theme

[![Debian (macOS Style) Plymouth Theme](https://img.shields.io/badge/Debian_(macOS_Style)_Plymouth_Theme-7B2C2C?style=flat-square)](https://www.gnome-look.org/p/2106821/)

```shell
wget --quiet -O debian-mac-style.tar.xz https://kb.havlas.me/attachments/10
mkdir debian-mac-style
tar --extract --file debian-mac-style.tar.xz --directory debian-mac-style
sudo mv debian-mac-style /usr/share/plymouth/themes
sudo chown --recursive root:root /usr/share/plymouth/themes/debian-mac-style
sudo chmod --recursive go-w /usr/share/plymouth/themes/debian-mac-style
rm debian-mac-style.tar.xz
```

```shell
sudo plymouth-set-default-theme debian-mac-style
```

#### Customize Mouse Theme

##### Bibata Modern Mouse Theme

[![Bibata Modern Mouse Theme](https://img.shields.io/badge/Bibata_Modern_Mouse_Theme-7B2C2C?style=flat-square)](https://github.com/ful1e5/Bibata_Cursor)

```shell
wget --quiet -O Bibata-Modern.tar.xz https://kb.havlas.me/attachments/12
mkdir Bibata-Modern
tar --extract --file Bibata-Modern.tar.xz --directory Bibata-Modern
mkdir --parents ~/.local/share/icons
mv Bibata-Modern ~/.local/share/icons
chmod --recursive go-w ~/.local/share/icons
rm Bibata-Modern.tar.xz
```

```shell
gsettings set org.gnome.desktop.interface cursor-theme 'Bibata-Modern'
```

#### Customize Icon Theme

##### Tela Icon Theme

[![Tela Icon Theme](https://img.shields.io/badge/Tela_Icon_Theme-7B2C2C?style=flat-square)](https://github.com/vinceliuice/Tela-icon-theme)

```shell
wget --quiet -O Tela.tar.xz https://kb.havlas.me/attachments/14
mkdir Tela
tar --extract --file Tela.tar.xz --directory Tela
bash Tela/install.sh red
rm --recursive Tela Tela.tar.xz
```

```shell
gsettings set org.gnome.desktop.interface icon-theme 'Tela-red-dark'
```

#### Customize GNOME/GTK Theme

##### Fluent GTK Theme

[![Fluent GTK Theme](https://img.shields.io/badge/Fluent_GTK_Theme-7B2C2C?style=flat-square)](https://github.com/vinceliuice/Fluent-gtk-theme)

```shell
sudo apt install gtk2-engines-murrine sassc
```

```shell
wget --quiet -O Fluent.tar.xz https://kb.havlas.me/attachments/13
mkdir Fluent
tar --extract --file Fluent.tar.xz --directory Fluent
bash Fluent/install.sh -t red -c dark -s standard -i simple
rm --recursive Fluent Fluent.tar.xz
```

```shell
gsettings set org.gnome.desktop.interface gtk-theme 'Fluent-red-Dark'
```

```shell
gnome-extensions enable user-theme@gnome-shell-extensions.gcampax.github.com
gsettings --schemadir ~/.local/share/gnome-shell/extensions/user-theme@gnome-shell-extensions.gcampax.github.com/schemas/ \
  set org.gnome.shell.extensions.user-theme name 'Fluent-red-Dark'
```

###### Install Link to GTK4 Config for Theming libadwaita

```shell
bash install.sh --libadwaita -t red -c dark -s standard -i simple
```

#### Customize Desktop Background

##### Emby-Spark's CC-O---RRR--RUPT--TT--IONN-N---N

[![Emby-Spark](https://img.shields.io/badge/Emby--Spark-7B2C2C?style=flat-square)](https://www.deviantart.com/emby-spark)

```shell
mkdir --parents ~/.local/share/backgrounds
wget --quiet -O ~/.local/share/backgrounds/CC-O---RRR--RUPT--TT--IONN-N---N.JPG https://kb.havlas.me/attachments/11
gsettings set org.gnome.desktop.background picture-uri "file://$HOME/.local/share/backgrounds/CC-O---RRR--RUPT--TT--IONN-N---N.JPG"
gsettings set org.gnome.desktop.background picture-uri-dark "file://$HOME/.local/share/backgrounds/CC-O---RRR--RUPT--TT--IONN-N---N.JPG"
gsettings set org.gnome.desktop.background picture-options "zoom"
```


```shell

cd /tmp
curl -LO https://github.com/googlefonts/googlesans/releases/download/v14.000/GoogleSans-v14.000.zip
unzip -o GoogleSans-v14.000.zip -d GoogleSans

mkdir -p ~/.local/share/fonts/GoogleSans
cp GoogleSans/build/GoogleSans/static/*.ttf ~/.local/share/fonts/GoogleSans/
```

# dotfiles

```shell
git init --bare $HOME/.dotfiles
```

```shell bashrc
alias dotfiles="git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
```

```shell
dotfiles config --local status.showUntrackedFiles no
```

Existing
---------

```shell
git clone --bare git@gitlab.com:havlasme/dotfiles.git $HOME/.dotfiles
```

```shell bashrc
alias dotfiles="git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
```

```shell
dotfiles checkout
dotfiles config --local status.showUntrackedFiles no
```