Compare commits

...

5 Commits

Author SHA1 Message Date
Andrei Jiroh Halili d46a0e89a0
chore(global): update gitignore + add kateproject config
Signed-off-by: Andrei Jiroh Eugenio Halili <ajhalili2006@gmail.com>
2022-09-11 00:50:05 +08:00
Andrei Jiroh Halili 52e42496cf
docs(readme): add section for dir structure and license stuff
On the license stuff, I improved some text and also
added an section for third-party code I used here and
other repos integrated via Git submodules.

Signed-off-by: Andrei Jiroh Eugenio Halili <ajhalili2006@gmail.com>
2022-09-11 00:49:07 +08:00
Andrei Jiroh Halili cccd25b29e
Update da docs, especially adding contributing docs
Signed-off-by: Andrei Jiroh Eugenio Halili <ajhalili2006@gmail.com>
2022-08-26 00:07:45 +08:00
Andrei Jiroh Halili d522caab21
License code under MPL-2.0
This means, I need to apply the copyright header to
every single code I produced in the repository other than submodules
and also update the README soon on clarify on licensing stuff.

Signed-off-by: Andrei Jiroh Eugenio Halili <ajhalili2006@gmail.com>
2022-08-23 00:17:23 +08:00
Andrei Jiroh Halili c24a45b485
Add quality of life improvements to different parts of my config
THis include fixing filenames for konsole because
the whole repo can't be checked out on Windows, migrating some directories into
the config folder and even a bit of cleanup.

Signed-off-by: Andrei Jiroh Eugenio Halili <ajhalili2006@gmail.com>
2022-08-22 23:16:16 +08:00
22 changed files with 702 additions and 129 deletions

View File

@ -0,0 +1,2 @@
Copyright 2022, Andrei Jiroh Halili and contributors
Code licensed under MPL-2.0, see the LICENSE file at root for details

21
.gitignore vendored
View File

@ -1,2 +1,21 @@
/secrets
## general ##
.envrc
# used by ctags for code indexing in some tools
# or via "ctags -R ."
tags
# deprecated dotfiles-secrets repo for compartibility and
# secret leakage prevention
secrets
## kate and other editors ##
*~
*-swp
## Doplhin ##
.directory
## from kdiff3 ##
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*

4
.kateproject Normal file
View File

@ -0,0 +1,4 @@
{
"name": "~ajhalili2006's dotfiles",
"files": [ { "git": 1 } ]
}

373
LICENSE Normal file
View File

@ -0,0 +1,373 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

107
README.md
View File

@ -1,44 +1,107 @@
# My Personal Dotfiles
# Andrei Jiroh's Personal Dotfiles
<!-- markdownlint-disable-file MD033 -->
Personal configuration for Linux/macOS stuff. If you're
working at The Pins Team, see [our dotfiles][df-gl].
This is the main portal to my personal configuration for Linux/macOS stuff. If you're
working at Recap Time Squad (formerly The Pins Team), see [our dotfiles][df-gl] (currently unmaintained and on old namespace).
[df-gl]: https://gitlab.com/MadeByThePinsHub/dotfiles
## Getting Started
### Running from
While the clone URLs use GitLab SaaS as the canonical Git repository URL, you can still clone the repository from the following URLs:
* GitLab self-hosted instances: `https://mau.dev/ajhalili2006/dotfiles`
* SourceHut (official instance): `https://git.sr.ht/~ajhalili2006/dotfiles` (SSH: `git@git.sr.ht:~ajhalili2006/dotfiles)
To get started, run the bootstrap script which handles the repository cloning/pulling for you and then sets things up for you.
```sh
# configure required variables
export GITLAB_LOGIN=ajhalili2006
export GITLAB_TOKEN=<my-gitlab1dotcom-PAT>
# Pro-tip: Install the essientials like Git and Doppler first!
# Using the essientials setup script will handle Homebrewing for you, among other software-related
# chores. Works on Debian-based distros and Alpine Linux.
$(command -v curl>>/dev/null && echo curl -o- || echo wget -q0-) https://ctrl-c.club/~ajhalili2006/bin/essientials-setup-dotfiles.sh
# Run the bootstrap script
$(command -v curl>>/dev/null && echo curl -o- || echo wget -q0-) https://raw.githubusercontent.com/ajhalili2006/dotfiles/main/bootstrap | bash -
# Done? Don't forget to cleanup as needed.
unset GITLAB_TOKEN GITLAB_LOGIN && history -c
# Run the bootstrap script without Doppler
$(command -v curl>>/dev/null && echo curl -o- || echo wget -q0-) https://gitlab.com/ajhalili2006/dotfiles/raw/main/bootstrap | bash -
```
### With Cloning the Repo
## Directory Structure
```sh
# assuming git is installed
git clone https://github.com/ajhalili2006/dotfiles $HOME/.dotfiles
cd $HOME/.dotfiles
```bash
$ date && echo && tree -d .
Saturday, 10 September, 2022 11:41:26 PM PST
# you may need to export the required variables before running the bootstrap script locally
# you may optionally run the bootstrapper script if you want
GITLAB_LOGIN=AndreiJirohHaliliDev2006 GITLAB_TOKEN=<my-gitlab-saas-pat> ./bootstrap --flags-over here
.
|-- bash-wakatime # TODO: Migrate to tools directory
|-- bin # Scripts go here.
|-- config # Configuration files, mostly not per distro, with exception of Termux and WSL2.
| |-- bashrc
| |-- byobu
| |-- gitconfig
| |-- konsole
| |-- nanorc
| | |-- config
| | `-- highlighting
| |-- ssh-client
| |-- systemd
| | `-- system
| |-- tmux
| `-- zshrc
|-- docs # Markdown versions of my dotfiles docs at my Miraheze-hosted wiki
| |-- additional-tools
| `-- os-installation
|-- gnupg # TODO: Migrate to config directory
|-- nixos # TODO: Migrate to config directory
|-- systemd -> config/systemd # TODO: Remove symlink soon
|-- tests # Testing bootstrap scripts across distros
| |-- alpine
| |-- common
| | `-- bin
| `-- ubuntu
|-- tools # A bit of homegrown tools and some other stuff I use
| |-- bootstrap-utils
| `-- setup-scripts
`-- update-golang # TODO: Migrate to tools directory, might be deprecated due to usage of asdf/other tools
30 directories
```
### Documentation
Available documentation for the on/offboarding processes I do + other tidbits of the bootstrap script can be accessible through [the `docs` directory](./docs).
Available documentation for the on/offboarding processes I do for devices + other tidbits of the bootstrap script can be accessible through [the `docs` directory](./docs) and on [my personal wiki hosted on Miraheze](https://ajhalili2006.miraheze.org/wiki/Dotfiles).
## License and contributions
Code is licensed under [the MPL-2.0](LICENSE) license, while docs on my MediaWiki-powered wiki + here in this repository are licensed
under [CC BY-SA 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/legalcode).
Patches (either via GitLab merge requests or email patches via
`~ajhalili2006/public-inbox@lists.sr.ht`) are welcome, but technical
support for forks is currently unavailable due to this repository being
used for personal day-to-day use.
### Third-party source code
Some of the code used in this dotfiles repository (and related repositories via Git submodules)
uses third-party code, which might be licensed under other licenses, sometimes might not be compartible with
the repository licenses.
* TBD
* [Drew DeVault's Dotfiles][sircmpwn-df], specifically some [templates][sircmpwn-dt-aerc-templates] and [config for aerc][sircmpwn-dt-aerc]
[sircmpwn-df]: https://git.sr.ht/~sircmpwn/dotfiles
[sircmpwn-dt-aerc-templates]: https://git.sr.ht/~sircmpwn/dotfiles/tree/.config/aerc/templates
[sircmpwn-dt-aerc]: https://git.sr.ht/~sircmpwn/dotfiles/tree/.config/aerc
---
<details>
<summary>Deprecated docs stashed here for archival purposes, might be removed later.</summary>
## Want to fork me owo?
> This section is outdated and will be revised in the future since I also have other stuff to do behind the scenes.
Follow the checklist below after forking to ensure no references to mine are found. **Remember that your fork, your problem.** It's up to you on how do you customize stuff. You can use [The Pins Team's dotfiles template][template] to start from our template.
[template]: https://github.com/MadeByThePinsHub/dotfiles-template
@ -48,3 +111,5 @@ Follow the checklist below after forking to ensure no references to mine are fou
* [ ] Edit `bin/fix-wrong-emails#L6-7` to use your email instead of mine.
* [ ] Edit `bin/add-ssh-keys#L4` to use your SSH key in `~/.ssh` directory.
* [ ] Want to backup your worst secrets AKA SSH and PGP keys (and some Pyrgoram session files?) Use my `bin/init-secrets-dir` script to setup an `secrets` directory. Don't forget to push this into an GitLab private repo.
</details>

View File

@ -1,5 +0,0 @@
#!/bin/bash
if [[ -f "/snap/bin/code" ]]; then
exec /snap/bin/code $*
fi

View File

@ -1,17 +0,0 @@
#!/bin/env bash
echo "---> Refreshing custom functions..."
sleep 5
# change the path if it's different
source ~/.dotfiles/bashrc/worthwhile-functions
if [[ $? == 0 ]]; then
echo "info: Successfully refreshed functions to current session."
echo "info: Something don't work? Run edit-funcs-bashrc to edit"
echo "info: or even remove problematic functions"
else
echo "! Problems found, please run edit-funcs-bashrc to fix"
echo " and re-run this command again. In case of path changes,"
echo " please do 'source ~/.bashrc' if issue presists."
echo " If you ever moved that file, also update your ~/.bashrc and"
echo " the ~/.dotfiles/bin/reload-funcs-bashrc\#L5"
fi

View File

@ -1,9 +1,8 @@
#!/bin/env sh
SUDO_PATH=$(command -v sudo)
SU_PATH=$(command -v su)
SUDO=${SUDO:-"sudo"}
if [ "$1" = "" -o "$1" = "help" ]; then
if [ "$1" = "" ] || [ "$1" = "help" ]; then
echo "Usage: [sudo|su root -] $0 COMMAND [ARG]"
echo "Permanently installs your .dotfiles/bin scripts into your system for"
echo "all users. These system-wide installs are on /usr/local/bin/dotfiles-bin"
@ -36,11 +35,11 @@ if [ "$1" = "" -o "$1" = "help" ]; then
exit 0
fi
if [ $@ = "status" ]; then
if [ ! $DOTFILES_SYS_INSTALL_PATH = "" ]; then
if [ "$1" = "status" ]; then
if [ "! $DOTFILES_SYS_INSTALL_PATH" = "" ]; then
echo "Local install: $DOTFILES_SYS_INSTALL_PATH"
elif [ -f "$HOME/.dotfiles/config/sysbin-path" ]; then
DOTFILES_SYS_IBSTALL_PATH=$(cat "$HOME/.dotfiles/config/sysbin-path")
DOTFILES_SYS_INSTALL_PATH=$(cat "$HOME/.dotfiles/config/sysbin-path")
echo "Local install: $DOTFILES_SYS_INSTALL_PATH"
else
echo "Local install: ✖ Not found"

View File

@ -2,5 +2,5 @@
# these commands should be triggered on shell startup
source "$DOTFILES_HOME/config/bashrc/aliases"
source "$DOTFILES_HOME/config/bashrc/worthwhile-functions"
source "$DOTFILES_HOME/config/bashrc/functions"
#guild-test

86
config/bashrc/functions Normal file
View File

@ -0,0 +1,86 @@
#!/bin/bash
# shellcheck disable=SC2199,SC2068,SC1091,SC2086,SC2145
# custom function management here
# changes to the worthwhile-functions filepath requires
# an update o the filepath via 'edit-script reload-funcs-bashrc
# and also any reference here
DOTFILES_HOME=${DOTFILES_HOME:-"$HOME/.dotfiles"}
source "$DOTFILES_HOME/tools/bootstrap-utils/00-script-library.sh"
disable-funcs () {
echo "info: Unimplemented yet. Tell Andrei to add it to his todo."
}
edit-funcs-bashrc() {
$(command -v nano>>/dev/null && echo nano || echo vi) ~/.dotfiles/bashrc/worthwhile-functions
}
list-debs-size() {
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | less
}
edit-script-file() {
# if you use other editor, please set $EDITOR.
$EDITOR "$(command -v $1)"
}
# reloading stuff
refresh-funcs() {
showStage "reloading current session with fresh functions"
source "$DOTFILES_HOME/config/bashrc/functions"
}
refresh-aliases() {
showStage "reloading current session with fresh aliases"
source "$DOTFILES_HOME/config/bashrc/aliases"
}
# https://commentedcode.org/blog/2020/09/21/changing-default-branch-of-git-init/
# TODO: Deprecate this function once git-config:init.defaultBranch is used.
git() {
# check command for some automation KEK, especially i want to do DCO by default
if [[ "$1" == "init" && "$@" != *"--help"* ]]; then
if command git "$@"; then
echo "Setting HEAD to branch main"
command git symbolic-ref HEAD refs/heads/main
fi
else
command git "$@"
fi
}
list-nodejs-scripts() {
[[ -f "package.json" ]] && jq .scripts < package.json || echo "No package.json found in current directory."
}
code() {
# quick trick in case only code-insiders is installed and not code
if ! command -v code >> /dev/null; then
if command -v code-insiders >>/dev/null; then
warn "code-stable is not installed, but code-insiders is found in PATH, setting USE_CODE_INSIDERS"
warn "for this run"
USE_CODE_INSIDERS=true
fi
fi
if [[ -f "/snap/bin/code" && "$USE_CODE_INSIDERS" == "" ]]; then
echo "info: execing /snap/bin/code with params: $*"
exec /snap/bin/code "$@"
elif [[ -f "/snap/bin/code-insiders" ]]; then
echo "info: execing /snap/bin/code-insiders with params: $*"
exec /snap/bin/code-insiders "$*"
fi
if [[ "$(command -v code)" != "" && "$USE_CODE_INSIDERS" == "" ]]; then
info "execing $(command -v code) with params: $*"
exec "$(command -v code)" "$*"
elif [[ $(command -v code-insiders) != "" ]]; then
info "execing $(command -v code-insiders) with params: $*"
exec "$(command -v code-insiders)" "$*"
fi
echo "Either VS Code Stable or Insiders aren't installed on your system. Please visit"
echo "https://go.rtapp.tk/get-code to install the code editor."
return 1
}

View File

@ -5,11 +5,30 @@
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
############################################################################
# https://packaging.ubuntu.com/html/getting-set-up.html#configure-your-shell
export DEBFULLNAME="Andrei Jiroh Halili"
# Temporary Gmail address for devel stuff, even through my longer email one is, well,
# on my public GPG key btw, so YOLO it.
export DEBEMAIL="ajhalili2006@gmail.com"
## Update path and inject some vars before the shell interactivity checks ##
export DOTFILES_HOME="$HOME/.dotfiles"
export DOTFILES_STUFF_BIN="$DOTFILES_HOME/bin"
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$DOTFILES_STUFF_BIN:$PATH"
## Add homebrew to path ##
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
test -d $HOME/.linuxbrew && eval $($HOME/.linuxbrew/bin/brew shellenv)
############################################################################
# If not running interactively, don't do anything
#case $- in
# *i*) ;;
# *) return;;
#esac
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
@ -127,12 +146,6 @@ export NVM_DIR="$HOME/.nvm"
# Deta CLI
export PATH="$HOME/.deta/bin:$PATH"
# scripts in ~/.local/bin and ~/.dotfiles/bin
# also $HOME/.cargo/bin
export DOTFILES_HOME="$HOME/.dotfiles"
export DOTFILES_STUFF_BIN="$DOTFILES_HOME/bin"
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$DOTFILES_STUFF_BIN:$PATH"
# use nano instead of vi by default when on SSH
# for git, there's the option of firing up VS Code, if you prefered.
#export VISUAL="code --wait"
@ -170,18 +183,8 @@ fi
# autocompletion for GitHub CLI
eval "$(gh completion -s bash)"
# custom aliases and functions I made
# sorucing through the chain-source script
source "$DOTFILES_HOME/config/bashrc/chain-source" # TODO: Remove guild-test stuff
# https://packaging.ubuntu.com/html/getting-set-up.html#configure-your-shell
export DEBFULLNAME="Andrei Jiroh Halili"
# Temporary Gmail address for devel stuff, even through my longer email one is, well,
# on my public GPG key btw, so YOLO it.
export DEBEMAIL="ajhalili2006@gmail.com"
# Homebrew
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# Source both the custom aliases and shell functions in one go
source "$DOTFILES_HOME/config/bashrc/chain-source"
# Golang, probably we need to tweak this btw
export PATH="$HOME/go/bin:$PATH" GOPATH="$HOME/go"

View File

@ -1,48 +0,0 @@
#!/bin/bash
# shellcheck disable=SC2199,SC2068,SC1091,SC2086,SC2145
# custom function management here
# changes to the worthwhile-functions filepath requires
# an update o the filepath via 'edit-script reload-funcs-bashrc
# and also any reference here
disable-funcs () {
echo "info: Unimplemented yet. Tell Andrei to add it to his todo."
}
edit-funcs-bashrc() {
$(command -v nano>>/dev/null && echo nano || echo vi) ~/.dotfiles/bashrc/worthwhile-functions
}
list-debs-size() {
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | less
}
edit-script-file() {
# if you use other editor, please set $EDITOR.
$EDITOR "$(command -v $1)"
}
# reloading stuff
refresh-funcs() {
"$DOTFILES_STUFF_BIN/reload-funcs-bashrc"
}
refresh-aliases() {
source "$HOME/.dotfiles/bashrc/aliases"
}
# https://commentedcode.org/blog/2020/09/21/changing-default-branch-of-git-init/
git() {
# check command for some automation KEK, especially i want to do DCO by default
if [[ "$1" == "init" && "$@" != *"--help"* ]]; then
if command git "$@"; then
echo "Setting HEAD to branch main"
command git symbolic-ref HEAD refs/heads/main
fi
else
command git "$@"
fi
}
list-nodejs-scripts() {
[[ -f "package.json" ]] && jq .scripts < package.json || echo "No package.json found in current directory."
}

56
docs/CONTRIBUTING.md Normal file
View File

@ -0,0 +1,56 @@
# Contributing to my dotfiles
## Development
Usually Andrei Jiroh clone the dotfiles repository in `~/.dotfiles` directory, but feel free
to customize the clone location. The rest of this section contains the TL;DR version of the
contribution process, plus additional information about each parts.
```sh
## easy path: use Gitpod and GLab CLI ##
xdg-open "https://gitpod.io/#https://gitlab.com/ajhalili2006/dotfiles"
# ssh to the workspace using an owner token - https://www.gitpod.io/docs/ides-and-editors/command-line#access-token-ssh
ssh ajhalili2006-dotfiles-abcdefg123456#ownerToken@ajhalili2006-dotfiles-abcdefg123456.ssh.ws-us62.gitpod.io
# use GLab CLI to fork the repo and configure remotes
glab repo fork --remote=true # assuming GITLAB_TOKEN is set for GitLab SaaS
# do your own homework here and push to your personal branch
git switch -c username/some-descriptive-name-here
nano bootstrap config/bashrc/aliases # or <vi|emacs> bootstrap config/bashrc/aliases
shellcheck --severity=warning bootstrap config/bashrc/aliases # run the shell linter for issues
git commit --signoff # commit with Signed-off-by trailer for DCO
git push origin username/some-descriptive-name-here # publish your changes before submiting patches
glab mr create -R https://gitlab.com/ajhalili2006/dotfiles -b main # create a merge request
## the mailing list way: use sourcehut mirror ##
docker run --rm -v $HOME:/home/gildedguy quay.io/ajhalili2006/docker-alpine-env
mkdir ~/git-projects/ajhalili2006
git clone https://git.sr.ht/~ajhalili2006/dotfiles ~/git-projects/ajhalili2006/dotfiles && cd ~/git-projects/ajhalili2006/dotfiles
# do your own homework here and (optionally) push to your personal branch
git switch -c username/some-descriptive-name-here
nano bootstrap config/bashrc/aliases # or <vi|emacs> bootstrap config/bashrc/aliases
shellcheck --severity=warning bootstrap config/bashrc/aliases # run the shell linter for issues
git commit --signoff # commit with Signed-off-by trailer for DCO
git remote add username-srht git@git.sr.ht:~username/ajhalili2006-dotfiles-patches && git push username-srht username/some-descriptive-name-here # if it doesn't exist, creates a repo on push
# configure your local copy, per https://git-send-email.io/#
git config sendemail.to "~ajhalili2006/public-inbox@lists.sr.ht"
git config format.subjectprefix "PATCH dotfiles" # or sandbox-dotfiles for sandbox/main branch
```
## Submitting patches
### DCO and CLA
Recap Time Squad's CLA do not apply in this project, although I might use Eclipse Contributor Agreement to legally codify DCO in case of corporate contributions.
### Sending patches via email
If you prefer to send patches via email, please set your local copy of this repository with
the following configuration for `git send-email`:
```sh
git config sendemail.to "~ajhalili2006/public-inbox@lists.sr.ht"
git config format.subjectprefix "PATCH dotfiles" # or sandbox-dotfiles for sandbox/main branch
```
Please note that I'll not accept patches that sent to my personal email address/es instead of
through the public inbox mailing list.

View File

@ -5,17 +5,17 @@ This onboarding page documents how do I bootstrap stuff for an new Linux machine
## Prerequisites
* Access to my Bitwarden vault for GitLab PAT AND Tailscale reusable authtoken on an Vaultwarden instance at Railway. Once email has been fixed, probably my phone with 2FA number used for Google OR Authy app and Telegram client of choice.
* An working browser, preferrly Firefox.
* An working browser, preferrly Firefox or Chromium.
* An desktop environment preinstalled, in case of Alpine/Arch/Gentoo-based distros, proceed with Xfce4. Unless has atleast 4 GBs of memory on an amd64 machine, install GNOME or KDE instead.
### Pre-flight Check
* Check if the init system is systemd, and if not, check if we can swap init systems. This is required so we can install stuff using `snapd`. Using Flatpak is still being considered as alternative option.
* If you messing up with partitioning, especially Windows might go berserk when resizing, backup everything as much as possible. Ohterwise, we might be f\*\*ked.
* Check if the init system is systemd, and if not, check if we can swap init systems (or at least attempt to install systemd from source). This is required so we can install stuff using `snapd`. Using Flatpak is still being considered as alternative option.
* If you messing up with partitioning, especially Windows might go berserk when resizing, backup everything as much as possible. Ohterwise, we might be fucked.
* Check if Bash and/or Git is preinstalled while in live environment.
* Remember to note down the root password! You may also need to take down notes of your regular account password too, if sudo is configured.
* If you're trying an new distro (Arch, Gentoo, RHEL) or got an ChromeOS preinstalled and enabled devmode and Linux stuff, please install the tools one by one and note it down here in this document.
* Check if that distro either has GitHub CLI from the official package repos (or atleast community maintained ones). Otherwise, maybe opt to building from source or use prebuilt binaries from GitHub Releases.
* Check if that distro either has GitHub CLI, GLab CLI and/or `hut` from the official package repos (or atleast community maintained ones). Otherwise, maybe opt to building from source or use prebuilt binaries from GitHub/GitLab/SourceHut Releases.
## Per-Distro/Platform Docs
@ -74,7 +74,7 @@ you need to `apk add bash@edge git@edge curl@edge coreutils@edge` instead.
### Gitpod?
Currently unsupported yet, but we can setup an meta-workspace with my dotfiles stuff loaded too, in the future, probably.
~~Currently unsupported yet, but we can setup an meta-workspace with my dotfiles stuff loaded too, in the future, probably.~~ This is currently planned to work on since Gitpod already added dotfiles support, but for now the system will symlinking everything from the dotfiles repo.
### WSL 2-specific back pain treatment for Tailscale
@ -97,3 +97,4 @@ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1; sudo sysctl -w net.ipv6.conf.de
## Optionals
* Install Cloudflare tunnel and login. There's Tailscale, but if I don't brothered adding another device to the tailnet, we can setup da API instead.

View File

@ -1,5 +1,7 @@
# Bloody Docs for installing Arch Linux
> Wiki version: https://ajhalili2006.miraheze.org/wiki/Onboarding_new_device/Computers/Linux/Arch
## Afer booting into the hell
If you're inside an Virtualbox eenvironment, make sure SSH is enabled and setup port forwarding stuff. Don't forget changing the root password for live
@ -32,11 +34,15 @@ grub-install --target=i386-pc /dev/sda; grub-mkconfig -o /boot/grub/grub.cfg
```sh
# Change sda into device name for your target hard drive/SSD
grub-install --target=i386-pc /dev/sda; grub-mkconfig -o /boot/grub/grub.cfg
grub-install --target=x86_64-efi /dev/sda; grub-mkconfig -o /boot/grub/grub.cfg
```
* With Secure Boot:
```sh
# TBD, check the docs!
```
## Final Steps
* Exit the chroot and reboot. Don't forget to remove the installation media before the reboot.

View File

@ -1,7 +1,9 @@
#!/usr/bin/env bash
#shellcheck disable=SC2034
# Library code for the bootstrap scripts
# Adding colors to some text in termnial based on checks
# NO_COLOR: https://no-color.org/
if [ -t 1 ] && [[ "$NO_COLOR" == "" ]]; then
RED=$(printf '\033[31m')
GREEN=$(printf '\033[32m')
@ -18,4 +20,24 @@ else
MAGENTA=""
BOLD=""
RESET=""
fi
fi
error() {
echo "${RED}error: $*${RESET}"
}
success() {
echo "${GREEN}success: $*${RESET}"
}
warn() {
echo "${YELLOW}warning: $*${RESET}"
}
info() {
echo "${BOLD}info: $*${RESET}"
}
showStage() {
echo "${BOLD}==> $*${RESET}"
}

View File

@ -1,9 +1,16 @@
#!/usr/bin/env bash
source "$(dirname $0)/00-script-library.sh"
stage "Symlinking shell configuration files..."
if [[ $DOTFILES_OS_NAME == "android-termux" ]]; then
if [ ! -f "$HOME/.bashrc" ]; then
ln -s $HOME/.dotfiles/termux.bashrc ~/.bashrc
ln -s "$HOME/.dotfiles/termux.bashrc" ~/.bashrc
elif [ -f "$HOME/.bashrc" ]; then
cp "$HOME/.bashrc" "$HOME/.bashrc.bak"
ln -s "$HOME/.dotfiles/termux.bashrc" ~/.bashrc
fi
elif [[ $DOTFILES_OS_NAME == "debian" ]] || [[ $DOTFILES_OS_NAME == "ubuntu" ]]; then
if [[ $SKIP_CONFIG_LINKING == "" ]] && [ ! -f "$HOME/.bashrc" ]; then
ln -s "$HOME/.dotfiles/ubuntu.bashrc" ~/.bashrc