Dotfiles Repository 🐧
This code was provided by ;
- originally by user StreakyCobra in an Hacker News thread
- In a wonderful tutorial by Nicola Paolucci Thank you guys for sharing ❤️
- Tests by Shunit2
Sumary
- Requirements
- Install
- Pull state from remote after installation
- Update my dotfiles after installation
- Uninstalling
- Dependencies(check your pkgs)
- Keybindings
- Scripts
- Problems
- Feedback
- Thanks
Using git to manage config files.
Main config
- Tested in Gnu/Linux based distro(Debian based, pls check first).
- Pls check
~/.i3/autostart/i3config
. There's change in keyboard layout and resolution. - The keyboard layout is US-INT.
Mingw32(git-for-windows) config(mingw32-w8 branch)
- Config files for Gnu/Linux based distro systems(git-bash.exe).
- Remove scripts for programs for linux systems.
- Remove .config/ folder and some configurations.
- The keyboard layout is PT-BR,ABNT.
ATTENTION: Please, DO NOT copy/run any file here in your system if you do not fully understand what it does. Seriously, DON'T do it! This configuration works with i3-wm and i3status.
TODO
- Make scripts to generate configs(i3blocks, vim, etc)
- Add new tests
Requirements
- Git
- Ssh
- Curl
How to install
This method consist to use git to track your config files. You don't have to install extra tool, only need git, ssh(coreutils) and curl. Install config tracking in your $HOME following the command;
-
Fork this repository.
-
Edit
~/bin/dotfiles_env
file to put your repository url, branch name, email and name. -
Update your remote forked repository (push changes) and execute script bellow ( check your username ).
If Desktop/Virtual/Notebooks, copy/paste in terminal;
bash -c "$(curl -s --max-time 15 https://raw.githubusercontent.com/[YOUR_USER_NAME]/dotfiles/main/bin/install)";
If Desktop/Virtual/Notebooks, copy/paste in terminal(DEFAULT);
bash -c "$(curl -s --max-time 15 https://raw.githubusercontent.com/brnfra/dotfiles/main/bin/install)";
If testing, copy/paste in terminal(DEFAULT);
bash -c "$(curl -s --max-time 15 https://raw.githubusercontent.com/brnfra/dotfiles/testing/bin/install)";
If Mingw for Windows, copy/paste in terminal;
bash -c "$(curl -s --max-time 15 https://raw.githubusercontent.com/[YOUR_USER_NAME]/dotfiles/mingw32-w8/bin/install-mingw-cfg)"; bash ~/bin/install_enviroment
-
Check the script
~/bin/dotfiles_env
and change username, email and the places where script will save your files. Configure your definitions before run it. -
Read and edit it first for your purpose, it will create some folders and copy config files, recomend fork/clone this repo and coment that line.
-
You can change branch in home, after install, run
$ config checkout testing
, for example.
Attention on ssh-key problems, just in case, check your email and user, you find help here.
Update remote state from local to remote
If I change configuration and like it, How can I update for this change?
- You can update your remote repository and, after tests, run the script below.
- Clone this repo in another local.(here the default is
~/documents/projects/git/
) - Change to the correspondent branch by
git switch [main or mingw32-w8]
- Make the changes and push to remote repo in correspondent branch.
- In the computers run pull script and receive the updates.(wait a minute in the same computer to update HEAD)
Run $ push_local_config "COMMIT MESSAGE"
gonna make copy my edited config files to
dotfiles folder created in enviroment script
and push to your remote repository[auto].
- Will push only if tests are passed.
Run $ stage-local-config
gonna only make copy, without push, the edited config files to
dotfiles folder. Now check the status and, if it's fine, next, proceed to push changes[manual].
- No tests here.
$ git push origin [main/testing/mingw32-w8]
Now, Git gonna update snapshot from local to remote. Your other machines just run pull_config(or add in init) to get it.
Pull state from remote to local config
After install, if remote has changed you can pull config to sync local, How can I sync local for this change?
- You can pull to your local repository run the script below.
In the folder ~/bin
there is a script named pull_config
such make a "pull request" like a normal git repo.
Just run;
$ pull_config
or
$ bash ~/bin/pull_config
Now, Git gonna update snapshot (pull)from remote repo to your $HOME folder.
Uninstall and back config
Run in terminal
$ uninstall_bare_cfg
# or
$ bash ~/bin/uninstall_bare_cfg
Dependencies
Some pkgs here have conflicts with i3-gaps(i3-wm) and, after fork, make changes to yours needs. For some features depends some packages, if get some error related, this list maybe help;
- acpi (temperatures and battery)
- alsautils or pulseaudio(ubuntu)
- compton (composer)
- curl
- diodon (tool to show transfer area icon)
- exa
- fdfind
- ffmpeg
- fzf
- ghostscript (pdf language previewer)
- git
- gsimplecal (tiny calendar i3blocks)
- i3blocks
- imagemagick
- jq (Comand line JSON processor)
- nc (TCP and UDP listen)
- nitrogen (wallpaper)
- nm-applet (show network icon)
- openssl
- rsync
- scrot (print screen)
- shunit2 (tests)
- ssh
- sysstat (cpu info)
- vim
- xfce4-terminal
Keybindings
I3 window manager
Key | Details |
---|---|
Mod + d | fzf D-menu to find applications |
Mod + Esc | Exit menu(shutdown, restart, logout) |
Mod + e | Exit menu(logout) |
Mod + Enter | Open Xfce4 terminal |
Mod + Ctrl + l | Resize window |
Mod + Ctrl + b | Put window in last workspace |
Mod + Ctrl + [1-9] | Put window in workspace #number without go to workspace |
Mod + Shift + [1-9] | Put window in workspace #number and go to workspace |
Mod + [1-9] | Go to workspace #number |
Mod + Tab | Toggle workspaces |
Mod + Arrows | Workspace focus direction |
Mod + [yjui] | Workspace focus direction |
Mod + Shift + Arrows | Workspace move direction |
Mod + Shift + [yjui] | Workspace move direction |
Mod + Shift + f | Toggle fullscreen |
Mod + Shift + s | Layout stacking |
Mod + Shift + t | Layout tabbed |
Mod + Shift + e | Layout toggle |
Mod + v | Split window direction(horizontally) |
Mod + h | Split window direction(vertically) |
Mod + x | Split window mode toggle |
Mod + f | Window floating toggle |
Mod + Space | Focus mode toggle |
Mod + a | Focus parent |
Ctrl + 1 | Open firefox |
Ctrl + 0 | Open i3 config(vim) |
Xfce4 Terminal
Key | Details |
---|---|
Ctrl + f | fzf find |
Ctrl + o | fzf open |
Ctrl + v | Neo vim |
Vim
Mode | Key | Details |
---|---|---|
Normal | Ctrl + q | quit |
Normal | Ctrl + Q | force quit |
Normal | Ctrl + s | save all |
Normal | Ctrl , c | copy selection to xclip |
Normal | 0 , v | reload vimrc |
Normal | = , v | reload vimrc and redraw |
Normal | F3 | toggle show nerdtree |
Normal | F4 | easy indent file |
Normal | F5 | toggle wrap |
Normal | F6 | set paste toggle |
Normal | F7 | toggle fold |
Normal | F8 | One line text( u to undo ) |
Normal | leader + f | create fold |
Normal | leader + d | delete blank spaces |
Normal | leader + D | delete blank lines |
Normal | leader + M | MAN entry |
Normal | leader + l | open terminal |
Normal | leader + / | split window open |
Normal | leader + - | split window open |
Normal | + + l | add line |
Normal | Ctrl + a | select all |
Normal | Ctrl + + | font size up |
Normal | Ctrl + - | font size down |
Normal | Ctrl + Arrows | switching window buffer(nerdtree too) |
Normal | Shift + Tab | tabs toggle r |
Normal | Tab | tabs toggle l |
Normal | U | redo |
Normal | Shift + up | move line up |
Normal | Shift + down | move line down |
Insert | leader + v | edit vimrc |
Insert | F3 | toggle show line numbers |
Insert | F4 | easy indent file |
Insert | F5 | toggle wrap |
Insert | F7 | toggle fold |
Insert | F8 | one line text( u to undo ) |
Insert | leader + f | create fold |
Insert | leader + / | close tags |
Insert | leader + M | MAN entry |
Insert | Ctrl + arrows | move fast |
Insert | Ctrl + d | duplicate block |
Insert | Ctrl + d | duplicate block |
Insert | Shift + up | move line up |
Insert | Shift + down | move line down |
Visual | Ctrl + up | move block up |
Visual | Ctrl + down | move block down |
Visual | Ctrl + d | duplicate block |
Scripts
Get some help before execute scripts [script-name] -h
.
Scripts List
Script Name | Description |
---|---|
audio_to_opus | Compact audio to opus format |
compress_img | Compress img |
config_check | Check if config is fine(make tests too) |
connection | Simple test to check connectivity |
date_fold | Fold files for date(name pattern required) |
extract | Extract compact files in current folder |
free_buffer | Clear swap and ram buffer |
i3-scrot | Print screen(nice with i3 key bindings) |
i3_config | Generate my i3 config files |
item_size | Show size(file/folder) |
namestd | Rename all files in folder(remove special chars) |
pdfstd | Compact and normalize pdf files(extra larges) |
pull_config | Get config from remote repo and update local config files. |
push_config | Push config files from local to remote repo. |
rm_linedup | Remove dupe lines in file |
targz | Compact file/folder |
type_fold | Fold files for type |
uninstall_bare_cfg | Uninstall this config and restore previous files |
videos_merge | Merge videos files in current folder |
videostd | Compact and normalize video files(extra larges) |
Problems
If you get the error message
:fatal: destination path '/home/$USER/.dotfiles' already exists and is not an empty directory.
after install or trying update your local configs, try this;
-
Delete, in your home folder,
~/.dotfiles/
. -
Re-run the command curl for install again.
For other problems, again, check your name and email in install_enviroment or comment.
[FAIL] Config pull error: Conflict.
- Resolve the conflict : ``config pull origin testing --rebase```
config status
to check files in conflit. Edit file and add new file to resolve.config add [file]
,config commit -m "[message]"
config rebase --continue
Feedback
Suggestions/improvements welcome!
Author
Bruno Franco |
Thanks to
- Nicola Paolucci make your own bare repo dotfiles tutorial
- @StreakyCobra Hacker News threat
- Mathias Bynens and his dotfiles repository
- Ben Alman and his dotfiles repository
- Luke Smith and his dotfiles repository
- Le Wagon dotfiles
- Cătălin Mariș and his dotfiles repository
- Gianni Chiappetta for sharing his amazing collection of dotfiles
- Jan Moesen and his ancient
.bash_profile
+ shiny tilde repository - Lauri ‘Lri’ Ranta for sharing loads of hidden preferences
- Matijs Brinkhuis and his dotfiles repository
- Nicolas Gallagher and his dotfiles repository
- Sindre Sorhus
- Tom Ryder and his dotfiles repository
- Haralan Dobrev
- For anyone that a make a copy and don't make a mension, tell me and I'll give the credit, my thank you.
License
The MIT License (MIT)