2019-09-21 15:18:38 +00:00
#+TITLE : Phundrak’ s dotfiles
2020-01-15 11:38:29 +00:00
#+INCLUDE : ~/org/config-website/headers.org
#+OPTIONS : auto-id:t
2019-12-28 21:08:21 +00:00
#+HTML_HEAD_EXTRA : <meta name="description" content="Phundrak's dotfiles" />
#+HTML_HEAD_EXTRA : <meta property="og:title" content="Phundrak's dotfiles" />
#+HTML_HEAD_EXTRA : <meta property="og:description" content="Description of the dotfiles of Phundrak" />
2019-09-26 14:50:39 +00:00
* Table of Contents :TOC_4_gh:noexport:
2019-10-21 08:05:15 +00:00
:PROPERTIES:
:CUSTOM_ID: h-400070eb-725f-4416-a4c6-da3053df750b
:END:
2019-09-26 14:50:39 +00:00
- [[#presentation ][Presentation ]]
2019-10-21 11:11:08 +00:00
- [[#screenshots ][Screenshots ]]
2019-09-26 14:50:39 +00:00
- [[#features ][Features ]]
2019-10-26 08:59:32 +00:00
- [[#custom-scripts-in-path ][Custom scripts in =PATH= ]]
2020-01-14 22:07:37 +00:00
- [[#emacs-configuration ][Emacs configuration ]]
2019-10-23 10:01:19 +00:00
- [[#email-signature ][Email signature ]]
2019-10-26 08:59:32 +00:00
- [[#fish-configuration-with-useful-abbreviations ][Fish configuration with useful abbreviations ]]
2019-11-30 18:45:41 +00:00
- [[#global-gitignore ][Global gitignore ]]
2020-01-14 22:07:37 +00:00
- [[#i3-configuration ][i3 configuration ]]
2019-10-26 08:59:32 +00:00
- [[#nano ][Nano ]]
- [[#configuration ][Configuration ]]
- [[#included-configuration-file ][Included configuration file ]]
2019-10-23 10:01:19 +00:00
- [[#rustfmt ][Rustfmt ]]
2019-10-26 08:59:32 +00:00
- [[#tmux-configuration ][Tmux configuration ]]
2019-10-21 11:06:10 +00:00
- [[#xresources ][Xresources ]]
2019-09-26 14:50:39 +00:00
- [[#dependencies ][Dependencies ]]
- [[#installation ][Installation ]]
- [[#licence ][Licence ]]
2019-07-21 01:52:29 +00:00
2019-09-21 15:18:38 +00:00
* Presentation
2019-10-21 08:05:15 +00:00
:PROPERTIES:
:CUSTOM_ID: h-536e69f5-c012-4b7d-8a45-3a340d3bc7ee
:END:
2019-09-26 14:50:39 +00:00
[[http://spacemacs.org ][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg ]]
2019-09-21 15:18:38 +00:00
This is my collection of dotfiles for my daily GNU/Linux environment, tweaked
to my liking. If you wish to get the same setup as mine, follow the
instructions below.
As you can see, I personally use [[https://fishshell.com/ ][fish ]] as my shell of choice, and [[https://www.gnu.org/software/emacs/ ][Emacs ]] using
[[http://spacemacs.org ][Spacemacs ]] (still with Emacs keybinding) as my main text editor.
I also use [[https://github.com/resloved/i3 ][Resloved ]]’ s [[https://github.com/resloved/i3 ][fork ]] of [[https://github.com/Airblader/i3 ][i3-gaps ]] with two [[https://github.com/jaagr/polybar ][polybar ]] bars and [[https://github.com/tryone144 ][Tryone144 ]]’ s
[[https://github.com/tryone144/compton ][fork ]] of [[https://github.com/chjj/compton ][Compton ]]. The colors scheme for [[https://github.com/davatorium/rofi ][rofi ]], Emacs and polybar are chosen from
the wallpapers using [[https://github.com/dylanaraps/pywal ][pywal ]].
2019-10-21 11:11:08 +00:00
* Screenshots
:PROPERTIES:
:CUSTOM_ID: h-ee37502b-09a4-4668-88e2-1d4406252bd2
:END:
#+ATTR_HTML: :width 100%
#+CAPTION: Desktop with Neofetch in the terminal
[[./img/neofetch.png ]]
#+CAPTION: Desktop with Emacs opened
#+ATTR_HTML: :width 100%
[[./img/emacs.png ]]
#+CAPTION: Desktop with Rofi
#+ATTR_HTML: :width 100%
[[./img/rofi.png ]]
2019-09-21 15:18:38 +00:00
* Features
2019-10-21 08:05:15 +00:00
:PROPERTIES:
:CUSTOM_ID: h-8539dd6f-4fcb-4dc7-a3ef-b8ad198c91d4
:END:
2019-09-21 15:18:38 +00:00
- Emacs configuration perfectly tailored for my own use
- Beautiful and comfy i3 and polybar configuration
- And enough information below to get basically the same distro install as I
have on my main computer and my travel laptop.
2019-10-21 11:06:10 +00:00
Most of the org files you will find in this repos are the actual source code
2020-01-15 11:38:29 +00:00
of much of my config files. For instance, the bootstrap found in
[[file:installation.org ][installation.org ]] exports almost all of its code snippets to
[[file:.config/yadm/bootstrap ][.config/yadm/bootstrap ]] thanks to =M-x org-babel-tangle= from within Emacs.
Below I will also present and comment some of my short config files which do
not deserve to have a full org file dedicated to them.
2019-10-21 11:06:10 +00:00
2019-10-26 08:59:32 +00:00
** Custom scripts in =PATH=
:PROPERTIES:
:CUSTOM_ID: h-d582e107-fa66-4f79-869e-2b49116ed1ec
:END:
I have written some scripts that help me daily accomplish some simple tasks,
like mounting and unmounting a drive or Android device, an emoji picker, a
utility to set up my Wacom tablet, and so on. You can find them stored in
2020-01-14 22:07:37 +00:00
[[file:.local/bin/README.org ][.local/bin ]] along with their detailed explanation in the README placed in the
2019-10-26 08:59:32 +00:00
same folder —which is actually their source code once the org-mode file gets
tangled.
2020-01-14 22:07:37 +00:00
** Emacs configuration
:PROPERTIES:
:CUSTOM_ID: h-f6d2561f-5c02-4540-8287-4acf3037b3d5
:END:
Emacs is my main text editor, which I use for almost everything. Because, you
know…
#+begin_quote
Emacs is a great operating system, it just lacks a good text editor.
#+end_quote
2020-01-15 11:38:29 +00:00
You can find my Emacs config, based on Spacemacs, in my [[https://labs.phundrak.com/phundrak/dotfiles/src/branch/master/.spacemacs ][.spacemacs ]] file, and
2020-01-14 22:07:37 +00:00
my user configuration in my [[file:spacemacs.org ][spacemacs.org ]] file.
2019-10-23 10:01:19 +00:00
** Email signature
:PROPERTIES:
:CUSTOM_ID: h-f6c48286-a320-493f-b330-ee0a697e6d79
:HEADER-ARGS: :tangle ~/.signature
:END:
This file gets inserted automatically at the end of my emails.
#+BEGIN_SRC text
Lucien “Phundrak” Cartier-Tilet
2019-11-23 17:31:56 +00:00
https://phundrak.com (Français)
https://en.phundrak.com (English)
2019-10-23 10:01:19 +00:00
Pensez à notre planète, avez-vous vraiment besoin d’ imprimer ce courriel ?
Please mind our planet, do you really need to print this email?
#+END_SRC
2019-10-26 08:59:32 +00:00
** Fish configuration with useful abbreviations
:PROPERTIES:
:CUSTOM_ID: h-f35ed9a3-c9fc-458c-8a62-693f679f6992
:END:
2020-01-14 22:07:37 +00:00
You can also find in [[file:.config/fish/README.org ][.config/fish ]] my Fish shell configuration, which contains
2019-11-30 18:45:41 +00:00
my usual abbreviations.
** Global gitignore
:PROPERTIES:
:CUSTOM_ID: h-4f92eb29-7cfa-48ec-b39d-39037ace3682
:HEADER-ARGS: :tangle ~/.gitignore_global
:END:
Sometimes, there are some lines that always reappear in gitignores. So,
instead of always adding them, let git now that some elements are to be
ignored by default, hence the [[file:.gitignore_global ][~/.gitignore_global ]] file. First, we don’ t want
nano’ s backup files.
#+BEGIN_SRC text
~*
#+END_SRC
And output binaries generated by =gcc= and the likes aren’ t welcome either.
#+BEGIN_SRC text
,*.out
#+END_SRC
2019-10-26 08:59:32 +00:00
2020-01-14 22:07:37 +00:00
** i3 configuration
:PROPERTIES:
:CUSTOM_ID: h-c918e370-d867-412c-8b0e-078e4e3772e0
:END:
The i3 configuration is detailed in its corresponding README which you can
find at [[file:.config/i3/README.org ][.config/i3/README.org ]].
2019-10-26 08:59:32 +00:00
** Nano
:PROPERTIES:
:CUSTOM_ID: h-1724166b-55b7-4a64-9ff1-47c2a9e76f46
:HEADER-ARGS: :tangle ~/.nanorc
:END:
Although it is a very simple piece of software, nano does offer some
customization. Here is mine.
*** Configuration
:PROPERTIES:
:CUSTOM_ID: h-76aa0ff6-9e6a-4a35-974f-9132b08c8eb4
:END:
When soft line wrapping is enabled, make it wrap lines at blank characters
(tabs and spaces) instead of always at the edge of the screen.
#+BEGIN_SRC conf
set atblanks
#+END_SRC
Automatically indent a newly created line to the same number of tabs and/or
spaces as the previous line (or as the next line if the previous line is the
beginning of a paragraph).
#+BEGIN_SRC conf
set autoindent
#+END_SRC
When saving a file, create a backup file by adding a tilde (=~= ) to the
file's name. And make and keep not just one backup file, but make and keep a
uniquely numbered one every time a file is saved — when backups are enabled
with =set backup= or =--backup= or =-B= . The uniquely numbered files are
stored in the directory =~/.cache/nano/backups/= .
#+BEGIN_SRC conf
set backup
set backupdir /home/phundrak/ .cache/nano/backups/
#+END_SRC
Use bold instead of reverse video for the title bar, status bar, key combos,
function tags, line numbers, and selected text. This can be overridden by
setting the options =titlecolor= , =statuscolor= , =keycolor= ,
=functioncolor= , =numbercolor= , and =selectedcolor= .
#+BEGIN_SRC conf
set boldtext
#+END_SRC
Do case-unsensitive searches by default.
#+BEGIN_SRC conf
unset casesensitive
#+END_SRC
Constantly display the cursor position in the status bar. This overrides the
option =quickblank= .
#+BEGIN_SRC conf
set constantshow
#+END_SRC
Display line numbers to the left of the text area.
#+BEGIN_SRC conf
set linenumbers
#+END_SRC
Do regular-expression searches by default. Regular expressions in =nano= are
of the extended type (ERE).
#+BEGIN_SRC conf
set regexp
#+END_SRC
Make the Home key smarter. When Home is pressed anywhere but at the very
beginning of non-whitespace characters on a line, the cursor will jump to
that beginning (either forwards or backwards). If the cursor is already at
that position, it will jump to the true beginning of the line.
#+BEGIN_SRC conf
set smarthome
#+END_SRC
Enable soft line wrapping for easier viewing of very long lines.
#+BEGIN_SRC conf
set softwrap
#+END_SRC
Use a tab size of a certain amount of columns. The value of number must be
greater than 0. The default value is 8.
#+BEGIN_SRC conf
set tabsize 2
#+END_SRC
Convert typed tabs to spaces. Sue me.
#+BEGIN_SRC conf
set tabstospaces
#+END_SRC
Remove trailing whitespace from wrapped lines when automatic hard-wrapping
occurs or when text is justified.
#+BEGIN_SRC conf
set trimblanks
#+END_SRC
Save a file by default in Unix format. This overrides nano's default
behavior of saving a file in the format that it had. (This option has no
effect when you also use =set noconvert= .)
#+BEGIN_SRC conf
set unix
#+END_SRC
*** Included configuration file
:PROPERTIES:
:CUSTOM_ID: h-491cba80-5fa9-4b75-a9cb-2865ec39440a
:END:
Nano gives the opportunity to include some files located elsewhere. This is
why I added [[https://github.com/scopatz/nanorc ][this repo ]] as a submodule of my dotfiles so I can access a lot of
them at the same time. Since the submodule is cloned in =~/.config/nanorc= ,
we can add only one line to include all of the =.nanorc= files.
#+BEGIN_SRC conf
include ~/.config/nanorc/ *.nanorc
#+END_SRC
2019-10-23 10:01:19 +00:00
** Rustfmt
:PROPERTIES:
:CUSTOM_ID: h-0ae9005c-76a6-49f6-947c-0c8464616e10
:HEADER-ARGS: :tangle ~/.rustfmt.toml
:END:
In my [[file:.rustfmt.toml ][.rustfmt.toml ]], you can find some custom rules on how my Rust code
should be formatted.
First, we are using the 2018 edition of Rust.
#+BEGIN_SRC toml
edition = "2018"
#+END_SRC
The maximum length of enum variant having discriminant, that gets vertically
aligned with others. Variants without discriminants would be ignored for the
purpose of alignment.
Note that this is not how much whitespace is inserted, but instead the
longest variant name that doesn't get ignored when aligning.
#+BEGIN_SRC toml
enum_discrim_align_threshold = 20
#+END_SRC
Put single-expression functions on a single line.
#+BEGIN_SRC toml
fn_single_line = true
#+END_SRC
Format code snippet included in doc comments.
#+BEGIN_SRC toml
format_code_in_doc_comments = true
#+END_SRC
Format string literals where necessary.
#+BEGIN_SRC toml
format_strings = true
#+END_SRC
Use tab characters for indentation, spaces for alignment.
#+BEGIN_SRC toml
hard_tabs = true
#+END_SRC
Maximum width of each line
#+BEGIN_SRC toml
max_width = 80
#+END_SRC
Merge multiple imports into a single nested import.
#+BEGIN_SRC toml
merge_imports = true
#+END_SRC
My newline style will always be Unix.
#+BEGIN_SRC toml
newline_style = Unix
#+END_SRC
Convert =/* */= comments to =//= comments where possible.
#+BEGIN_SRC toml
normalize_comments = true
#+END_SRC
Convert =#![doc]= and =#[doc]= attributes to =//!= and =///= doc comments.
#+BEGIN_SRC toml
normalize_doc_attributes = true
#+END_SRC
Reorder impl items. =type= and =const= are put first, then macros and
methods.
#+BEGIN_SRC toml
reorder_impl_items = true
#+END_SRC
Report =FIXME= items in comments.
#+BEGIN_SRC toml
report_fixme = "Always"
#+END_SRC
Report =TODO= items in comments.
#+BEGIN_SRC toml
todo = "Always"
#+END_SRC
The maximum diff of width between struct fields to be aligned with each
other.
#+BEGIN_SRC toml
struct_field_align_threshold = 20
#+END_SRC
Number of spaces per tab.
#+BEGIN_SRC toml
tab_spaces = 2
#+END_SRC
Break comments to fit on the line.
#+BEGIN_SRC toml
wrap_comments = true
#+END_SRC
2019-10-26 08:59:32 +00:00
** Tmux configuration
:PROPERTIES:
:CUSTOM_ID: h-4f48b912-b67b-4549-a671-802e76221f46
:END:
You can find my tmux configuration in [[file:tmux.org ][tmux.org ]]. It depends on the submodule
[[https://github.com/gpakosz/.tmux.git ][.tmux ]] by [[https://pempek.net/ ][Gregory Pakosz ]].
2019-10-21 11:06:10 +00:00
** Xresources
:PROPERTIES:
:CUSTOM_ID: h-e6f48975-3b86-4a75-a7e5-5cc9edbd9869
2019-10-23 10:01:19 +00:00
:HEADER-ARGS: :tangle ~/.Xresources :exports code
2019-10-21 11:06:10 +00:00
:END:
My Xresources file is very short. Indeed, it only contains two lines which
are dedicated to my =st= terminal to set its font and shell. The font is set
as follows.
#+BEGIN_SRC conf
st.font: Source Code Pro for Powerline:style=book
#+END_SRC
And I will set my shell like this:
#+BEGIN_SRC conf
st.shell: /usr/bin/fish
#+END_SRC
I used to have lines dedicated to UXTerm and URxvt, but I cast them out of my
system.
2019-09-21 15:18:38 +00:00
* Dependencies
2019-10-21 08:05:15 +00:00
:PROPERTIES:
:CUSTOM_ID: h-5849dbcf-a650-4323-9a90-bec549a7b982
:END:
2019-09-21 15:18:38 +00:00
Of course, some dependencies are needed for my dotfiles to work well. Here is
a non-exhaustive list of software needed by these configuration files:
- [[https://www.gnu.org/software/emacs/ ][GNU/Emacs ]] >= 26.2
- [[http://spacemacs.org ][Spacemacs ]] (develop branch)
2019-11-23 17:31:56 +00:00
- My [[https://labs.phundrak.com/phundrak/conlang-layer ][conlanging layer ]]
2019-09-21 15:18:38 +00:00
- [[https://github.com/venmos/w3m-layer ][Venmos ]]’ [[https://github.com/venmos/w3m-layer ][w3m layer ]]
- The [[https://fishshell.com/ ][Fish shell ]], using [[https://github.com/jorgebucaran/fisher ][fisher ]]
- [[https://lukesmith.xyz/ ][Luke Smith ]]’ s [[https://github.com/LukeSmithxyz/st ][fork ]] of [[https://st.suckless.org/ ][st ]]
- [[https://resloved.info/ ][Resloved ]]’ s [[https://github.com/resloved/i3 ][i3-gaps-rounded ]] fork of [[https://github.com/Airblader/i3 ][Airblader ]]’ s [[https://github.com/Airblader/i3 ][i3-gaps ]], itself a fork of [[https://i3wm.org/ ][i3 ]]
- [[https://github.com/yshui/compton ][Compton ]], more specificaly [[https://github.com/tryone144/compton ][Tryone ]]’ s [[https://github.com/tryone144/compton ][fork ]]
- [[https://github.com/dylanaraps/pywal/ ][pywal ]]
- [[https://tools.suckless.org/dmenu/ ][dmenu ]]
- [[https://github.com/enkore/j4-dmenu-desktop ][j4-dmenu-desktop ]]
- [[https://github.com/davatorium/rofi ][Rofi ]]
- [[https://github.com/gpoore/minted ][minted ]]
- [[https://www.rust-lang.org/ ][Rust ]] (stable and nightly)
- [[https://www.latex-project.org/ ][LaTeX ]] and [[http://xetex.sourceforge.net/ ][XeTeX ]] (=texlive= packages on Arch Linux)
- [[https://github.com/tmux/tmux ][tmux ]], based on [[https://github.com/gpakosz/.tmux ][this repo ]]’ s configuration by [[https://pempek.net/ ][Grégory Pakosz ]].
- And a bunch of other stuff, see below
And some other stuff scattered around in my dotfiles.
BTW, I use Arch.
* Installation
2019-10-21 08:05:15 +00:00
:PROPERTIES:
:CUSTOM_ID: h-bfb2e09b-d5d7-4d6f-8b29-763c49b3fd09
:END:
2020-01-14 22:07:37 +00:00
For an installation walkthrough of my Arch Linux installation, check out my
[[file:installation.org ][installation.org ]] file where I walk you through the first manual steps and
through the bootstrap you can execute to automatically take care of a lot of
elements.
2019-07-21 01:52:29 +00:00
2019-09-21 15:18:38 +00:00
* Licence
2019-10-21 08:05:15 +00:00
:PROPERTIES:
:CUSTOM_ID: h-a3438126-ee60-4f11-a2f6-f52e49dade59
:END:
2019-09-21 15:18:38 +00:00
All of my dotfiles (and my dotfiles only) are available under the GNU GPLv3
Licence. Please consult [[file:LICENCE.md ]] for more information. In short: you
are free to access, edit and redistribute all of my dotfiles under the same
licence and as allowed by the licence, and if you fuck up something, it’ s your
own responsibility.