Skip to content

Instantly share code, notes, and snippets.

@paseaf
Last active June 2, 2023 10:42
Show Gist options
  • Save paseaf/7bdbda502e66ce6aeb321bf4a7b75160 to your computer and use it in GitHub Desktop.
Save paseaf/7bdbda502e66ce6aeb321bf4a7b75160 to your computer and use it in GitHub Desktop.
Personal Linux Setup

Linux Machine Setup

Personal Linux setup

Tools to install

  1. VS Code

  2. Git:

    sudo add-apt-repository ppa:git-core/ppa -y
    sudo apt update; sudo apt install git
  3. Enalbe RPM Fusion for Fedora: https://rpmfusion.org/Configuration/

  4. Dev tools, software

    # Fedora
    sudo dnf groupinstall "Development Tools" "Development Libraries"
    sudo dnf install tmux vim neovim bash-completion python3-neovim tldr htop
    sudo dnf install evolution evolution-ews
    
    # Debian
    sudo apt install -y tmux vim curl build-essential bash-completion
    
    sudo add-apt-repository ppa:neovim-ppa/stable
    sudo apt update
    sudo apt install -y neovim
  5. Git Prompt

    • Install Bash Git Prompt

      git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1

      Add the following to ~/.bashrc

      # git-bash-prompt
      if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
       GIT_PROMPT_ONLY_IN_REPO=1
       source $HOME/.bash-git-prompt/gitprompt.sh
      fi
    • Or ZSH Git Prompt

      git clone https://github.com/olivierverdier/zsh-git-prompt.git ~/.zsh-git-prompt --depth=1

      Add the following to ~/.zshrc

      # load zsh git prompt
      source $HOME/.zsh-git-prompt/zshrc.sh
      # configure prompt
      PROMPT='%B%m%~%b$(git_super_status) %# '
  6. NVM, Node.js

    # Install NVM
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
    . ~/.bashrc
    
    # Install Node.js
    nvm install --lts
  7. Set up Flathub.

  8. Use Nvidia Driver on Fedora

    1. Install drivers follow https://rpmfusion.org/Howto/NVIDIA
    2. (optionally) set Nvidia as primary GPU
    3. On login: select GNOME on xorg

Dot Files

Sync dotfiles using chezmoi

sh -c "$(curl -fsLS chezmoi.io/get)"
chezmoi init --apply git@github.com:paseaf/dotfiles.git

Obsidian

Yank to System Clipboard in Vim mode

  1. In Obsidian, install vimrc-support plugin
  2. Create a .obsidian.vimrc file in your Obsidian Vault root path
  3. In .obsidian.vimrc, add the following and save
    " Yank to system clipboard
    set clipboard=unnamed
    
  4. Reload Obsidian (Ctrl+P and search reload)

Fedora Config

Fractional Scaling

  1. Install Gnome Tweaks
sudo dnf install gnome-tweaks 
  1. Open Gnome Tweaks In Fonts, adjust Scaling Factor

Key Bindings

  • Turn off Super+Tab:
gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Alt>Tab']"

Need Super+Tab for obsidian templater

  • Disble Ctrl+Alt+Left/Right from switchign workspaces
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Super>Page_Down']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Super>Page_Up']"
  • Toggle "Always on Top" with Ctrl+Super+T
dconf write /org/gnome/desktop/wm/keybindings/always-on-top  "['<Control><Super>t']"

Post-suspend tasks

Reconnect Bluetooth after suspend

Create /lib/systemd/system-sleep/bluetooth with

#!/bin/sh

case $1 in
  post)
    modprobe -r btusb
    sleep 1
    service bluetooth restart
    sleep 1
    modprobe btusb
    ;;
esac
chmod +x /lib/systemd/system-sleep/bluetooth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment