Code Monkey home page Code Monkey logo

dotfiles's Introduction

Build Status Sponsor count

What's in there?

This is meant to be a 'minimal', distraction free setup. No fancy statusbars, no crazy window decorations, no distractions. With these dotfiles I want to automate as much as possible and keep UI clutter to a minimum for a distraction-free environment.

I don't recommend running the setup script on your machine unless you understand what it does.
I do recommend having a look through the various config files. Below is a rough overview.

If you are interested in the CI setup, look below.

Window manager: i3

  • i3bar is only shown when the modifier key is pressed
  • i3bar only shows the workspaces, time and tray programs

Terminal: Alacritty + tmux

Alacritty (vs. urxvt) improves various things for me:

  • Much better HiDPI support
  • Automatic config reloading (no more need for xrdb -merge and starting a new terminal
  • Emoji support ✨

The tmux status display has no additional information apart from windows.

tmux status display

Shell: zsh

  • Custom zsh prompt/theme
  • CTRL+Z to send jobs to background and to foreground
  • No oh-my-zsh, because it makes things slow
  • Same completion as oh-my-zsh

zsh prompt

Editor: Vim

  • Using coc.vim for language integrations
  • Support for 'line' cursor shape in insert mode if using nvim
  • Turns syntax off for large files
  • Open the current file in browser (Useful for markdown)
  • Return to the same line when you reopen a file
  • Switch between tmux and vim panes using the same shortcuts

Git

  • Pre-defined commit message with suggestions

Ruby

  • Basic rubocop.yml
  • irbrc - start pry if possible
  • gemrc - never download docs

Scripts in bin/

  • off Will ask you to do a daily review, time tracking and if you are fine with your journaling and then suspend the machine.
  • clean_rails cleans cache and log files in rails projects

Installation

System bootstrapping

Just run the following command:

wget --no-check-certificate https://github.com/phansch/dotfiles/raw/main/setup -O - | bash -s -- -s

This will:

  1. Setup Ansible
  2. Upgrade and autoclean system packages
  3. Clone the dotfiles (or pull if they exist already)
  4. Run the base playbook to install the prerequisites
  5. Run the dotfiles playbook to symlink the dotfiles
  6. Print the command to run the optional playbooks

Just the dotfiles

If you just want the dotfiles, clone them and use stow as below.

git clone https://github.com/phansch/dotfiles.git $HOME/.dotfiles

cd $HOME

# Install stow
sudo apt-get install stow

# To install the ruby dotfiles. Replace `ruby` with the stow package you want.
# See ansible/playbooks/dotfiles.yml for a complete list of the stow packages.
stow ruby --verbose=1 --target=$HOME/ --dir=$HOME/.dotfiles

Environment variables

Some scripts, like the off script, use environment variables for configuration. You can set these in your ~/.zshrc.local which is sourced by ~/.zshrc automatically.

The current environment variables are:

Variable Function
DAILY_REVIEW_LINK If set, opens the configured link when using the off script
WORK_TIME_TRACKING If set, opens the configured link when using the off script

Development

Since it can be a bit problematic to test changes to the configuration on the actual machine where you want to make them, you can use Vagrant to test changes to the configuration.

You will need Vagrant and Virtualbox installed, then you can run:

vagrant up

You can then either use vagrant ssh or connect to the VM through Virtualbox to have a GUI.

Re-running a failed ansible playbook

ansible-playbook ansible/playbooks/<the-playbook>.yml

Running the tests

run-parts test/

CI Info

CI is trying to mirror a full Ubuntu installation in order to ensure the setup script doesn't fail.

All ansible playbooks are run on CI. The build will fail if:

  • Any ansible playbook has not finished successfully
  • i3 config is invalid
  • vint detects mistakes in init.vim
  • yaml-lint finds any issues
  • ansible-playbook --syntax-check has not finished successfully
  • shellcheck found errors

Have a look at the .travis.yml and Dockerfile to see how it works.

dotfiles's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar phansch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dotfiles's Issues

Dell XPS 13 9360 Multi Monitor support

Everything has to go through the USB-C port

This chart has an overview over tested USB-C devices: https://wiki.archlinux.org/index.php/Dell_XPS_13_(9360)#USB-C_Compatibility_Chart

https://apple.stackexchange.com/questions/261335/2-hdmi-1080p-monitors-from-1-usb-c-port

Use GNU stow for dotfiles

http://louistiao.me/posts/louis-does-dotfiles/

Stow allows me to group together related config files in directories. It's also possible to manage system-wide configuration, for example in /etc.

  • Move everything into nice stow packages
  • Remove .rcrc
  • Update setup script
  • Make sure all tests are still working, because some check hardcoded directories (shellcheck for example)
  • Update Readme

gpg prompt breaks vim

When doing a commit through vim fugitive, vim hangs on the gpg prompt. On Arch it was opening a new gtk window, but on Xubuntu it doesn't.
Have to check how to enter the gpg passphrase through the gtk window.

.xinitrc is not working reliable

Not really sure what's causing it, but the execution of the script seems to be totally random.

  • Sometimes ­dwm is not running
  • Sometimes the screens aren't setup correctly
  • Sometimes everything is running fine after just two seconds
  • Sometimes everything is running after waiting a minute
  • Some programs are not started

Setup arandr

  • Setup arandr f9c542a
  • Include .screenlayout directory 2dc08b2
  • Execute the correct arandr profile per machine a1ccfa9
  • Setup a work_default profile that disables the laptop screen and enables both other screens, with the right one rotated left 2dc08b2
  • Setup a work_mobile profile that disconnects external screens and enables the laptop screen 6d04da6
  • Setup a home_default profile that just uses the laptop screen
  • Setup a home_beamer profile that sets up the beamer correctly

Setup home laptop with xubuntu

  • Only have to make a new gpg key and add it to Github
  • need to copy over the ssh public/private keys from the backup and chmod 400 ~/.ssh/id_rsa*
  • Need to setup the webdav drive

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.