Skip to content

Commit 1acb454

Browse files
authored
Merge pull request #60 from AleixMT/release-v0.16.0
Release v0.16.0
2 parents 8ed596c + 91452a9 commit 1acb454

File tree

873 files changed

+24718
-5768
lines changed

Some content is hidden

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

873 files changed

+24718
-5768
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.svg filter=lfs diff=lfs merge=lfs -text
2+
*.png filter=lfs diff=lfs merge=lfs -text

.githooks/post-checkout

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.\n"; exit 2; }
3+
git lfs post-checkout "$@"

.githooks/post-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-commit.\n"; exit 2; }
3+
git lfs post-commit "$@"

.githooks/post-merge

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; }
3+
git lfs post-merge "$@"

.githooks/pre-commit

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
# https://stackoverflow.com/questions/30733415/how-to-determine-if-git-merge-is-in-process
3+
# We avoid commits only if we are not in merge state.
4+
if git merge HEAD >/dev/null 2>&1; then
5+
branch="$(git rev-parse --abbrev-ref HEAD)"
6+
if [ "${branch}" = "master" ]; then
7+
echo "Are you an idiot? committing directly to master branch is FORBIDDEN"
8+
exit 1
9+
elif [ "${branch}" = "develop" ]; then
10+
echo "Are you an idiot? committing directly to develop branch is FORBIDDEN"
11+
exit 1
12+
fi
13+
fi

.githooks/pre-push

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n"; exit 2; }
3+
git lfs pre-push "$@"

.github/logo.png

Lines changed: 3 additions & 0 deletions
Loading

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
# Linux swap files
1414
.swp
15+
*.swp
16+
*.swo
17+
*~
1518

1619
# Linux trash folder which might appear on any partition or disk
1720
.Trash-*
@@ -65,3 +68,7 @@ nohup.out
6568
wget-log
6669
*.ipynb
6770

71+
# Used by customizer in WSL2 to store the user name
72+
whoami
73+
74+
Linux-Auto-Customizer

.spelling_dictionary.dic

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ copyq
2323
precoded
2424
COMPREPLY
2525
tsend
26-
clockmoji
26+
clockmoji
27+
Dialup
28+
Geoscience
29+
fdupes
30+
Aleix

doc/CONTRIBUTING.md renamed to CONTRIBUTING.md

Lines changed: 108 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,41 @@ cd32379 UPDATED: A table of contents have been added to README.md (Axlfc)
107107
e40bfe3 FIXED: Bug in clonerepository installation type. There was an rm missing for avoiding collisions (AleixMT)
108108
```
109109

110+
## Git Large File-System support
111+
We are using git-lfs to track binary data on our repository like data from images which do not need to be indexed as
112+
a normal file in git. Instead, we use git-lfs, a utility to upload binary files to git in a more optimized way, so it
113+
does not conflict with our pull, push, checkout and clone speeds.
114+
115+
First you need to install git-lfs in your computer. You can use the customizer for this matter if you already have it installed:
116+
```
117+
sudo apt-get install -y git-lfs
118+
```
119+
or
120+
```
121+
sudo customizer-install -v -o git
122+
```
123+
124+
Then, every time you clone the repository, you need to navigate to the project folder and execute:
125+
```
126+
git-lfs install
127+
```
128+
You will see sentences similar to these:
129+
```
130+
Updated git hooks.
131+
Git LFS initialized.
132+
```
133+
134+
Now you can work transparently and uploading binary content. The rules for `git-lfs` to distinguish between indexable
135+
files (source code) and no-indexable files (binary data) are in the `.gitattributes` file in the root of the project.
136+
You can include rules there to mark as no-indexable file any type of files regarding its name (and extension). For example:
137+
```
138+
*.svg filter=lfs diff=lfs merge=lfs -text
139+
*.png filter=lfs diff=lfs merge=lfs -text
140+
```
141+
142+
Which are two rules that make all the files with `.svg` and `.png` extension trackable by git-lfs. These rules are already
143+
in the repository.
144+
110145
## Semantic versioning
111146

112147
We do use semantic versioning as defined in [here](https://semver.org/).
@@ -119,64 +154,100 @@ PATCH version when you make backwards compatible bug fixes.
119154
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
120155

121156

157+
## Git hooks
158+
Commits on develop branch and master branch are forbidden. Merge in develop and master branch hasve to be forcibly with the option --no-ff
159+
122160
# Business Rules
123161
These are a set of rules that are used to build the installation of each feature in the customizer environment to
124162
maximize the usability and fanciness of each of them and the different capabilities and subsystems available.
125163

126164
###### Environmental
127-
- [x] Both behaviors of the script use the file `~/.config/user-dirs.dirs` to set some language-independent environment variables (for example, to get an independent system-language path to the Desktop), so some functions of this script will fail if this file does not exist. The variables declared in this file that are used in the customizer are `XDG_DESKTOP_DIR=/home/username/Desktop`, `XDG_PICTURES_DIR=/home/username/Images`, `XDG_TEMPLATES_DIR=/home/username/Templates`.
128-
- [x] Customizer must not rely ever on the working directory, that is why relative paths are completely avoided (only allowed in necessary cases in . In the same vein, files must not be downloaded in the working directory, they should be deleted in a controlled location. In most cases, this location is `BIN_FOLDER`.
165+
- [x] Both behaviors of the script use the file `~/.config/user-dirs.dirs` to set some language-independent environment
166+
variables (for example, to get an independent system-language path to the Desktop), so some functions of this script
167+
will fail if this file does not exist. The variables declared in this file that are used in the customizer are
168+
`XDG_DESKTOP_DIR=/home/username/Desktop`,
169+
`XDG_PICTURES_DIR=/home/username/Images`,
170+
`XDG_TEMPLATES_DIR=/home/username/Templates`.
171+
- [x] Customizer must not rely ever on the working directory, that is why relative paths are completely avoided
172+
(only allowed in necessary cases in . In the same vein, files must not be downloaded in the working directory, they
173+
should be deleted in a controlled location. In most cases, this location is `BIN_FOLDER`.
129174
- [ ] All variables should be declared with the needed scope and its write/read permissions (local-r)
130175

131176
###### Structural
132-
- [x] The software that is manually installed is put under `BIN_FOLDER`, which by default points to `~/.bin`. `~/.bin` and is always **present** during the execution of `install.sh`.
133-
- [x] Shell features are not installed directly into `~/.bashrc`, instead, there is always present during the runtime of `install sh` the file `$BIN_FOLDER/bash_functions/.bash_functions`, which is a file imported by `~/.bashrc`. In `~/.bash_functions`, you can write imports to individual scripts that provide a feature to the shell environment. Usually those scripts are stored under `~/.bin/bash_functions/`, which is a location always present. So the generic way to include new content to `~/.bashrc` is writing a script to `~/.bin/bash_functions` and including it in `~/.bash_functions/`.
134-
- [ ] Soft links to include a program in the PATH are created under `DIR_IN_PATH` which by default points to `~/.local/bin` a directory that is usually already in the PATH. If not, `install.sh` will add it at the beginning of the installation
135-
- [ ] Files or folders created as root need to change their permissions and also its group and owner to the `${SUDO_USER}` using `chgrp` and `chown`
136-
- [ ] console features are not installed directly in bashrc; instead use the structure provided by the customizer using .bash_functions
137-
- [ ] Code lines length is 120 maximum. Lines with more characters need to be split in many. Some exceptions may apply, for example when defining vars that contain links.
177+
- [x] The software that is manually installed is put under `BIN_FOLDER`, which by default points to `~/.bin`. `~/.bin`
178+
and is always **present** during the execution of `install.sh`.
179+
- [x] Shell features are not installed directly into `~/.bashrc`, instead, there is always present during the runtime
180+
of `install sh` the file `$BIN_FOLDER/bash_functions/.bash_functions`, which is a file imported by `~/.bashrc`.
181+
In `~/.bash_functions`, you can write imports to individual scripts that provide a feature to the shell environment.
182+
Usually those scripts are stored under `~/.bin/bash_functions/`, which is a location always present. So the generic
183+
way to include new content to `~/.bashrc` is writing a script to `~/.bin/bash_functions` and including it in
184+
`~/.bash_functions/`.
185+
- [ ] Soft links to include a program in the PATH are created under `DIR_IN_PATH` which by default points to
186+
`~/.local/bin` a directory that is usually already in the PATH. If not, `install.sh` will add it at the beginning of
187+
the installation
188+
- [ ] Files or folders created as root need to change their permissions and also its group and owner to the
189+
`${SUDO_USER}` using `chgrp` and `chown`
190+
- [ ] console features are not installed directly in bashrc; instead use the structure provided by the customizer using
191+
.bash_functions
192+
- [ ] Code lines length is 120 maximum. Lines with more characters need to be split in many. Some exceptions may apply,
193+
for example when defining vars that contain links.
138194
- [ ] help lines in 80 characters.
139-
- [ ] The tests used in the conditional ifs must be with [ ] instead of [[ ]] when possible. The last one is a bash exclusive feature that we can not find in other shells.
195+
- [ ] The tests used in the conditional ifs must be with [ ] instead of [[ ]] when possible. The last one is a bash
196+
exclusive feature that we can not find in other shells.
140197

141-
(Everything here is by default)
142-
~/.customizer/
143-
bin/ # decompressed files in directories, venvs and manual downloads of icons or other.
198+
###### Behavioural
199+
- [x] Each feature is expected to be executed with certain permissions (root / normal user). So the script will skip a
200+
feature that needs to be installed with different permissions from the ones that currently has.
201+
- [x] No unprotected `cd` commands. `cd` must be avoided and never change the working directory given from the outside,
202+
that is why they must be called from the inside of a subshell if present.
203+
- [x] Relative PATHs are forbidden. We must not rely or modify the working directory of the environment of the script.
204+
`cd` can be used safely inside a subshell: `$(cd ${BIN_FOLDER} && echo thing`
205+
- [x] no `apt`, the default way to install package in script is `apt-get`
206+
- [x] Only in special cases use echo directly to print to stdout. In most cases you need to use
207+
`output_proxy_executioner`
208+
- [x] desktop launchers created manually have to be created in the desktop and also in the user launchers folder
209+
- [x] desktop launchers created manually as root have to be in the desktop and also in the all users launchers folder
210+
- [ ] All `ln`s are created with the option -f, to avoid collision problems.
211+
- [ ] wget is always used with the `-O` flag, which is used to change the name of the file and / or select a destination
212+
for the download.
213+
- [ ] tar is always used in a subshell, cd'ing into an empty directory before the tar, so the working directory of the
214+
script is never filled with temporary files.
215+
216+
###### Syntactical
217+
- [ ] All variables must be expanded by using `${VAR_NAME}` (include the brackets) except for the special ones, like
218+
`$#`, `$@`, `$!`, `$?`, etc.
219+
- [ ] There is one blankline between functions in the same block. There is two blanklines between blocks.
220+
- [ ] using ~ or $HOME instead of HOME_FOLDER
221+
- [ ] All variables must be protected by using "" to avoid resplitting because of spaces, despite, customizer is not
222+
emphasized to work with spaces in its variables. Spaces are *evil* in some paths are not considered.
223+
- [ ] Indent is always 2 spaces and never TAB.
224+
- [ ] Categories in each desktop launcher: Name, GenericName, Type, Comment, Version, StartupWMClass, Icon, Exec,
225+
Terminal, Categories=IDE;Programming;, StartupNotify, MimeType=x-scheme-handler/tg;, Encoding=UTF-8
226+
227+
# Installation folder structure
228+
The folder used to install customizer functionalities has the following structure by default:
229+
```bash
230+
~/.customizer/ # Installation folder, where ~ is the HOME folder of the user invoking sudo
231+
bin/ # Contains a directory for each feature that has to keep a download, create a virtual env, decompress a file, etc.
144232
studio/
145233
clion/
146234
...
147-
cache/ # download will download here and move or copy the download to it's destination depending on the flag
148-
clion_downloading
235+
temp/ # Downloads will happen here but will be moved afterwards to the destiny location; thus, we will only find failed downloads here
236+
clion_downloading.1 # Failed download. It can be safely deleted
237+
cache/ # All downloads will be moved here before moving them to its final destination. If a required file to download is already here, it will use the one already in the cache and will ommit the download
238+
clion_downloading # cached file
149239
mendeley_downloading
150240
studio_downloading
151241
...
152-
data/
242+
data/ # Contains the files that are used as a database of the used keybindings, active functions, active favorite launchers in the dash...
153243
favorites.txt
154244
keybinds.txt
155245
bash_functions.sh
156246
bash_initializations.sh
157-
functions/
247+
functions/ # Contains the bash files that can be included in the bash environment by using the file data/bash_functions.sh
158248
a.sh
159249
b.sh
160250
...
161-
initializations/
251+
initializations/ # Contains the bash files that can be included at the beginning of the session by using the file data/bash_initializations.sh
162252
keybinds.sh
163-
164-
###### Behavioural
165-
- [x] Each feature is expected to be executed with certain permissions (root / normal user). So the script will skip a feature that needs to be installed with different permissions from the ones that currently has.
166-
- [x] No unprotected `cd` commands. `cd` must be avoided and never change the working directory given from the outside, that is why they must be called from the inside of a subshell if present.
167-
- [x] Relative PATHs are forbidden. We must not rely or modify the working directory of the environment of the script. `cd` can be used safely inside a subshell: `$(cd ${BIN_FOLDER} && echo thing`
168-
- [x] no `apt`, the default way to install package in script is `apt-get`
169-
- [x] Only in special cases use echo directly to print to stdout. In most cases you need to use `output_proxy_executioner`
170-
- [x] desktop launchers created manually have to be created in the desktop and also in the user launchers folder
171-
- [x] desktop launchers created manually as root have to be in the desktop and also in the all users launchers folder
172-
- [ ] All `ln`s are created with the option -f, to avoid collision problems.
173-
- [ ] wget is always used with the `-O` flag, which is used to change the name of the file and / or select a destination for the download.
174-
- [ ] tar is always used in a subshell, cd'ing into an empty directory before the tar, so the working directory of the script is never filled with temporary files.
175-
176-
###### Syntactical
177-
- [ ] All variables must be expanded by using `${VAR_NAME}` (include the brackets) except for the special ones, like `$#`, `$@`, `$!`, `$?`, etc.
178-
- [ ] There is one blankline between functions in the same block. There is two blanklines between blocks.
179-
- [ ] using ~ or $HOME instead of HOME_FOLDER
180-
- [ ] All variables must be protected by using "" to avoid resplitting because of spaces, despite, customizer is not emphasized to work with spaces in its variables. Spaces are *evil* in some paths are not considered.
181-
- [ ] Indent is always 2 spaces and never TAB.
182-
- [ ] Categories in each desktop launcher: Name, GenericName, Type, Comment, Version, StartupWMClass, Icon, Exec, Terminal, Categories=IDE;Programming;, StartupNotify, MimeType=x-scheme-handler/tg;, Encoding=UTF-8
253+
```

0 commit comments

Comments
 (0)