This repo contains script to setup a Linux workstation.
Some configs (e.g., the gdb config) assume this repo is cloned in ~/.dot
.
Thus, the repo can be cloned using
To do so, run
git clone git@github.com:aalbaali/workstation_setup.git ~/.dot
# Install minimum requirements
sudo apt-get update
sudo apt-get install -y curl ca-certificates git
curl -sS https://raw.githubusercontent.com/aalbaali/workstation_setup/master/clone_and_run_dev_playbook | bash -
The install scripts can be activated using a Makefile. The default scripts are
install_packages.sh
, andpost_install_setup.sh
using the arguments--zsh --functions --git --nvim --clang_format --gdb --nvim-setup
To run the default scripts, run
make
The other installations can be activated by running
make vscode
make latex_classes
There are some prompts for some installations. To bypass these prompts, run the command
yes "" | make
Package-specific config files are stored under the stow
directory.
These config files can be linked to the home directory using stow
.
The config files can be set up using the post_install_setup.sh
.
The takes multiple arguments based on the config files to link (using stow
).
Furthermore, the script can set up some packages (e.g., neovim plugins installations).
For example, running (from the root of this repo)
./scripts/post_install_setup.sh --zsh --functions --git --nvim --clang_format --gdb --nvim-setup
will install the config files for zsh, git, neovim, clang-format, gdb debugginer, and install the packages for neovim.
Install tilix by running
sudo apt-get install tilix
Ensure that the Windowing system is set to X11; Wayland option will have issues with Quake.
- To check the windowing system, check the About section in Settings, or run
echo $XDG_SESSION_TYPE
. - To set X11, uncomment the
WaylandEnable=false
line in/etc/gdm3/custom.conf
. The changes may not take place until a restart or re-login takes place.
Open tilix (by searching for the app) and then open the user preferences
- Appearance
- Window style : set to Borderless
- Uncheck the Show the terminal title even if it's the only terminal
- Set font to a nerd font (make sure to install the font first by running the installation script)
- Quake
- Adjusut height percentage (I have mine set at 70%)
- Adjust width percentage (I have mine set at 75%)
To run quake from anywhere in Linux, add a keyboard shortcut in the shortcuts settings.
I have mine set to Super + -
, which calls the command tilix --quake
To run tilix using the ctrl + alt + T
shortcut, disable the terminal's shortcut and enable a tilix shortcut.
To make Sioyek the default PDF viewer, the sioyek.desktop
needs to be installed.
This is done as follows:
- Link
sioyek.desktop
fromstow/sioyek/.local/share/applications/sioyek.desktop
into~/.local/share/application
- Link
sioyek-icon-linux.png
fromstow/sioyek/.local/share/Sioyek/sioyek-icon-linux.png
into~/.local/share/Sioyek
- Install the application by running
sudo desktop-file-install sioyek.desktop
from~/.local/share/application
The auto-dock can be customized so that it doesn't pop up when switching applications using shortcuts. To configure the autodock, an editor is to be installed.
sudo apt install dconf-editor
Once installed, launch the dconf Editor application and go to /org/gnome/shell/extensions/dash-to-dock/hot-keys
and turn off the hotkeys-overlay and hotkeys-show-dock options.
Also, set /org/gnome/shell/extensions/dash-to-dock/shortcut-timeout
timeout value to 0
(you need to turn off Use default value
, and set the Custom value
to 0).
To load dconf settings, run
dconf load / < dconf-settings.ini
sudo apt install gnome-tweaks
To install different versions of NodeJS, you can use the n
npm package.
# Make sure npm is installed
sudo apt-get install npm
# Install n manager
sudo npm install -g n
# Install latest node version
sudo n latest
# Or, install specific version
# sudo n 16.20
Alternatively, use the node version manager nvm
:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.zshrc # Or source ~/.bashrc
nvm install 16.20
Neovim's coc-ccls may give an error of unable to load global extension.
The error can be resolved by running
cd ~/.config/coc/extensions/node_modules/coc-ccls
ln -s node_modules/ws/lib lib
This snippet is executed in the post_install_setup.sh
script when passing the --nvim-setup
flag.
Note that this script will only work after installing the coc-ccls
plugin first (i.e., it sufficies to launch nvim
before launching the script).
Additional packages may be required for the ZSH font to be displayed correctly. Check the spaceship-prompt and this answer.
Docker has detach binding set to ctrl+p
by default.
This causes issues while inside a container such as accessing the previous command.
To fix this issue, change the default Docker detach binding by modifying ~/.docker/config.json
to be
{
"detachKeys": "ctrl-z,z"
}
I use a Keychron K2 keyboard, which supports bluetooth connection.
When the computer goes to sleep, the keyboard disconnects.
However, reconnecting to the computer after waking it up takes quite some time.
To fix this, make the following changes inside sudo vim /etc/bluetooth/main.conf
:
# Uncomment the following lines
FastConnectable = false
ReconnectIntervals=1, 2, 4, 8, 16, 32, 64
AutoEnable=true
Sometimes, Mason encounters issues while installing some packages. For example,
.../start/mason.nvim/lua/mason-core/installer/init.lua:61: Lockfile already exists. Package(name=lua-language-server)
This is usually caused by a lock by npm to prevent multiple installs. Here are some checks to remove this error:
- check any running npm installations, and either wait for them to finish or kill them;
- if there are no installations are running, then it's possible that the lock file is stale and didn't update. To remove the lock, delete the files in
~/.local/share/nvim/mason/staging
Sometimes the autocompletion tends to act funny. One of the reasons I found was happening when loading starship.
Specifically, when I commented out the eval "$(starship init zsh)"
line from ~/.zshrc
, the issue would disappear.
The solution was to install locale
and set the region and language settings. The following are the debugging and solution steps:
- To ensure that the issue is a
locale
issue, then if you try to paste the character❯
in the terminal would not paste properly - Solution:
sudo apt-get install locales
# Ensure the following env vars are stored in ~/.zshrc
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_ALL=en_US.UTF-8
- Allison Thackston's workstation setup
- Hiding terminal titlebar: AskUbuntu Question
- Marc Gallant's dotfiles kam3k/dot_files