Skip to content

Commit 0f0822c

Browse files
committed
refactor(installer): improve installation script and prune unused tools
0 parents  commit 0f0822c

File tree

164 files changed

+10636
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+10636
-0
lines changed

.editorconfig

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
tab_width = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[{.gitconfig,*.gitconfig,.gitconfig.*,.gitmodules,*.gitmodules}]
13+
indent_style = tab
14+
15+
[*.{java,gradle,xml}]
16+
indent_size = 4
17+
continuation_indent_size = 8
18+
19+
[*.py]
20+
indent_size = 4
21+
max_line_length = 120
22+
23+
[{go.mod,go.sum,*.go}]
24+
indent_style = tab
25+
indent_size = 4
26+
27+
[*.php]
28+
indent_size = 4
29+
30+
[*.js]
31+
block_comment_start = /**
32+
block_comment = *
33+
block_comment_end = */
34+
35+
[*.min.js]
36+
indent_style = ignore
37+
insert_final_newline = ignore
38+
39+
[{Makefile,*.mk}]
40+
indent_style = tab
41+
42+
[*.{cmd,bat}]
43+
indent_style = tab
44+
end_of_line = crlf
45+
46+
[*.{json,json5}]
47+
insert_final_newline = ignore
48+
49+
[*.md]
50+
trim_trailing_whitespace = false

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @borjapazr

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
static-analysis:
11+
name: 💿 Static analysis
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: ⬇️ Checkout project
16+
uses: actions/checkout@v4
17+
18+
- name: ⚪️ Set needed environment variables
19+
run: |
20+
echo "DOTFILES_PATH=$PWD" >> $GITHUB_ENV
21+
22+
- name: 👀 Static analysis
23+
run: bash scripts/self/static_analysis
24+
25+
lint:
26+
name: 💅 Lint
27+
runs-on: ubuntu-latest
28+
needs: static-analysis
29+
30+
steps:
31+
- name: ⬇️ Checkout project
32+
uses: actions/checkout@v4
33+
34+
- name: 🐿️ Setup go version
35+
uses: actions/setup-go@v5
36+
with:
37+
go-version: "^1.16.1"
38+
39+
- name: ⚪️ Set needed environment variables
40+
run: |
41+
echo "DOTFILES_PATH=$PWD" >> $GITHUB_ENV
42+
echo "PATH=$PATH:$HOME/go/bin" >> $GITHUB_ENV
43+
44+
- name: 📥 Install shfmt
45+
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
46+
47+
- name: 💅 Lint bash files
48+
run: bash scripts/self/lint

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Zim Shell Framework
2+
shell/zsh/.zim
3+
4+
# Compiled ZSH
5+
shell/zsh/**/**.zwc
6+
shell/zsh/**/**.zwc.old
7+
8+
# Private Stuff
9+
/**/**/private-*
10+
11+
# External bin
12+
bin/external/*
13+
!bin/external/.gitkeep
14+
15+
# Brew
16+
Brewfile.lock.json
17+
18+
# VSCode
19+
.vscode

.gitmodules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[submodule "modules/dotbot"]
2+
path = modules/dotbot
3+
url = https://github.com/anishathalye/dotbot
4+
5+
[submodule "modules/private"]
6+
path = modules/private
7+
url = git@github.com:borjapazr/dotfiles-private.git

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Borja Paz Rodríguez borjapazr@gmail.com
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<div align="center">
2+
<img
3+
width="500"
4+
alt=".dotfiles"
5+
src="https://i.imgur.com/SzBeVhB.png">
6+
<br>
7+
<br>
8+
9+
![GitHub CI Workflow Status](https://img.shields.io/github/actions/workflow/status/borjapazr/dotfiles/ci.yml?style=flat-square&logo=github&label=CI)
10+
11+
<h4>
12+
💻🚀 Custom dotfiles for UNIX based systems
13+
</h4>
14+
15+
<a href="#ℹ️-about">ℹ️ About</a> •
16+
<a href="#-installation">📥 Installation</a> •
17+
<a href="#-features">📋 Features</a> •
18+
<a href="#-contributing">👥 Contributing</a> •
19+
<a href="#-credits">🎯 Credits</a> •
20+
<a href="#-license">🚩 License</a>
21+
22+
</div>
23+
24+
---
25+
26+
## ℹ️ About
27+
28+
Personal .dotfiles for quick configuration of my UNIX-based devices. They are tailored to my needs and do not claim to be the right solution for ideal .dotfiles.
29+
30+
> 💡 As a starting point to get all your configuration files and scripts organised I recommend you to use [dotly](https://github.com/CodelyTV/dotly), which is a project that describes itself as a simple and fast dotfiles framework.
31+
32+
## 📥 Installation
33+
34+
Using `wget`:
35+
36+
```bash
37+
bash <(wget -qO- https://raw.githubusercontent.com/borjapazr/dotfiles/HEAD/installer)
38+
```
39+
40+
Or using `curl`:
41+
42+
```bash
43+
bash <(curl -s https://raw.githubusercontent.com/borjapazr/dotfiles/HEAD/installer)
44+
```
45+
46+
### 🧸 Configuration
47+
48+
Read [this](doc/installation-guide.md) page.
49+
50+
## 📋 Features
51+
52+
### ⚒️ Built with
53+
54+
- [Oh My Zsh](https://ohmyz.sh/) Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout...
55+
- [fzf](https://github.com/junegunn/fzf) A general-purpose command-line fuzzy finder.
56+
- [dotbot](https://github.com/anishathalye/dotbot) Dotbot is a tool that bootstraps your dotfiles (it's a [Dot]files [bo]o[t]strapper, get it?). It does less than you think, because version control systems do more than you think.
57+
58+
### 🌚 The `dot` command
59+
60+
`dot` is the core command my .dotfiles. If you execute it, you'll see all your scripts.
61+
62+
```bash
63+
[mars] ~ dot -h
64+
Usage:
65+
dot
66+
dot <context>
67+
dot <context> <script> [<args>...]
68+
dot -h | --help
69+
dot -p | --print
70+
```
71+
72+
## 👥 Contributing
73+
74+
Just fork and open a pull request. All contributions are welcome 🤗
75+
76+
## 🎯 Credits
77+
78+
These .dotfiles are largely based on [@rgomezcasas](https://github.com/rgomezcasas) [personal .dotfiles](https://github.com/rgomezcasas/dotfiles) and the [dotly](https://github.com/CodelyTV/dotly) framework. They have been adapted to suit my personal needs.
79+
80+
🙏 Thank you very much for these wonderful creations.
81+
82+
### ⭐ Stargazers
83+
84+
[![Stargazers repo roster for @borjapazr/dotfiles](https://reporoster.com/stars/borjapazr/dotfiles)](https://github.com/borjapazr/dotfiles/stargazers)
85+
86+
## 🚩 License
87+
88+
MIT @ [borjapazr](https://me.marsmachine.space). Please see [License](LICENSE) for more information.

bin/$

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
# Useful when you c&p commands from the internet :P
4+
5+
"$@"

bin/dot

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
3+
set -o pipefail
4+
5+
source "$DOTFILES_PATH/scripts/core/_main.sh"
6+
7+
##? Usage:
8+
##? dot
9+
##? dot <context>
10+
##? dot <context> <script> [<args>...]
11+
##? dot -h | --help
12+
##? dot -p | --print
13+
14+
while :; do
15+
case "${1-}" in
16+
-h | --help) docs::parse "$@" ;;
17+
-p | --print) PRINT=true ;;
18+
*) break ;;
19+
esac
20+
shift
21+
done
22+
23+
fzf_prompt() {
24+
local paths="$1"
25+
26+
script="$(
27+
echo "$paths" |
28+
xargs -I % sh -c 'echo "$(basename $(dirname %)) $(basename %)"' 2>&1 |
29+
fzf \
30+
--height 50% \
31+
--preview '"$DOTFILES_PATH/bin/dot" $(echo {} | cut -d" " -f 1) $(echo {} | cut -d" " -f 2) -h'
32+
)"
33+
34+
if [ -n "$script" ]; then
35+
if [ "$PRINT" = true ]; then
36+
echo "dot $script"
37+
else
38+
printf "%s" "$script"
39+
read -r args
40+
"$DOTFILES_PATH/bin/dot" $script $args
41+
fi
42+
fi
43+
}
44+
45+
if args::has_no_args "$@"; then
46+
fzf_prompt "$(dot::list_scripts_path)"
47+
elif args::total_is 1 "$@"; then
48+
fzf_prompt "$(dot::list_scripts_path | grep "/$1/")"
49+
else
50+
context="$1"
51+
script="$2"
52+
53+
shift 2
54+
55+
if ! dot::script_exists "$DOTFILES_PATH" "$context" "$script"; then
56+
log::error "The script <$context / $script> doesn't exist"
57+
exit 1
58+
fi
59+
60+
"${DOTFILES_PATH}/scripts/${context}/${script}" "$@"
61+
fi

bin/pbcopy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -o pipefail
4+
5+
source "$DOTFILES_PATH/scripts/core/_main.sh"
6+
7+
if platform::is_macos; then
8+
/usr/bin/pbcopy
9+
elif platform::is_linux; then
10+
xclip -selection clipboard
11+
fi

0 commit comments

Comments
 (0)