/dotfiles

Tracking your dotfiles with Git tool. A bare repo aproach. Contains config files for GNU/linux system(i3wm).

Primary LanguageShellMIT LicenseMIT

Dotfiles Repository 🐧


This code was provided by ;


Sumary

Using git to manage config files.

Main config

  1. Tested in Gnu/Linux based distro(Debian based, pls check first).
  2. Pls check ~/.i3/autostart/i3config . There's change in keyboard layout and resolution.
  3. The keyboard layout is US-INT.

Mingw32(git-for-windows) config(mingw32-w8 branch)

  1. Config files for Gnu/Linux based distro systems(git-bash.exe).
  2. Remove scripts for programs for linux systems.
  3. Remove .config/ folder and some configurations.
  4. 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;

  1. Fork this repository.

  2. Edit ~/bin/dotfiles_env file to put your repository url, branch name, email and name.

  3. 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.
  1. Clone this repo in another local.(here the default is ~/documents/projects/git/ )
  2. Change to the correspondent branch by git switch [main or mingw32-w8]
  3. Make the changes and push to remote repo in correspondent branch.
  4. 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;

  1. Delete, in your home folder, ~/.dotfiles/ .

  2. 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.
  1. Resolve the conflict : ``config pull origin testing --rebase```
  2. config status to check files in conflit. Edit file and add new file to resolve.
  3. config add [file], config commit -m "[message]"
  4. config rebase --continue

Feedback

Suggestions/improvements welcome!

Author

Bruno Franco

Thanks to

License

The MIT License (MIT)

Back to Top