diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..e04eff5 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,17 @@ +#!/bin/bash + +#/** +# * TangoMan pre-commit git hook +# * +# * @license MIT +# * @author "Matthias Morin" +# * @version 0.1.0 +# */ + +set -efu -o pipefail + +BASEDIR="$(git rev-parse --show-toplevel)" + +cd "${BASEDIR}" || exit 1 + +sh "${BASEDIR}"/entrypoint.sh lint diff --git a/.githooks/pre-commit.sample b/.githooks/pre-commit.sample new file mode 100644 index 0000000..eed824c --- /dev/null +++ b/.githooks/pre-commit.sample @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +# cf https://gist.github.com/wookietreiber/3bf8621274caafed543fca6a3feab284#file-git-hook-shellcheck-sh +set -efu -o pipefail + +# returns staged files +function get_staged_bash_files() { + if git rev-parse --verify HEAD &>/dev/null; then + against=HEAD + else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) + fi + + # --diff-filter + # A Added + # C Copied + # M Modified + # R Renamed + git diff-index --cached --name-only --diff-filter=ACMR "${against}" | grep \ + -e '\.bashrc' \ + -e '\.zshrc' \ + -e '\.bash_profile' \ + -e '\.sh$' || true +} + +function get_staged_php_files() { + if git rev-parse --verify HEAD &>/dev/null; then + against=HEAD + else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) + fi + + # --diff-filter + # A Added + # C Copied + # M Modified + # R Renamed + git diff-index --cached --name-only --diff-filter=ACMR "${against}" | grep -e '\.php$' +} + +CURDIR=$(git rev-parse --show-toplevel) + +declare -a paths=() + +while read -r file; do + [[ -f "$file" ]] && paths[${#paths[@]}+1]=$file +done < <(get_staged_bash_files) + +if [[ ${#paths[@]} -eq 0 ]]; then + echo -e '\e[1m\e[32m[info]\e[0m \e[1mshellcheck\e[0m no files in stage' +else + if ! command -v shellcheck &> /dev/null + then + echo -e '\e[1m\e[33m[warn]\e[0m \e[1mshellcheck\e[0m is not installed' >&2 + exit 1 + fi + + stage=$(mktemp -d) + trap 'rm -r $stage' EXIT INT TERM + + for path in "${paths[@]}" + do + file="$stage/$path" + + mkdir -p "$(dirname "$file")" + git show ":$path" > "$file" + done + + pushd "$stage" &> /dev/null + shellcheck "${paths[@]}" + popd &> /dev/null +fi \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..8b6807c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Call script with parameters ... +2. Type ... +3. Wait for ... seconds +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. MacOS] + - bash version (bash --version) + - Script version + - copy/paste output of script.sh -v + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000..ac93b55 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,18 @@ +name: ShellCheck CI +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + shellcheck: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Check for code quality errors + run: ./entrypoint.sh lint diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..88a2591 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/backups/* +!/backups/.gitignore diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5ef6e1b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +Change Log +========== + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased] +- WIP + +## [0.1.0](https://github.com/TangoMan75/provisions/releases/tag/0.1.0) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..b480fb3 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at mat@tangoman.io. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b791850 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,242 @@ +# Contributing + +## How do I... + +* [Use This Guide](#introduction)? +* Ask or Say Something? 🤔🐛😱 + * [Request Support](#request-support) + * [Report an Error or Bug](#report-an-error-or-bug) + * [Request a Feature](#request-a-feature) +* Make Something? 🤓👩🏽‍💻📜🍳 + * [Project Setup](#project-setup) + * [Contribute Documentation](#contribute-documentation) + * [Contribute Code](#contribute-code) +* Manage Something ✅🙆🏼💃👔 + * [Provide Support on Issues](#provide-support-on-issues) + * [Label Issues](#label-issues) + * [Clean Up Issues and PRs](#clean-up-issues-and-prs) + * [Review Pull Requests](#review-pull-requests) + * [Merge Pull Requests](#merge-pull-requests) + * [Tag a Release](#tag-a-release) + * [Join the Project Team](#join-the-project-team) +* Add a Guide Like This One [To My Project](#attribution)? 🤖😻👻 + +## Introduction + +Thank you so much for your interest in contributing!. All types of contributions are encouraged and valued. See the [table of contents](#toc) for different ways to help and details about how this project handles them!📝 + +Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 + +## Request Support + +If you have a question about this project, how to use it, or just need clarification about something: + +* Open an Issue at https://github.com/TangoMan75/provisions/issues +* Provide as much context as you can about what you're running into. +* Provide project and platform versions (bash, basher, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* Someone will try to have a response soon. +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). + If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. + +## Report an Error or Bug + +If you run into an error or bug with the project: + +* Open an Issue at https://github.com/TangoMan75/provisions/issues +* Include *reproduction steps* that someone else can follow to recreate the bug or error on their own. +* Provide project and platform versions (OS, bash, basher, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* A team member will try to reproduce the issue with your provided steps. If there are no repro steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +* If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#contribute-code). +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. +* `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline. + +## Request a Feature + +If the project doesn't do something you need or want it to do: + +* Open an Issue at https://github.com/TangoMan75/provisions/issues +* Provide as much context as you can about what you're running into. +* Please be clear about why existing features and alternatives would not work for you. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward. +* If the feature request is accepted, it will be marked for implementation with `feature-accepted`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](#contribute-code). + +Note: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no. + +## Project Setup + +So you want to contribute some code! That's great! This project uses GitHub Pull Requests to manage contributions, so [read up on how to fork a GitHub project and file a PR](https://guides.github.com/activities/forking) if you've never done it before. + +If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#contribute-code). + +If you want to go the usual route and run the project locally, though: + +* [Fork the project](https://guides.github.com/activities/forking/#fork) + +Then in your terminal: +* `cd path/to/your/clone` + +And you should be ready to go! + +## Contribute Documentation + +Documentation is a super important, critical part of this project. Docs are how we keep track of what we're doing, how, and why. It's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance. + +Documentation contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake! + +To contribute documentation: + +* [Set up the project](#project-setup). +* Edit or add any relevant documentation. +* Make sure your changes are formatted correctly and consistently with the rest of the documentation. +* Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). Documentation commits should use `docs(): `. +* Go to https://github.com/TangoMan75/provisions/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Contribute Code + +We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. + +Code contributions of just about any size are acceptable! + +The main difference between code contributions and documentation contributions is that contributing code requires inclusion of relevant tests for the code being added or changed. Contributions without accompanying tests will be held off until a test is added, unless the maintainers consider the specific tests to be either impossible, or way too much of a burden for such a contribution. + +To contribute code: + +* [Set up the project](#project-setup). +* Make any necessary changes to the source code. +* Include any [additional documentation](#contribute-documentation) the changes might need. +* Write tests that verify that your contribution works as expected. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). +* Dependency updates, additions, or removals must be in individual commits, and the message must use the format: `(deps): PKG@VERSION`, where `` is any of the usual `conventional-changelog` prefixes, at your discretion. +* Go to https://github.com/TangoMan75/provisions/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* Barring special circumstances, maintainers will not review PRs until all checks pass (Travis, AppVeyor, etc). +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Provide Support on Issues + +Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on an open source projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug. + +Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `bug` or `feature`. If you can't do this yourself, @mention a maintainer so they can do it. + +In order to help other folks out with their questions: + +* Go to the issue tracker and [filter open issues by the `support` label](https://github.com/TangoMan75/provisions/issues?q=is%3Aopen+is%3Aissue+label%3Asupport). +* Read through the list until you find something that you're familiar enough with to give an answer to. +* Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on. +* Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you. + +Some notes on picking up support issues: + +* Avoid responding to issues you don't know you can answer accurately. +* As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format. +* Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](CODE_OF_CONDUCT.md) to resolve the conflict). + +## Label Issues + +One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily. + +In order to label issues, [open up the list of unlabeled issues](https://github.com/TangoMan75/provisions/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself! + +Label | Apply When | Notes +--- | --- | --- +`bug` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `enhancement` label. +`critical` | Added to `bug` issues if the problem described makes the code completely unusable in a common situation. | +`documentation` | Added to issues or pull requests that affect any of the documentation for the project. | Can be combined with other labels, such as `bug` or `enhancement`. +`duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`) +`enhancement` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. | +`help wanted` | Applied by [Committers](#join-the-project-team) to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling. +`in-progress` | Applied by [Committers](#join-the-project-team) to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete. +`performance` | This issue or PR is directly related to improving performance. | +`refactor` | Added to issues or PRs that deal with cleaning up or modifying the project for the betterment of it. | +`starter` | Applied by [Committers](#join-the-project-team) to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority. +`support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `bug` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes. +`tests` | This issue or PR either requests or adds primarily tests to the project. | If a PR is pending tests, that will be handled through the [PR review process](#review-pull-requests) +`wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not. + +## Clean Up Issues and PRs + +Issues and PRs can go stale after a while. Maybe they're abandoned. Maybe the team will just plain not have time to address them any time soon. + +In these cases, they should be closed until they're brought up again or the interaction starts over. + +To clean up issues and PRs: + +* Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today. +* Go through each issue *from oldest to newest*, and close them if **all of the following are true**: + * not opened by a maintainer + * not marked as `critical` + * not marked as `starter` or `help wanted` (these might stick around for a while, in general, as they're intended to be available) + * no explicit messages in the comments asking for it to be left open + * does not belong to a milestone +* Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/TangoMan75/provisions/blob/latest/CONTRIBUTING.md#clean-up-issues-and-prs for more details." + +## Review Pull Requests + +While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Issue Tracker or higher permissions. + +PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration. + +Some notes: + +* You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments". +* *ALL PULL REQUESTS* should be covered by a test: either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests to verify any new/changed behavior. All tests must also pass and follow established conventions. Test coverage should not drop, unless the specific case is considered reasonable by maintainers. +* Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. +* Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either. Just don't be a jerk about it? + +## Merge Pull Requests + +Project Team will merge pull requests after review. + +## Tag A Release + +Project Team will bump tags/version with [setver](https://github.com/pforret/setver) as a patch or minor versionupdate. +Releases are done manually for important changes. + + +## Join the Project Team + +### Ways to Join + +There are many ways to contribute! Most of them don't require any official status unless otherwise noted. That said, there's a couple of positions that grant special repository abilities, and this section describes how they're granted and what they do. + +All of the below positions are granted based on the project team's needs, as well as their consensus opinion about whether they would like to work with the person and think that they would fit well into that position. The process is relatively informal, and it's likely that people who express interest in participating can just be granted the permissions they'd like. + +You can spot a collaborator on the repo by looking for the `[Collaborator]` or `[Owner]` tags next to their names. + +Permission | Description +--- | --- +Issue Tracker | Granted to contributors who express a strong interest in spending time on the project's issue tracker. These tasks are mainly [labeling issues](#label-issues), [cleaning up old ones](#clean-up-issues-and-prs), and [reviewing pull requests](#review-pull-requests), as well as all the usual things non-team-member contributors can do. Issue handlers should not merge pull requests, tag releases, or directly commit code themselves: that should still be done through the usual pull request process. Becoming an Issue Handler means the project team trusts you to understand enough of the team's process and context to implement it on the issue tracker. +Committer | Granted to contributors who want to handle the actual pull request merges, tagging new versions, etc. Committers should have a good level of familiarity with the codebase, and enough context to understand the implications of various changes, as well as a good sense of the will and expectations of the project team. +Admin/Owner | Granted to people ultimately responsible for the project, its community, etc. + +## Attribution + +This guide was generated using the WeAllJS `CONTRIBUTING.md` generator. [Make your own](https://npm.im/weallcontribute)! + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8b50e09 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Matthias Morin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e748ab7 --- /dev/null +++ b/README.md @@ -0,0 +1,161 @@ +![GH language](https://img.shields.io/github/languages/top/TangoMan75/provisions) +[![GH release](https://img.shields.io/github/v/release/TangoMan75/provisions)](https://github.com/TangoMan75/provisions/releases) +[![GH license](https://img.shields.io/github/license/TangoMan75/provisions)]((https://github.com/TangoMan75/provisions/blob/master/LICENSE)) +[![GH stars](https://img.shields.io/github/stars/TangoMan75/provisions)](https://github.com/TangoMan75/provisions/stargazers) +[![ShellCheck CI](https://github.com/TangoMan75/provisions/workflows/ShellCheck%20CI/badge.svg)](https://github.com/TangoMan75/provisions/actions/workflows/shellcheck.yml) +![visitors](https://visitor-badge.glitch.me/badge?page_id=TangoMan75.provisions) + +TangoMan Provisions +=================== + +**TangoMan Provisions** is a fast and handy way to provision your machines using plain shell scripts. + +What to do after installing your workstation : + +1. Install git +2. clone this repository +3. Setup your ssh config + +💻 Dependencies +--------------- + +**TangoMan Provisions** requires the following dependencies: + +- git + +--- + +### 🔖 git + +#### 🐧 Install git (Linux) + +```bash +sudo apt-get install --assume-yes git +``` + +#### 🏁 Install git (Windows) + +Download and install latest version from here [git-scm.com](https://git-scm.com/download/win) + +#### 🍎 Install git (OSX) + +```bash +brew install git +``` + +#### 🔧 git configuration + +Push current branch only if upstream exists + +```bash +git config --global push.default simple +``` + +Set vim as git default editor + +```bash +git config --global core.editor 'vim' +``` + +### ⚡ Initialize git submodules + +In order to download project submodules, enter the following command + +```bash +git submodule update --init --recursive +``` + +or execute + +```bash +./init_submodules.sh +``` + +--- + +🚀 Installation +--------------- + +### Step 1: Simply enter following command in your terminal + +```bash +./update.sh +``` + +or: + +```bash +git submodule update --init --recursive +``` + +🔥 Usage +-------- + +Enter following command in your terminal: + +```bash +./recipe_essentials.sh +``` + +📝 Notes +-------- + +Where to find default `.desktop` shortcuts on ubuntu ? + +```bash +# default applications .desktop files can be found here +/usr/share/applications/ +# or here +~/.local/share/applications/ +``` + +```bash +# snap applications .desktop files can be found here +/var/lib/snapd/desktop/applications/ +``` + +Where to find executables on ubuntu ? + +```bash +# snap packages can be found here: +/snap +``` + +How to autostart an app ? + +```bash +# place .desktop file here +~/.config/autostart/ +``` + +Where to find repositories `sources.list` ? + +```bash +/etc/apt/sources.list +/etc/apt/sources.list.d +``` + +🤝 Contributing +--------------- + +Thank you for your interest in contributing to **TangoMan Provisions**. + +Please review the [code of conduct](https://github.com/TangoMan75/provisions/blob/master/CODE_OF_CONDUCT.md) and [contribution guidelines](https://github.com/TangoMan75/provisions/blob/master/CONTRIBUTION.md) before starting to work on any features. + +If you want to open an issue, please check first if it was not [reported already](https://github.com/TangoMan75/provisions/issues) before creating a new one. + +📜 License +---------- + +Copyrights (c) 2024 "Matthias Morin" <mat@tangoman.io> + +[![License](https://img.shields.io/badge/Licence-MIT-green.svg)](LICENSE) +Distributed under the MIT license. + +If you like **TangoMan Provisions** please star, follow or tweet: + +[![GitHub stars](https://img.shields.io/github/stars/TangoMan75/provisions?style=social)](https://github.com/TangoMan75/provisions/stargazers) +[![GitHub followers](https://img.shields.io/github/followers/TangoMan75?style=social)](https://github.com/TangoMan75) +[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2FTangoMan75%2Fprovisions)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FTangoMan75%2Fprovisions) + +... And check my other cool projects. diff --git a/ai/install_fabric.sh b/ai/install_fabric.sh new file mode 100755 index 0000000..029c93a --- /dev/null +++ b/ai/install_fabric.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * fabric +# * +# * @category ai +# * @link https://github.com/danielmiessler/fabric +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'" + exit 1 +fi + +if [ ! -x "$(command -v pipx)" ]; then + echo_error "\"$(basename "${0}")\" requires pipx, try: 'sudo apt-get install -y pipx'" + exit 1 +fi + +# -------------------------------------------------- + +PROJECT=fabric +AUTHOR=danielmiessler +REPOSITORY=${AUTHOR}/${PROJECT} +MAIN_BRANCH=main + +# -------------------------------------------------- + +REMOTE_FILE="${MAIN_BRANCH}.zip" +TEMP="$(mktemp -d)" +ARCHIVE="${TEMP}/${REMOTE_FILE}" +DESTINATION=~/.fabric + +# -------------------------------------------------- + +# Download source +URL=https://github.com/${REPOSITORY}/archive/refs/heads/${REMOTE_FILE} + +# -------------------------------------------------- + +alert_primary "Install ${PROJECT}" + +# -------------------------------------------------- + +if [ -x "$(command -v curl)" ]; then + # download latest version from github with curl + echo_info "curl -L \"${URL}\" -o \"${ARCHIVE}\"" + curl -L "${URL}" -o "${ARCHIVE}" + +elif [ -x "$(command -v wget)" ]; then + # download latest version from github with wget + echo_info "wget -nv \"${URL}\" -O \"${ARCHIVE}\"" + wget -nv "${URL}" -O "${ARCHIVE}" +fi + +# -------------------------------------------------- + +# create destination folder +if [ ! -d "${DESTINATION}" ]; then + echo_info "mkdir -p \"${DESTINATION}\"" + mkdir -p "${DESTINATION}" +fi + +# -------------------------------------------------- + +# ${ARCHIVE##*.} : This is a parameter expansion expression +# ## : Removes the shortest pattern that matches the entire string from the end of the value +# * : Matches zero or more characters +# . : Matches a literal dot (.) +if [ "${ARCHIVE##*.}" = 'gz' ]; then + # extract source with tar + # -C, --directory [DIR] : destination directory + # -x, --extract + # -v, --verbose + # -z, --gzip, --gunzip --ungzip + # -f, --file [ARCHIVE] + echo_info "tar -C \"${TEMP}\" -xzf \"${ARCHIVE}\"" + tar -C "${TEMP}" -xzf "${ARCHIVE}" + +elif [ "${ARCHIVE##*.}" = 'zip' ]; then + # extract source with unzip + echo_info "unzip \"${ARCHIVE}\" -d \"${TEMP}\"" + unzip "${ARCHIVE}" -d "${TEMP}" +fi + +# -------------------------------------------------- + +# move extacted folder to destination +EXTRACTION_FOLDER="${TEMP}/${PROJECT}-${MAIN_BRANCH}" +echo_info "cp -rfT \"${EXTRACTION_FOLDER}\" \"${DESTINATION}\"" +cp -rfT "${EXTRACTION_FOLDER}" "${DESTINATION}" + +# -------------------------------------------------- + +echo_info "pipx install \"${DESTINATION}\"" +pipx install "${DESTINATION}" + diff --git a/ai/remove_fabric.sh b/ai/remove_fabric.sh new file mode 100755 index 0000000..8cd8ced --- /dev/null +++ b/ai/remove_fabric.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove fabric +# * +# * @category ai +# * @link https://github.com/danielmiessler/fabric +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v pipx)" ]; then + echo_error "\"$(basename "${0}")\" requires pipx, try: 'sudo apt-get install -y pipx'" + exit 1 +fi + +alert_primary "Uninstall fabric" + +echo_info 'pipx uninstall fabric' +pipx uninstall fabric + +echo_info 'pipx uninstall fabric-api' +pipx uninstall fabric-api + +echo_info 'pipx uninstall fabric-webui' +pipx uninstall fabric-webui + +echo_info 'pipx uninstall save' +pipx uninstall save + +echo_info 'pipx uninstall ts' +pipx uninstall ts + +echo_info 'pipx uninstall yt' +pipx uninstall yt + +echo_info 'rm -rf ~/.fabric' +rm -rf ~/.fabric diff --git a/android/install_anbox.sh b/android/install_anbox.sh new file mode 100755 index 0000000..b144a99 --- /dev/null +++ b/android/install_anbox.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * anbox +# * +# * Android in a Box +# * +# * @note try waydroid instead +# * @category android +# * @link https://doc.ubuntu-fr.org/anbox +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap, try: 'sudo apt-get install -y snap'" + exit 1 +fi + +alert_primary 'Install Anbox' + +echo_info 'sudo snap install --devmode --beta anbox' +sudo snap install --devmode --beta anbox diff --git a/android/install_android-sdk-tools.sh b/android/install_android-sdk-tools.sh new file mode 100755 index 0000000..f0cb3dc --- /dev/null +++ b/android/install_android-sdk-tools.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * android-sdk-tools +# * +# * @category android +# * @link https://developer.android.com/studio#downloads +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install android-sdk-tools' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'" + exit 1 +fi + +echo_info 'wget -q https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip' +wget -q https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip + +echo_info 'unzip sdk-tools-linux-4333796.zip -d ./' +unzip sdk-tools-linux-4333796.zip -d ./ + +echo_info 'mv ./tools ~/.android-sdk-tools' +mv ./tools ~/.android-sdk-tools + +echo_info 'rm -f ./sdk-tools-linux-4333796.zip' +rm -f ./sdk-tools-linux-4333796.zip + diff --git a/android/install_android-tools-adb.sh b/android/install_android-tools-adb.sh new file mode 100755 index 0000000..37e8e1b --- /dev/null +++ b/android/install_android-tools-adb.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * android-tools-adb +# * +# * @category android +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install android-tools-adb' + +echo_info 'sudo apt-get install --assume-yes android-tools-adb' +sudo apt-get install --assume-yes android-tools-adb + diff --git a/android/install_android-tools-fastboot.sh b/android/install_android-tools-fastboot.sh new file mode 100755 index 0000000..a3f3a69 --- /dev/null +++ b/android/install_android-tools-fastboot.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * android-tools-fastboot +# * +# * @category android +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install android-tools-fastboot' + +echo_info 'sudo apt-get install --assume-yes android-tools-fastboot' +sudo apt-get install --assume-yes android-tools-fastboot + diff --git a/android/install_waydroid.sh b/android/install_waydroid.sh new file mode 100755 index 0000000..3e5318e --- /dev/null +++ b/android/install_waydroid.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * waydroid +# * +# * Run android apks +# * +# * ``` +# * sudo waydroid init +# * waydroid first-launch +# * waydroid app install ~/apps/com.darkempire78.opencalculator.apk +# * waydroid app launch com.darkempire78.opencalculator +# * waydroid app list +# * waydroid app remove com.darkempire78.opencalculator +# * waydroid session stop +# * ``` +# * +# * @category android +# * @link https://waydro.id +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install waydroid' + +echo_info 'sudo apt install curl ca-certificates -y' +sudo apt install curl ca-certificates -y + +echo_info 'curl https://repo.waydro.id | sudo bash' +curl https://repo.waydro.id | sudo bash + +echo_info 'sudo apt-get install --assume-yes waydroid' +sudo apt-get install --assume-yes waydroid + diff --git a/backups/.gitignore b/backups/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/browser/config_firefox.sh b/browser/config_firefox.sh new file mode 100755 index 0000000..e1276e7 --- /dev/null +++ b/browser/config_firefox.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config known ssh hosts +# * +# * @category browser +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +CONFIG_DIR="${CURDIR}/../config" + +echo_info 'rm -rf ~/.mozilla/firefox' +rm -rf ~/.mozilla/firefox + +echo_info 'rm -rf ~/.cache/mozilla/firefox' +rm -rf ~/.cache/mozilla/firefox + +# config firefox +echo_info "cp -Rfv \"${CONFIG_DIR}/home/.mozilla\" ~" +cp -Rfv "${CONFIG_DIR}/home/.mozilla" ~ diff --git a/browser/install_chrome.sh b/browser/install_chrome.sh new file mode 100755 index 0000000..b097ff5 --- /dev/null +++ b/browser/install_chrome.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * chrome +# * web browser +# * +# * @category browser +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Chrome' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'sudo sh -c echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' +sudo sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' + +echo_info 'wget -qO - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -' +wget -qO - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes google-chrome-stable' +sudo apt-get install --assume-yes google-chrome-stable + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/google-chrome.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/google-chrome.desktop "$(xdg-user-dir DESKTOP)" diff --git a/browser/install_chrome_version.sh b/browser/install_chrome_version.sh new file mode 100755 index 0000000..6e8725c --- /dev/null +++ b/browser/install_chrome_version.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * chrome +# * web browser +# * +# * @category browser +# * @url https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=115.0.5790.110-1 + +alert_primary "Install Chrome ${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${VERSION}_amd64.deb\"" +wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${VERSION}_amd64.deb" + +echo_info "sudo dpkg -i \"google-chrome-stable_${VERSION}_amd64.deb\"" +sudo dpkg -i "google-chrome-stable_${VERSION}_amd64.deb" + +echo_info "rm \"google-chrome-stable_${VERSION}_amd64.deb\"" +rm "google-chrome-stable_${VERSION}_amd64.deb" + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/google-chrome.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/google-chrome.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/browser/install_firefox.sh b/browser/install_firefox.sh new file mode 100755 index 0000000..f011945 --- /dev/null +++ b/browser/install_firefox.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * firefox +# * web browser +# * +# * @category browser +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Firefox' + +echo_info 'sudo apt-get install --assume-yes firefox' +sudo apt-get install --assume-yes firefox + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/firefox.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/firefox.desktop "$(xdg-user-dir DESKTOP)" diff --git a/browser/install_geckodriver.sh b/browser/install_geckodriver.sh new file mode 100755 index 0000000..d3199ad --- /dev/null +++ b/browser/install_geckodriver.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * geckodriver +# * +# * Install geckodriver +# * +# * Alternatively run: "composer require --dev dbrekelmans/bdi && vendor/bin/bdi detect drivers" +# * +# * @category browser +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=0.28.0 + +alert_primary "Install geckdriver v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget -q https://github.com/mozilla/geckodriver/releases/download/v${VERSION}/geckodriver-v${VERSION}-linux64.tar.gz" +wget -q https://github.com/mozilla/geckodriver/releases/download/v${VERSION}/geckodriver-v${VERSION}-linux64.tar.gz + +echo_info "sudo tar -zxf geckodriver-v${VERSION}-linux64.tar.gz -C /usr/bin" +sudo tar -zxf geckodriver-v${VERSION}-linux64.tar.gz -C /usr/bin + +echo_info "rm geckodriver-v${VERSION}-linux64.tar.gz" +rm geckodriver-v${VERSION}-linux64.tar.gz + diff --git a/browser/recommended_chrome_extensions.md b/browser/recommended_chrome_extensions.md new file mode 100644 index 0000000..933fc39 --- /dev/null +++ b/browser/recommended_chrome_extensions.md @@ -0,0 +1,74 @@ +Recommended Chrome Extensions +============================= + +#chrome #browser #javascript #chromewebstore + +Examples +-------- + +- [https://github.com/orbitbot/chrome-extensions-examples](https://github.com/orbitbot/chrome-extensions-examples) + +General Purpose Extensions +-------------------------- + +- [Always Clear Downloads 2](https://chromewebstore.google.com/detail/always-clear-downloads-2/jcajchndfkmnaefkhoaoiagemplbfffn) +- [Autoskip for Youtube Ads](https://chromewebstore.google.com/detail/autoskip-for-youtube-ads/hmbnhhcgiecenbbkgdoaoafjpeaboine) +- [ESUIT | Delete My Activity for Facebook™](https://chromewebstore.google.com/detail/esuit-delete-my-activity/pehigcimajndnpmoeocbhlhljodmlbgb) +- [ESUIT | Photos Downloader for Facebook™](https://chromewebstore.google.com/detail/esuit-photos-downloader-f/djlgfdiljlmbcfimhkeenolnndblfmoo) +- [SponsorBlock for YouTube](https://chromewebstore.google.com/detail/sponsorblock-for-youtube/mnjggcdmjocbbbhaepdhchncahnbgone) +- [Tournesol Extension](https://chromewebstore.google.com/detail/tournesol-extension/nidimbejmadpggdgooppinedbggeacla) +- [uBlock Origin Lite](https://chromewebstore.google.com/detail/ublock-origin-lite/ddkjiahejlhfcafbddmgiahcphecmpfh) +- [uBlock Origin](https://chromewebstore.google.com/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm) +- [Webpage Spell-Check](https://chromewebstore.google.com/detail/webpage-spell-check/mgdhaoimpabdhmacaclbbjddhngchjik) + +Productivity +------------ + +- [Loom for Chrome](https://chromewebstore.google.com/detail/loom-for-chrome/liecbddmkiiihnedobmlmillhodjkdmb) +- [Marinara: Pomodoro Assistant)](https://chromewebstore.google.com/detail/marinara-pomodoro%C2%AE-assist/lojgmehidjdhhbmpjfamhpkpodfcodef) +- [Read Aloud: A Text to Speech Voice Reader](https://chromewebstore.google.com/detail/read-aloud-a-text-to-spee/hdhinadidafjejdhmfkjgnolgimiaplp) +- [Toggl Button: Productivity & Time Tracker](https://chromewebstore.google.com/detail/toggl-button-productivity/oejgccbfbmkkpaidnkphaiaecficdnfn) + +Security +-------- + +- [Chaff (random web traffic)](https://chromewebstore.google.com/detail/chaff/jgjhamliocfhehbocekgcddfjpgdjnje) +- [EXIF Viewer Classic](https://chromewebstore.google.com/detail/exif-viewer-classic/nafpfdcmppffipmhcpkbplhkoiekndck) +- [I don't care about cookies](https://chromewebstore.google.com/detail/i-dont-care-about-cookies/fihnjjcciajhdojfnbdddfaoknhalnja) +- [NoScript](https://chromewebstore.google.com/detail/noscript/doojmbjmlfjjnbmnoijecmcbfeoakpjm) +- [User-Agent Switcher for Chrome](https://chromewebstore.google.com/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg) + +Development +----------- + +- [Blackfire Profiler](https://chromewebstore.google.com/detail/blackfire-profiler/miefikpgahefdbcgoiicnmpbeeomffld) +- [BuiltWith Technology Profiler](https://chromewebstore.google.com/detail/builtwith-technology-prof/dapjbgnjinbpoindlpdmhochffioedbn) +- [Clear Cache](https://chromewebstore.google.com/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn) +- [ColorZilla](https://chromewebstore.google.com/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp) +- [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) +- [CSS Peeper](https://chromewebstore.google.com/detail/css-peeper/mbnbehikldjhnfehhnaidhjhoofhpehk) +- [Fake Data - A form filler you won't hate](https://chromewebstore.google.com/detail/fake-data-a-form-filler-y/gchcfdihakkhjgfmokemfeembfokkajj) +- [Fake Filler](https://chromewebstore.google.com/detail/fake-filler/bnjjngeaknajbdcgpfkgnonkmififhfo) +- [JSONView](https://chromewebstore.google.com/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc) +- [Library Sniffer](https://chromewebstore.google.com/detail/library-sniffer/fhhdlnnepfjhlhilgmeepgkhjmhhhjkh) +- [Manual Geolocation](https://chromewebstore.google.com/detail/manual-geolocation/jpiefjlgcjmciajdcinaejedejjfjgki) +- [ModHeader - Modify HTTP headers](https://chromewebstore.google.com/detail/modheader-modify-http-hea/idgpnmonknjnojddfkpgkljpfnnfcklj) +- [Open Graph Preview](https://chromewebstore.google.com/detail/open-graph-preview/ehaigphokkgebnmdiicabhjhddkaekgh) +- [React Developer Tools](https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) +- [Redux DevTools](https://chromewebstore.google.com/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) +- [Refined GitHub](https://chromewebstore.google.com/detail/refined-github/hlepfoohegkhhmjieoechaddaejaokhf) +- [User JavaScript and CSS](https://chromewebstore.google.com/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld) +- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) +- [Wappalyzer](https://chromewebstore.google.com/detail/wappalyzer/gppongmhjkpfnbhagpmjfkannfbllamg) +- [Wayback Machine](https://chromewebstore.google.com/detail/wayback-machine/fpnmgdkabkmnadcjpehmlllkndpkmiak) +- [Web Scraper](https://chromewebstore.google.com/detail/web-scraper/jnhgnonknehpejjnehehllkliplmbmhn) +- [Xdebug helper](https://chromewebstore.google.com/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc) + +SEO +--- + +- [META SEO inspector](https://chromewebstore.google.com/detail/meta-seo-inspector/ibkclpciafdglkjkcibmohobjkcfkaef) +- [Open Graph Preview](https://chromewebstore.google.com/detail/open-graph-preview/ehaigphokkgebnmdiicabhjhddkaekgh) +- [Spectrum (accessibility test)](https://chromewebstore.google.com/detail/spectrum/ofclemegkcmilinpcimpjkfhjfgmhieb) +- [Tag Inspector](https://chromewebstore.google.com/detail/tag-inspector/lhkojfnpphbdlnnlefnhdabojeafekeb) +- [Web Vitals](https://chromewebstore.google.com/detail/web-vitals/ahfhijdlegdabablpippeagghigmibma) diff --git a/browser/remove_firefox.sh b/browser/remove_firefox.sh new file mode 100755 index 0000000..bf1e85e --- /dev/null +++ b/browser/remove_firefox.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove firefox +# * +# * @category browser +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +alert_warning 'Uninstall firefox' + +# remove firefox with snap +echo_info 'sudo snap remove firefox' +sudo snap remove firefox + +# remove desktop link +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/firefox_firefox.desktop" +rm "$(xdg-user-dir DESKTOP)"/firefox_firefox.desktop + +# clear snap cache +echo_info 'sudo rm -f /var/lib/snapd/cache/*' +sudo rm -f /var/lib/snapd/cache/* + +# remove all accounts from snap +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/* + +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/* + +# remove snapshots +echo_info 'sudo rm -f /var/lib/snapd/snapshots/*' +sudo rm -f /var/lib/snapd/snapshots/* + +# remove old snaps +LANG=C snap list --all | awk '/disabled/{print $1, $3}' | +while read -r SNAPNAME revision; do + snap remove "${SNAPNAME}" --revision="${revision}" +done + +# list upgradable snaps +echo_info 'sudo snap refresh --list' +sudo snap refresh --list + diff --git a/burning/install_brasero.sh b/burning/install_brasero.sh new file mode 100755 index 0000000..bdcfe72 --- /dev/null +++ b/burning/install_brasero.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * brasero +# * +# * @category communication +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes brasero' +sudo apt-get install --assume-yes brasero diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..196e93b --- /dev/null +++ b/clean.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * clean apt +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") + +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh + +alert_secondary 'Clean' + +echo_info 'sudo apt-get purge' +sudo apt-get purge + +echo_info 'sudo apt -y autoremove --purge' +sudo apt -y autoremove --purge + +# remove /var/cache/apt/archives +echo_info 'sudo apt-get clean' +sudo apt-get clean diff --git a/communication/install_ferdium.sh b/communication/install_ferdium.sh new file mode 100755 index 0000000..955d279 --- /dev/null +++ b/communication/install_ferdium.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Ferdium +# * +# * @category communication +# * @link https://ferdium.org/download +# * @link https://github.com/ferdium/ferdium-app +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +APP_NAME=ferdium +REPOSITORY=ferdium/ferdium-app +VERSION=$(get_latest_release "${REPOSITORY}") +if [ -z "${VERSION}" ]; then + VERSION=6.2.3 +fi +FILENAME=Ferdium-linux-${VERSION}-amd64.deb +URL=https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME} + +alert_primary "Install ${APP_NAME} v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"${URL}\"" +wget "${URL}" + +echo_info "sudo dpkg -i \"${FILENAME}\"" +sudo dpkg -i "${FILENAME}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/${APP_NAME}.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/${APP_NAME}.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/communication/install_franz.sh b/communication/install_franz.sh new file mode 100755 index 0000000..f7ad100 --- /dev/null +++ b/communication/install_franz.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Franz +# * +# * @category communication +# * @link https://meetfranz.com +# * @link https://github.com/meetfranz/franz +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +APP_NAME=franz +REPOSITORY=meetfranz/franz +VERSION=$(get_latest_release "${REPOSITORY}") +if [ -z "${VERSION}" ]; then + VERSION=5.9.2 +fi +FILENAME=franz_${VERSION}_amd64.deb +URL=https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME} + +alert_primary "Install ${APP_NAME} v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"${URL}\"" +wget "${URL}" + +echo_info "sudo dpkg -i \"${FILENAME}\"" +sudo dpkg -i "${FILENAME}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/${APP_NAME}.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/${APP_NAME}.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/communication/install_skype.sh b/communication/install_skype.sh new file mode 100755 index 0000000..b750d96 --- /dev/null +++ b/communication/install_skype.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * skype +# * +# * @category communication +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap, try: 'sudo apt-get install -y snap'" + exit 1 +fi + +echo_info 'sudo snap install skype --classic' +sudo snap install skype --classic diff --git a/communication/install_slack.sh b/communication/install_slack.sh new file mode 100755 index 0000000..b4b03a3 --- /dev/null +++ b/communication/install_slack.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Slack +# * +# * @category communication +# * @link https://slack.com/downloads/linux +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +APP_NAME=slack +VERSION=4.29.149 +FILENAME=slack-desktop-${VERSION}-amd64.deb +URL=https://downloads.slack-edge.com/releases/linux/${VERSION}/prod/x64/${FILENAME} + +alert_primary "Install ${APP_NAME} v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"${URL}\"" +wget "${URL}" + +echo_info "sudo dpkg -i \"${FILENAME}\"" +sudo dpkg -i "${FILENAME}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/${APP_NAME}.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/${APP_NAME}.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/communication/install_slack_snap.sh b/communication/install_slack_snap.sh new file mode 100755 index 0000000..8e669a8 --- /dev/null +++ b/communication/install_slack_snap.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Slack +# * +# * @category communication +# * @link https://slack.com/downloads/linux +# * @note NOT RECOMMENDED: install deb version instead +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap, try: 'sudo apt-get install -y snap'" + exit 1 +fi + +alert_primary 'Install Slack' + +echo_info 'sudo snap install slack --classic' +sudo snap install slack --classic + +# create desktop shortcut +echo_info "ln -s /var/lib/snapd/desktop/applications/slack_slack.desktop \"$(xdg-user-dir DESKTOP)\"" +ln -s /var/lib/snapd/desktop/applications/slack_slack.desktop "$(xdg-user-dir DESKTOP)" diff --git a/communication/install_thunderbird.sh b/communication/install_thunderbird.sh new file mode 100755 index 0000000..d6a6095 --- /dev/null +++ b/communication/install_thunderbird.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * thunderbird +# * +# * @category communication +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes thunderbird' +sudo apt-get install --assume-yes thunderbird + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/thunderbird.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/thunderbird.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/communication/remove_slack_snap.sh b/communication/remove_slack_snap.sh new file mode 100755 index 0000000..c4d6259 --- /dev/null +++ b/communication/remove_slack_snap.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * slack +# * +# * @category communication +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap, try: 'sudo apt-get install -y snap'" + exit 1 +fi + +alert_primary 'Uninstall Slack' + +# remove slack with snap +echo_info 'sudo snap remove slack' +sudo snap remove slack + +# remove desktop link +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/slack_slack.desktop" +rm "$(xdg-user-dir DESKTOP)"/slack_slack.desktop + +# remove all accounts from snap +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/* + +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/* + +# remove snapshots +echo_info 'sudo rm -f /var/lib/snapd/snapshots/*' +sudo rm -f /var/lib/snapd/snapshots/* + +# remove old snaps +LANG=C snap list --all | awk '/disabled/{print $1, $3}' | +while read -r SNAPNAME revision; do + snap remove "${SNAPNAME}" --revision="${revision}" +done + +# list upgradable snaps +echo_info 'sudo snap refresh --list' +sudo snap refresh --list diff --git a/config/etc/default/keyboard b/config/etc/default/keyboard new file mode 100755 index 0000000..fb896b8 --- /dev/null +++ b/config/etc/default/keyboard @@ -0,0 +1,10 @@ +# KEYBOARD CONFIGURATION FILE + +# Consult the keyboard(5) manual page. + +XKBMODEL="pc105" +XKBLAYOUT="fr" +XKBVARIANT="latin9" +XKBOPTIONS="shift:breaks_caps" + +BACKSPACE="guess" diff --git a/config/gnome/dconf/org_gnome.conf b/config/gnome/dconf/org_gnome.conf new file mode 100755 index 0000000..ba16a78 --- /dev/null +++ b/config/gnome/dconf/org_gnome.conf @@ -0,0 +1,68 @@ +[Characters] +recent-characters=['⏳','✅','✌️','✓','❌','❓','❗','⨯','🇴','🌴','🍬','🍭','🍰','🎉','👀','👆','👉','👋','👌','👍','👎','💵','💶','💸','📑','📜','📝','🔗','🔥','🙁','🙂','🙏','🚀','🚨','🛠','🤑','🤔','🤦','🤯','🤷'] + +[clocks] +world-clocks=[{'location': <(uint32 2, <('Los Angeles', 'KCQT', true, [(0.59370283970450188, -2.0644336110828618)], [(0.59432360095955872, -2.063741622941031)])>)>}, {'location': <(uint32 2, <('New York', 'KNYC', true, [(0.71180344078725644, -1.2909618758762367)], [(0.71059804659265924, -1.2916478949920254)])>)>}, {'location': <(uint32 2, <('Buenos Aires', 'SADP', true, [(-0.60388392119003798, -1.0227629416686772)], [(-0.6036657550335387, -1.024028305376373)])>)>}, {'location': <(uint32 2, <('Paris', 'LFPB', true, [(0.85462956287765413, 0.042760566673861078)], [(0.8528842336256599, 0.040724343395436846)])>)>}, {'location': <(uint32 2, <('New Delhi', 'VIDP', true, [(0.49858239547081096, 1.345939747314058)], [(0.49916416607037828, 1.3473941825396225)])>)>}] + +[desktop/input-sources] +xkb-options=['shift:breaks_caps'] + +[desktop/interface] +clock-show-date=true +clock-show-weekday=true +gtk-theme='Yaru-dark' + +[desktop/privacy] +report-technical-problems=false + +[desktop/sound] +allow-volume-above-100-percent=true + +[nautilus/compression] +default-compression-format='7z' + +[system/location] +enabled=false + +[desktop/wm/keybindings] +cycle-group=['Tab'] +cycle-group-backward=['Tab'] +cycle-panels=@as [] +cycle-panels-backward=@as [] +cycle-windows=@as [] +cycle-windows-backward=@as [] +maximize=@as [] +minimize=['Down'] +move-to-monitor-down=@as [] +move-to-monitor-left=['Left'] +move-to-monitor-right=['Right'] +move-to-monitor-up=@as [] +move-to-workspace-1=@as [] +move-to-workspace-down=@as [] +move-to-workspace-last=@as [] +move-to-workspace-up=@as [] +panel-run-dialog=['r'] +raise-or-lower=@as [] +show-desktop=['d'] +switch-applications=@as [] +switch-applications-backward=@as [] +switch-panels=@as [] +switch-panels-backward=@as [] +switch-to-workspace-1=@as [] +switch-to-workspace-down=@as [] +switch-to-workspace-last=@as [] +switch-to-workspace-left=@as [] +switch-to-workspace-right=@as [] +switch-to-workspace-up=@as [] +toggle-maximized=['Up'] +unmaximize=@as [] + +[settings-daemon/plugins/media-keys] +home=['e'] +www=['b'] +custom-keybindings=['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/'] + +[settings-daemon/plugins/media-keys/custom-keybindings/custom0] +binding='e' +command='gnome-characters' +name='gnome-characters' diff --git a/config/home/.config/Code/User/keybindings.json b/config/home/.config/Code/User/keybindings.json new file mode 100644 index 0000000..51aa997 --- /dev/null +++ b/config/home/.config/Code/User/keybindings.json @@ -0,0 +1,114 @@ +// Place your key bindings in this file to override the defaultsauto[] +[ + { + "key": "ctrl+alt+up", + "command": "editor.action.insertCursorAbove", + "when": "editorTextFocus" + }, + { + "key": "shift+alt+up", + "command": "-editor.action.insertCursorAbove", + "when": "editorTextFocus" + }, + { + "key": "ctrl+alt+down", + "command": "editor.action.insertCursorBelow", + "when": "editorTextFocus" + }, + { + "key": "shift+alt+down", + "command": "-editor.action.insertCursorBelow", + "when": "editorTextFocus" + }, + { + "key": "ctrl+shift+l", + "command": "editor.action.insertCursorAtEndOfEachLineSelected", + "when": "editorTextFocus" + }, + { + "key": "shift+alt+i", + "command": "-editor.action.insertCursorAtEndOfEachLineSelected", + "when": "editorTextFocus" + }, + { + "key": "ctrl+shift+p", + "command": "workbench.action.showCommands" + }, + { + "key": "ctrl+shift+d", + "command": "editor.action.copyLinesDownAction", + "when": "editorFocus" + }, + { + "key": "ctrl+shift+down", + "command": "editor.action.moveLinesDownAction", + "when": "editorTextFocus && !editorReadonly" + }, + { + "key": "ctrl+shift+up", + "command": "editor.action.moveLinesUpAction", + "when": "editorTextFocus && !editorReadonly" + }, + { + "key": "ctrl+shift+down", + "command": "-editor.action.insertCursorBelow", + "when": "editorTextFocus" + }, + { + "key": "ctrl+shift+up", + "command": "-editor.action.insertCursorAbove", + "when": "editorTextFocus" + }, + { + "key": "ctrl+t", + "command": "workbench.action.terminal.openNativeConsole", + "when": "!terminalFocus" + }, + { + "key": "ctrl+shift+c", + "command": "-workbench.action.terminal.openNativeConsole", + "when": "!terminalFocus" + }, + { + "key": "ctrl+shift+w", + "command": "editor.action.toggleWordWrap" + }, + { + "key": "alt+z", + "command": "-editor.action.toggleWordWrap" + }, + { + "key": "ctrl+delete", + "command": "deleteAllRight" + }, + { + "key": "ctrl+shift+c", + "command": "copyRelativeFilePath", + "when": "editorFocus" + }, + { + "key": "ctrl+alt+left", + "command": "workbench.action.navigateBack" + }, + { + "key": "ctrl+alt+right", + "command": "workbench.action.navigateForward", + "when": "canNavigateForward" + }, + { + "key": "ctrl+shift+t", + "command": "workbench.action.terminal.newWithCwd", + "args": { + "cwd": "${fileDirname}" + } + }, + { + "key": "ctrl+alt+l", + "command": "editor.action.formatDocument", + "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor" + }, + { + "key": "f9", + "command": "editor.action.sortLinesAscending" + } +] \ No newline at end of file diff --git a/config/home/.config/Code/User/settings.json b/config/home/.config/Code/User/settings.json new file mode 100644 index 0000000..84688fc --- /dev/null +++ b/config/home/.config/Code/User/settings.json @@ -0,0 +1,19 @@ +{ + "editor.autoIndent": "full", + "editor.detectIndentation": true, + "editor.fontSize": 12, + "editor.formatOnPaste": false, + "editor.inlineSuggest.enabled": true, + "editor.multiCursorModifier": "alt", + "editor.snippetSuggestions": "top", + "editor.useTabStops": true, + "editor.wordWrap": "off", + "files.autoSave": "afterDelay", + "files.hotExit": "off", + "workbench.colorTheme": "Monokai", + "workbench.startupEditor": "none", + "emmet.includeLanguages": { + "twig": "html", + "volt": "html" + }, +} \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/codestyles/TangoMan.xml b/config/home/.config/JetBrains/PhpStorm/codestyles/TangoMan.xml new file mode 100755 index 0000000..1ecca07 --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/codestyles/TangoMan.xml @@ -0,0 +1,37 @@ + + + + + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Mac_OS_X_KeyMap.xml b/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Mac_OS_X_KeyMap.xml new file mode 100755 index 0000000..dadb1d2 --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Mac_OS_X_KeyMap.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Ubuntu_KeyMap.xml b/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Ubuntu_KeyMap.xml new file mode 100755 index 0000000..4a13f70 --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Ubuntu_KeyMap.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Windows_KeyMap.xml b/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Windows_KeyMap.xml new file mode 100755 index 0000000..4da67bf --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/keymaps/TangoMan_Windows_KeyMap.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/options/code.style.schemes.xml b/config/home/.config/JetBrains/PhpStorm/options/code.style.schemes.xml new file mode 100755 index 0000000..0d0ae4e --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/options/code.style.schemes.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/options/colors.scheme.xml b/config/home/.config/JetBrains/PhpStorm/options/colors.scheme.xml new file mode 100644 index 0000000..39308cd --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/options/colors.scheme.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/options/editor.xml b/config/home/.config/JetBrains/PhpStorm/options/editor.xml new file mode 100644 index 0000000..dde0699 --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/options/editor.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/options/filetypes.xml b/config/home/.config/JetBrains/PhpStorm/options/filetypes.xml new file mode 100755 index 0000000..6815c95 --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/options/filetypes.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/options/ide.general.xml b/config/home/.config/JetBrains/PhpStorm/options/ide.general.xml new file mode 100644 index 0000000..2fb54aa --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/options/ide.general.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/options/keymap.xml b/config/home/.config/JetBrains/PhpStorm/options/keymap.xml new file mode 100755 index 0000000..9cf778c --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/options/keymap.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/options/linux/keymap.xml b/config/home/.config/JetBrains/PhpStorm/options/linux/keymap.xml new file mode 100644 index 0000000..9cf778c --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/options/linux/keymap.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PhpStorm/options/projectView.xml b/config/home/.config/JetBrains/PhpStorm/options/projectView.xml new file mode 100755 index 0000000..39f82af --- /dev/null +++ b/config/home/.config/JetBrains/PhpStorm/options/projectView.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Mac_OS_X_KeyMap.xml b/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Mac_OS_X_KeyMap.xml new file mode 100755 index 0000000..d62af07 --- /dev/null +++ b/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Mac_OS_X_KeyMap.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Ubuntu_KeyMap.xml b/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Ubuntu_KeyMap.xml new file mode 100755 index 0000000..4a13f70 --- /dev/null +++ b/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Ubuntu_KeyMap.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Windows_KeyMap.xml b/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Windows_KeyMap.xml new file mode 100755 index 0000000..5dd93dd --- /dev/null +++ b/config/home/.config/JetBrains/PyCharmCE/keymaps/TangoMan_Windows_KeyMap.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/home/.config/JetBrains/PyCharmCE/options/keymap.xml b/config/home/.config/JetBrains/PyCharmCE/options/keymap.xml new file mode 100755 index 0000000..9cf778c --- /dev/null +++ b/config/home/.config/JetBrains/PyCharmCE/options/keymap.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/config/home/.config/ppsspp/PSP/SYSTEM/CACHE/UCET00844.glshadercache b/config/home/.config/ppsspp/PSP/SYSTEM/CACHE/UCET00844.glshadercache new file mode 100644 index 0000000..9f2be14 Binary files /dev/null and b/config/home/.config/ppsspp/PSP/SYSTEM/CACHE/UCET00844.glshadercache differ diff --git a/config/home/.config/ppsspp/PSP/SYSTEM/CACHE/ULUS10418.glshadercache b/config/home/.config/ppsspp/PSP/SYSTEM/CACHE/ULUS10418.glshadercache new file mode 100644 index 0000000..b41681d Binary files /dev/null and b/config/home/.config/ppsspp/PSP/SYSTEM/CACHE/ULUS10418.glshadercache differ diff --git a/config/home/.config/ppsspp/PSP/SYSTEM/controls.ini b/config/home/.config/ppsspp/PSP/SYSTEM/controls.ini new file mode 100644 index 0000000..ffd4e3d --- /dev/null +++ b/config/home/.config/ppsspp/PSP/SYSTEM/controls.ini @@ -0,0 +1,23 @@ +[ControlMapping] +Up = 1-19,10-19 +Down = 1-20,10-20 +Left = 1-21,10-21 +Right = 1-22,10-22 +Circle = 1-52,10-190 +Cross = 1-54,10-189 +Square = 1-29,10-191 +Triangle = 1-47,10-188 +Start = 1-62,10-197 +Select = 1-66,10-196 +L = 1-45,10-193 +R = 1-51,10-192 +An.Up = 1-37,10-4003 +An.Down = 1-39,10-4002 +An.Left = 1-38,10-4001 +An.Right = 1-40,10-4000 +Analog limiter = 1-60 +RapidFire = 1-59 +Fast-forward = 1-61 +SpeedToggle = 1-68 +Pause = 1-111,10-109,10-104 +Rewind = 1-67 diff --git a/config/home/.config/ppsspp/PSP/SYSTEM/ppsspp.ini b/config/home/.config/ppsspp/PSP/SYSTEM/ppsspp.ini new file mode 100644 index 0000000..e773a7c --- /dev/null +++ b/config/home/.config/ppsspp/PSP/SYSTEM/ppsspp.ini @@ -0,0 +1,459 @@ +[General] +FirstRun = False +RunCount = 3 +Enable Logging = True +AutoRun = True +Browse = False +IgnoreBadMemAccess = True +CurrentDirectory = /home/tangoman75/Games/PSP +ShowDebuggerOnLoad = False +CheckForNewVersion = True +Language = en_US +ForceLagSync2 = False +DiscordPresence = True +UISound = False +AutoLoadSaveState = 0 +EnableCheats = False +CwCheatRefreshRate = 77 +CwCheatScrollPosition = 0.000000 +GameListScrollPosition = 0.000000 +ScreenshotsAsPNG = False +UseFFV1 = False +DumpFrames = False +DumpVideoOutput = False +DumpAudio = False +SaveLoadResetsAVdumping = False +StateSlot = 0 +EnableStateUndo = True +StateLoadUndoGame = NA +StateUndoLastSaveGame = NA +StateUndoLastSaveSlot = -5 +RewindFlipFrequency = 0 +ShowOnScreenMessage = True +ShowRegionOnGameIcon = False +ShowIDOnGameIcon = False +GameGridScale = 1.000000 +GridView1 = True +GridView2 = True +GridView3 = False +RightAnalogUp = 0 +RightAnalogDown = 0 +RightAnalogLeft = 0 +RightAnalogRight = 0 +RightAnalogPress = 0 +RightAnalogCustom = False +RightAnalogDisableDiagonal = False +SwipeUp = 0 +SwipeDown = 0 +SwipeLeft = 0 +SwipeRight = 0 +SwipeSensitivity = 1.000000 +SwipeSmoothing = 0.300000 +DoubleTapGesture = 0 +GestureControlEnabled = False +ReportingHost = default +AutoSaveSymbolMap = False +CacheFullIsoInRam = False +RemoteISOPort = 0 +LastRemoteISOServer = +LastRemoteISOPort = 0 +RemoteISOManualConfig = False +RemoteShareOnStartup = False +RemoteISOSubdir = / +RemoteDebuggerOnStartup = False +InternalScreenRotation = 1 +BackgroundAnimation = 1 +TransparentBackground = True +UITint = 0.000000 +UISaturation = 1.000000 +PauseWhenMinimized = False +DumpDecryptedEboots = False +ShowMenuBar = True +MemStickInserted = True +EnablePlugins = True +IgnoreCompatSettings = +[CPU] +CPUCore = 1 +SeparateSASThread = True +IOTimingMethod = 0 +FastMemoryAccess = True +FunctionReplacements = True +HideSlowWarnings = False +HideStateWarnings = False +PreloadFunctions = False +JitDisableFlags = 0x00000000 +CPUSpeed = 0 +[Graphics] +EnableCardboardVR = False +CardboardScreenSize = 50 +CardboardXShift = 0 +CardboardYShift = 0 +ShowFPSCounter = 0 +GraphicsBackend = 0 (OPENGL) +FailedGraphicsBackends = +DisabledGraphicsBackends = +VulkanDevice = +CameraDevice = +UseGeometryShader = False +SkipBufferEffects = False +SoftwareRenderer = False +SoftwareRendererJit = True +HardwareTransform = True +SoftwareSkinning = True +TextureFiltering = 1 +BufferFiltering = 1 +InternalResolution = 0 +AndroidHwScale = 1 +HighQualityDepth = 1 +FrameSkip = 0 +FrameSkipType = 0 +AutoFrameSkip = False +StereoRendering = False +StereoToMonoShader = RedBlue +FrameRate = 0 +FrameRate2 = -1 +AnalogFrameRate = 240 +AnalogFrameRateMode = 0 +UnthrottlingMode = SKIP_FLIP +AnisotropyLevel = 4 +MultiSampleLevel = 0 +VertexDecCache = False +TextureBackoffCache = False +FullScreen = True +FullScreenMulti = False +DisplayOffsetX = 0.500000 +DisplayOffsetY = 0.500000 +DisplayScale = 1.000000 +DisplayAspectRatio = 1.000000 +DisplayStretch = False +ImmersiveMode = True +SustainedPerformanceMode = False +IgnoreScreenInsets = True +ReplaceTextures = True +SaveNewTextures = False +IgnoreTextureFilenames = False +ReplaceTexturesAllowLate = True +TexScalingLevel = 1 +TexScalingType = 0 +TexDeposterize = False +TexHardwareScaling = False +VSyncInterval = False +BloomHack = 0 +SplineBezierQuality = 2 +HardwareTessellation = False +TextureShader = Off +ShaderChainRequires60FPS = False +SkipGPUReadbacks = False +LogFrameDrops = False +InflightFrames = 3 +RenderDuplicateFrames = False +GpuLogProfiler = False +[Sound] +Enable = True +AudioBackend = 0 +ExtraAudioBuffering = False +GlobalVolume = 10 +ReverbVolume = 10 +AltSpeedVolume = -1 +AudioDevice = +AutoAudioDevice = True +[Control] +HapticFeedback = False +ShowTouchCross = True +ShowTouchCircle = True +ShowTouchSquare = True +ShowTouchTriangle = True +Custom0Mapping = 0x0000000000000000 +Custom0Image = 0 +Custom0Shape = 0 +Custom0Toggle = False +Custom0Repeat = False +Custom1Mapping = 0x0000000000000000 +Custom1Image = 1 +Custom1Shape = 0 +Custom1Toggle = False +Custom1Repeat = False +Custom2Mapping = 0x0000000000000000 +Custom2Image = 2 +Custom2Shape = 0 +Custom2Toggle = False +Custom2Repeat = False +Custom3Mapping = 0x0000000000000000 +Custom3Image = 3 +Custom3Shape = 0 +Custom3Toggle = False +Custom3Repeat = False +Custom4Mapping = 0x0000000000000000 +Custom4Image = 4 +Custom4Shape = 0 +Custom4Toggle = False +Custom4Repeat = False +Custom5Mapping = 0x0000000000000000 +Custom5Image = 0 +Custom5Shape = 1 +Custom5Toggle = False +Custom5Repeat = False +Custom6Mapping = 0x0000000000000000 +Custom6Image = 1 +Custom6Shape = 1 +Custom6Toggle = False +Custom6Repeat = False +Custom7Mapping = 0x0000000000000000 +Custom7Image = 2 +Custom7Shape = 1 +Custom7Toggle = False +Custom7Repeat = False +Custom8Mapping = 0x0000000000000000 +Custom8Image = 3 +Custom8Shape = 1 +Custom8Toggle = False +Custom8Repeat = False +Custom9Mapping = 0x0000000000000000 +Custom9Image = 4 +Custom9Shape = 1 +Custom9Toggle = False +Custom9Repeat = False +ShowTouchPause = False +ShowTouchControls = False +DisableDpadDiagonals = False +GamepadOnlyFocused = False +TouchButtonStyle = 1 +TouchButtonOpacity = 65 +TouchButtonHideSeconds = 20 +AutoCenterTouchAnalog = False +AnalogAutoRotSpeed = 8.000000 +TouchSnapToGrid = False +TouchSnapGridSize = 64 +ActionButtonSpacing2 = 1.000000 +ActionButtonCenterX = 0.789474 +ActionButtonCenterY = 0.628483 +ActionButtonScale = 1.150000 +DPadX = 0.250877 +DPadY = 0.108359 +DPadScale = 1.150000 +ShowTouchDpad = True +DPadSpacing = 1.000000 +StartKeyX = 0.661404 +StartKeyY = 0.786378 +StartKeyScale = 1.150000 +ShowTouchStart = True +SelectKeyX = 0.500000 +SelectKeyY = 0.786378 +SelectKeyScale = 1.150000 +ShowTouchSelect = True +UnthrottleKeyX = 0.338596 +UnthrottleKeyY = 0.786378 +UnthrottleKeyScale = 1.150000 +ShowTouchUnthrottle = True +LKeyX = 0.121053 +LKeyY = -0.352941 +LKeyScale = 1.150000 +ShowTouchLTrigger = True +RKeyX = 0.878947 +RKeyY = -0.352941 +RKeyScale = 1.150000 +ShowTouchRTrigger = True +AnalogStickX = 0.250877 +AnalogStickY = 0.715170 +AnalogStickScale = 1.150000 +ShowAnalogStick = True +RightAnalogStickX = 0.789474 +RightAnalogStickY = 0.715170 +RightAnalogStickScale = 1.150000 +ShowRightAnalogStick = False +fcombo0X = 0.692982 +fcombo0Y = 0.498452 +comboKeyScale0 = 1.150000 +ShowComboKey0 = False +fcombo1X = 0.854386 +fcombo1Y = 0.498452 +comboKeyScale1 = 1.150000 +ShowComboKey1 = False +fcombo2X = 1.015790 +fcombo2Y = 0.498452 +comboKeyScale2 = 1.150000 +ShowComboKey2 = False +fcombo3X = 0.692982 +fcombo3Y = 0.331269 +comboKeyScale3 = 1.150000 +ShowComboKey3 = False +fcombo4X = 0.854386 +fcombo4Y = 0.331269 +comboKeyScale4 = 1.150000 +ShowComboKey4 = False +fcombo5X = 0.305263 +fcombo5Y = 0.498452 +comboKeyScale5 = 1.150000 +ShowComboKey5 = False +fcombo6X = 0.143860 +fcombo6Y = 0.498452 +comboKeyScale6 = 1.150000 +ShowComboKey6 = False +fcombo7X = -0.015789 +fcombo7Y = 0.498452 +comboKeyScale7 = 1.150000 +ShowComboKey7 = False +fcombo8X = 0.305263 +fcombo8Y = 0.331269 +comboKeyScale8 = 1.150000 +ShowComboKey8 = False +fcombo9X = 0.143860 +fcombo9Y = 0.331269 +comboKeyScale9 = 1.150000 +ShowComboKey9 = False +AnalogDeadzone = 0.150000 +AnalogInverseDeadzone = 0.000000 +AnalogSensitivity = 1.100000 +AnalogIsCircular = False +AnalogLimiterDeadzone = 0.600000 +LeftStickHeadScale = 1.000000 +RightStickHeadScale = 1.000000 +HideStickBackground = False +UseMouse = False +MapMouse = False +ConfineMap = False +MouseSensitivity = 0.100000 +MouseSmoothing = 0.900000 +SystemControls = True +[Network] +EnableWlan = False +EnableAdhocServer = False +proAdhocServer = socom.cc +PortOffset = 10000 +MinTimeout = 0 +ForcedFirstConnect = False +EnableUPnP = False +UPnPUseOriginalPort = False +EnableNetworkChat = False +ChatButtonPosition = 0 +ChatScreenPosition = 0 +EnableQuickChat = True +QuickChat1 = Quick Chat 1 +QuickChat2 = Quick Chat 2 +QuickChat3 = Quick Chat 3 +QuickChat4 = Quick Chat 4 +QuickChat5 = Quick Chat 5 +[SystemParam] +PSPModel = 1 +PSPFirmwareVersion = 660 +NickName = PPSSPP +MacAddress = 94:5f:d5:99:7b:89 +Language = 1 +ParamTimeFormat = 0 +ParamDateFormat = 0 +TimeZone = 0 +DayLightSavings = False +ButtonPreference = 1 +LockParentalLevel = 0 +WlanAdhocChannel = 0 +BypassOSKWithKeyboard = False +WlanPowerSave = False +EncryptSave = True +SavedataUpgradeVersion = True +MemStickSize = 16 +[Debugger] +DisasmWindowX = -1 +DisasmWindowY = -1 +DisasmWindowW = -1 +DisasmWindowH = -1 +GEWindowX = -1 +GEWindowY = -1 +GEWindowW = -1 +GEWindowH = -1 +GEWindowTabsBL = 0x00000000 +GEWindowTabsBR = 0x00000000 +GEWindowTabsTR = 0x00000000 +ConsoleWindowX = -1 +ConsoleWindowY = -1 +FontWidth = 8 +FontHeight = 12 +DisplayStatusBar = True +ShowBottomTabTitles = True +ShowDeveloperMenu = False +SkipDeadbeefFilling = False +FuncHashMap = False +MemInfoDetailed = False +DrawFrameGraph = False +[Upgrade] +UpgradeMessage = +UpgradeVersion = +DismissedVersion = +[Theme] +ThemeName = Default +[VR] +VREnable = True +VREnable6DoF = True +VREnableStereo = False +VREnableMotions = True +VRbForce72Hz = True +VRCameraDistance = 0.000000 +VRCameraHeight = 0.000000 +VRCameraSide = 0.000000 +VRCanvasDistance = 12.000000 +VRFieldOfView = 100.000000 +VRHeadUpDisplayScale = 0.300000 +VRMotionLength = 0.500000 +[Recent] +MaxRecent = 60 +FileName0 = /home/tangoman75/Games/PSP/Rock_Band_Unplugged.cso +[Log] +SYSTEMEnabled = True +SYSTEMLevel = 2 +BOOTEnabled = True +BOOTLevel = 2 +COMMONEnabled = True +COMMONLevel = 2 +CPUEnabled = True +CPULevel = 2 +FILESYSEnabled = True +FILESYSLevel = 2 +G3DEnabled = True +G3DLevel = 2 +HLEEnabled = True +HLELevel = 2 +JITEnabled = True +JITLevel = 2 +LOADEREnabled = True +LOADERLevel = 2 +MEEnabled = True +MELevel = 2 +MEMMAPEnabled = True +MEMMAPLevel = 2 +SASMIXEnabled = True +SASMIXLevel = 2 +SAVESTATEEnabled = True +SAVESTATELevel = 2 +FRAMEBUFEnabled = True +FRAMEBUFLevel = 2 +AUDIOEnabled = True +AUDIOLevel = 2 +IOEnabled = True +IOLevel = 2 +SCEAUDIOEnabled = True +SCEAUDIOLevel = 2 +SCECTRLEnabled = True +SCECTRLLevel = 2 +SCEDISPEnabled = True +SCEDISPLevel = 2 +SCEFONTEnabled = True +SCEFONTLevel = 2 +SCEGEEnabled = True +SCEGELevel = 2 +SCEINTCEnabled = True +SCEINTCLevel = 2 +SCEIOEnabled = True +SCEIOLevel = 2 +SCEKERNELEnabled = True +SCEKERNELLevel = 2 +SCEMODULEEnabled = True +SCEMODULELevel = 2 +SCENETEnabled = True +SCENETLevel = 2 +SCERTCEnabled = True +SCERTCLevel = 2 +SCESASEnabled = True +SCESASLevel = 2 +SCEUTILEnabled = True +SCEUTILLevel = 2 +SCEMISCEnabled = True +SCEMISCLevel = 2 diff --git a/config/home/.config/sublime-text/Installed Packages/Advanced CSV.sublime-package b/config/home/.config/sublime-text/Installed Packages/Advanced CSV.sublime-package new file mode 100644 index 0000000..a106144 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Advanced CSV.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Alignment.sublime-package b/config/home/.config/sublime-text/Installed Packages/Alignment.sublime-package new file mode 100644 index 0000000..a31e640 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Alignment.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/AutoFileName.sublime-package b/config/home/.config/sublime-text/Installed Packages/AutoFileName.sublime-package new file mode 100644 index 0000000..e93e128 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/AutoFileName.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/DocBlockr.sublime-package b/config/home/.config/sublime-text/Installed Packages/DocBlockr.sublime-package new file mode 100644 index 0000000..83453b4 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/DocBlockr.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Dockerfile Syntax Highlighting.sublime-package b/config/home/.config/sublime-text/Installed Packages/Dockerfile Syntax Highlighting.sublime-package new file mode 100644 index 0000000..13ab65a Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Dockerfile Syntax Highlighting.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/DotENV.sublime-package b/config/home/.config/sublime-text/Installed Packages/DotENV.sublime-package new file mode 100644 index 0000000..30113d7 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/DotENV.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/EasyDiff.sublime-package b/config/home/.config/sublime-text/Installed Packages/EasyDiff.sublime-package new file mode 100644 index 0000000..d82d64f Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/EasyDiff.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Emmet.sublime-package b/config/home/.config/sublime-text/Installed Packages/Emmet.sublime-package new file mode 100644 index 0000000..14796fe Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Emmet.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Indent XML.sublime-package b/config/home/.config/sublime-text/Installed Packages/Indent XML.sublime-package new file mode 100644 index 0000000..f6ad6a6 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Indent XML.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Javascript Beautify.sublime-package b/config/home/.config/sublime-text/Installed Packages/Javascript Beautify.sublime-package new file mode 100644 index 0000000..43830b4 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Javascript Beautify.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Markdown HTML Preview.sublime-package b/config/home/.config/sublime-text/Installed Packages/Markdown HTML Preview.sublime-package new file mode 100644 index 0000000..7560905 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Markdown HTML Preview.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/MarkdownPreview.sublime-package b/config/home/.config/sublime-text/Installed Packages/MarkdownPreview.sublime-package new file mode 100644 index 0000000..7d1246d Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/MarkdownPreview.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/PHP-Twig.sublime-package b/config/home/.config/sublime-text/Installed Packages/PHP-Twig.sublime-package new file mode 100644 index 0000000..36aabc3 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/PHP-Twig.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Pretty JSON.sublime-package b/config/home/.config/sublime-text/Installed Packages/Pretty JSON.sublime-package new file mode 100644 index 0000000..db1ddca Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Pretty JSON.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Sass.sublime-package b/config/home/.config/sublime-text/Installed Packages/Sass.sublime-package new file mode 100644 index 0000000..560c689 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Sass.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/SublimeLinter-shellcheck.sublime-package b/config/home/.config/sublime-text/Installed Packages/SublimeLinter-shellcheck.sublime-package new file mode 100644 index 0000000..4ac1b1e Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/SublimeLinter-shellcheck.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/SublimeLinter.sublime-package b/config/home/.config/sublime-text/Installed Packages/SublimeLinter.sublime-package new file mode 100644 index 0000000..19a7589 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/SublimeLinter.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Table Editor.sublime-package b/config/home/.config/sublime-text/Installed Packages/Table Editor.sublime-package new file mode 100644 index 0000000..fbc82f7 Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Table Editor.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Text Pastry.sublime-package b/config/home/.config/sublime-text/Installed Packages/Text Pastry.sublime-package new file mode 100644 index 0000000..f7d114e Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Text Pastry.sublime-package differ diff --git a/config/home/.config/sublime-text/Installed Packages/Trimmer.sublime-package b/config/home/.config/sublime-text/Installed Packages/Trimmer.sublime-package new file mode 100644 index 0000000..e9fa84c Binary files /dev/null and b/config/home/.config/sublime-text/Installed Packages/Trimmer.sublime-package differ diff --git a/config/home/.config/sublime-text/Packages/User/ASP.sublime-settings b/config/home/.config/sublime-text/Packages/User/ASP.sublime-settings new file mode 100644 index 0000000..4e64e1f --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/ASP.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "vbs" + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/AdvancedCSV.sublime-settings b/config/home/.config/sublime-text/Packages/User/AdvancedCSV.sublime-settings new file mode 100644 index 0000000..9e2a1cc --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/AdvancedCSV.sublime-settings @@ -0,0 +1,11 @@ +{ + "auto_indent": false, + "translate_tabs_to_spaces": false, + "delimiter_mapping": { + "*.csv": ",", + "*.md": "|", + "*.tsv": "\t" + }, + "delimiter": ",", + "auto_quote": true +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Bash.sublime-settings b/config/home/.config/sublime-text/Packages/User/Bash.sublime-settings new file mode 100644 index 0000000..3491c3a --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Bash.sublime-settings @@ -0,0 +1,7 @@ +{ + "extensions": + [ + "zsh-theme", + ".zshrc" + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/CSS.sublime-settings b/config/home/.config/sublime-text/Packages/User/CSS.sublime-settings new file mode 100644 index 0000000..be39478 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/CSS.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "scss" + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/CSScomb.sublime-settings b/config/home/.config/sublime-text/Packages/User/CSScomb.sublime-settings new file mode 100644 index 0000000..85c07d9 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/CSScomb.sublime-settings @@ -0,0 +1,378 @@ +{ + // If plugin has trouble finding Node.js, replace this string with path + // to your `node` bin + "node-path" : ":/usr/local/bin", + + // Full list of supported options and acceptable values can be found here: + // https://github.com/csscomb/csscomb.js/blob/master/doc/options.md + "config": { + + // Whether to add a semicolon after the last value/mixin. + "always-semicolon": false, + + // Set indent for code inside blocks, including media queries and nested rules. + "block-indent": " ", + + // Unify case of hexadecimal colors. + "color-case": "lower", + + // Whether to expand hexadecimal colors or use shorthands. + "color-shorthand": false, + + // Unify case of element selectors. + "element-case": "lower", + + // Add/remove line break at EOF. + "eof-newline": true, + + // Add/remove leading zero in dimensions. + "leading-zero": false, + + // Unify quotes style. + "quotes": "single", + + // Remove all rulesets that contain nothing but spaces. + "remove-empty-rulesets": true, + + // Set space after `:` in declarations. + "space-after-colon": " ", + + // Set space after combinator (for example, in selectors like `p > a`). + "space-after-combinator": " ", + + // Set space after `{`. + "space-after-opening-brace": "\n", + + // Set space after selector delimiter. + "space-after-selector-delimiter": "\n", + + // Set space before `}`. + "space-before-closing-brace": "\n", + + // Set space before `:` in declarations. + "space-before-colon": "", + + // Set space before combinator (for example, in selectors like `p > a`). + "space-before-combinator": "\n", + + // Set space before `{`. + "space-before-opening-brace": " ", + + // Set space before selector delimiter. + "space-before-selector-delimiter": "", + + // Set space between declarations (i.e. `color: tomato`). + "space-between-declarations": "\n", + + // Whether to trim trailing spaces. + "strip-spaces": true, + + // Whether to remove units in zero-valued dimensions. + "unitless-zero": true, + + // Whether to align prefixes in properties and values. + "vendor-prefix-align": true, + + // Sort properties in particular order. + "sort-order": [ + [ + "font", + "font-family", + "font-size", + "font-weight", + "font-style", + "font-variant", + "font-size-adjust", + "font-stretch", + "font-effect", + "font-emphasize", + "font-emphasize-position", + "font-emphasize-style", + "font-smooth", + "line-height" + ], + [ + "position", + "z-index", + "top", + "right", + "bottom", + "left" + ], + [ + "display", + "visibility", + "float", + "clear", + "overflow", + "overflow-x", + "overflow-y", + "-ms-overflow-x", + "-ms-overflow-y", + "clip", + "zoom", + "flex-direction", + "flex-order", + "flex-pack", + "flex-align" + ], + [ + "-webkit-box-sizing", + "-moz-box-sizing", + "box-sizing", + "width", + "min-width", + "max-width", + "height", + "min-height", + "max-height", + "margin", + "margin-top", + "margin-right", + "margin-bottom", + "margin-left", + "padding", + "padding-top", + "padding-right", + "padding-bottom", + "padding-left" + ], + [ + "table-layout", + "empty-cells", + "caption-side", + "border-spacing", + "border-collapse", + "list-style", + "list-style-position", + "list-style-type", + "list-style-image" + ], + [ + "content", + "quotes", + "counter-reset", + "counter-increment", + "resize", + "cursor", + "-webkit-user-select", + "-moz-user-select", + "-ms-user-select", + "user-select", + "nav-index", + "nav-up", + "nav-right", + "nav-down", + "nav-left", + "-webkit-transition", + "-moz-transition", + "-ms-transition", + "-o-transition", + "transition", + "-webkit-transition-delay", + "-moz-transition-delay", + "-ms-transition-delay", + "-o-transition-delay", + "transition-delay", + "-webkit-transition-timing-function", + "-moz-transition-timing-function", + "-ms-transition-timing-function", + "-o-transition-timing-function", + "transition-timing-function", + "-webkit-transition-duration", + "-moz-transition-duration", + "-ms-transition-duration", + "-o-transition-duration", + "transition-duration", + "-webkit-transition-property", + "-moz-transition-property", + "-ms-transition-property", + "-o-transition-property", + "transition-property", + "-webkit-transform", + "-moz-transform", + "-ms-transform", + "-o-transform", + "transform", + "-webkit-transform-origin", + "-moz-transform-origin", + "-ms-transform-origin", + "-o-transform-origin", + "transform-origin", + "-webkit-animation", + "-moz-animation", + "-ms-animation", + "-o-animation", + "animation", + "-webkit-animation-name", + "-moz-animation-name", + "-ms-animation-name", + "-o-animation-name", + "animation-name", + "-webkit-animation-duration", + "-moz-animation-duration", + "-ms-animation-duration", + "-o-animation-duration", + "animation-duration", + "-webkit-animation-play-state", + "-moz-animation-play-state", + "-ms-animation-play-state", + "-o-animation-play-state", + "animation-play-state", + "-webkit-animation-timing-function", + "-moz-animation-timing-function", + "-ms-animation-timing-function", + "-o-animation-timing-function", + "animation-timing-function", + "-webkit-animation-delay", + "-moz-animation-delay", + "-ms-animation-delay", + "-o-animation-delay", + "animation-delay", + "-webkit-animation-iteration-count", + "-moz-animation-iteration-count", + "-ms-animation-iteration-count", + "-o-animation-iteration-count", + "animation-iteration-count", + "-webkit-animation-direction", + "-moz-animation-direction", + "-ms-animation-direction", + "-o-animation-direction", + "animation-direction", + "text-align", + "-webkit-text-align-last", + "-moz-text-align-last", + "-ms-text-align-last", + "text-align-last", + "vertical-align", + "white-space", + "text-decoration", + "text-emphasis", + "text-emphasis-color", + "text-emphasis-style", + "text-emphasis-position", + "text-indent", + "-ms-text-justify", + "text-justify", + "letter-spacing", + "word-spacing", + "-ms-writing-mode", + "text-outline", + "text-transform", + "text-wrap", + "text-overflow", + "-ms-text-overflow", + "text-overflow-ellipsis", + "text-overflow-mode", + "-ms-word-wrap", + "word-wrap", + "word-break", + "-ms-word-break", + "-moz-tab-size", + "-o-tab-size", + "tab-size", + "-webkit-hyphens", + "-moz-hyphens", + "hyphens", + "pointer-events" + ], + [ + "opacity", + "filter:progid:DXImageTransform.Microsoft.Alpha(Opacity", + "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha", + "-ms-interpolation-mode", + "color", + "border", + "border-width", + "border-style", + "border-color", + "border-top", + "border-top-width", + "border-top-style", + "border-top-color", + "border-right", + "border-right-width", + "border-right-style", + "border-right-color", + "border-bottom", + "border-bottom-width", + "border-bottom-style", + "border-bottom-color", + "border-left", + "border-left-width", + "border-left-style", + "border-left-color", + "-webkit-border-radius", + "-moz-border-radius", + "border-radius", + "-webkit-border-top-left-radius", + "-moz-border-radius-topleft", + "border-top-left-radius", + "-webkit-border-top-right-radius", + "-moz-border-radius-topright", + "border-top-right-radius", + "-webkit-border-bottom-right-radius", + "-moz-border-radius-bottomright", + "border-bottom-right-radius", + "-webkit-border-bottom-left-radius", + "-moz-border-radius-bottomleft", + "border-bottom-left-radius", + "-webkit-border-image", + "-moz-border-image", + "-o-border-image", + "border-image", + "-webkit-border-image-source", + "-moz-border-image-source", + "-o-border-image-source", + "border-image-source", + "-webkit-border-image-slice", + "-moz-border-image-slice", + "-o-border-image-slice", + "border-image-slice", + "-webkit-border-image-width", + "-moz-border-image-width", + "-o-border-image-width", + "border-image-width", + "-webkit-border-image-outset", + "-moz-border-image-outset", + "-o-border-image-outset", + "border-image-outset", + "-webkit-border-image-repeat", + "-moz-border-image-repeat", + "-o-border-image-repeat", + "border-image-repeat", + "outline", + "outline-width", + "outline-style", + "outline-color", + "outline-offset", + "background", + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", + "background-color", + "background-image", + "background-repeat", + "background-attachment", + "background-position", + "background-position-x", + "-ms-background-position-x", + "background-position-y", + "-ms-background-position-y", + "-webkit-background-clip", + "-moz-background-clip", + "background-clip", + "background-origin", + "-webkit-background-size", + "-moz-background-size", + "-o-background-size", + "background-size", + "box-decoration-break", + "-webkit-box-shadow", + "-moz-box-shadow", + "box-shadow", + "filter:progid:DXImageTransform.Microsoft.gradient", + "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient", + "text-shadow" + ] + ] + } +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Context (Linux).sublime-menu b/config/home/.config/sublime-text/Packages/User/Context (Linux).sublime-menu new file mode 100644 index 0000000..0089cb9 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Context (Linux).sublime-menu @@ -0,0 +1,44 @@ +[ + { + "caption": "-" + }, + { + "caption": "Open Terminal Here", + "command": "terminal" + }, + { + "caption": "Execute This", + "command": "execute" + }, + { + "caption": "Shellcheck This", + "command": "shellcheck" + }, + { + "caption": "-" + }, + { + "command": "easy_diff_compare_both", + "args": { + "clipboard": true + } + }, + { + "caption": "Git Diff", + "command": "easy_diff_git" + }, + { + "caption": "Git Diff with Previous Revision", + "command": "easy_diff_git", + "args": { + "last": true + } + }, + { + "caption": "-" + }, + { + "caption": "Format PHP Array Console Dump", + "command": "format_php_array" + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Context (Windows).sublime-menu b/config/home/.config/sublime-text/Packages/User/Context (Windows).sublime-menu new file mode 100644 index 0000000..2c0f269 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Context (Windows).sublime-menu @@ -0,0 +1,44 @@ +[ + { + "caption": "-" + }, + { + "caption": "Open Command Prompt/Git Bash Here", + "command": "terminal" + }, + { + "caption": "Execute This", + "command": "execute" + }, + { + "caption": "Shellcheck This", + "command": "shellcheck" + }, + { + "caption": "-" + }, + { + "command": "easy_diff_compare_both", + "args": { + "clipboard": true + } + }, + { + "caption": "Git Diff", + "command": "easy_diff_git" + }, + { + "caption": "Git Diff with Previous Revision", + "command": "easy_diff_git", + "args": { + "last": true + } + }, + { + "caption": "-" + }, + { + "caption": "Format PHP Array Console Dump", + "command": "format_php_array" + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Context.sublime-menu b/config/home/.config/sublime-text/Packages/User/Context.sublime-menu new file mode 100644 index 0000000..0089cb9 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Context.sublime-menu @@ -0,0 +1,44 @@ +[ + { + "caption": "-" + }, + { + "caption": "Open Terminal Here", + "command": "terminal" + }, + { + "caption": "Execute This", + "command": "execute" + }, + { + "caption": "Shellcheck This", + "command": "shellcheck" + }, + { + "caption": "-" + }, + { + "command": "easy_diff_compare_both", + "args": { + "clipboard": true + } + }, + { + "caption": "Git Diff", + "command": "easy_diff_git" + }, + { + "caption": "Git Diff with Previous Revision", + "command": "easy_diff_git", + "args": { + "last": true + } + }, + { + "caption": "-" + }, + { + "caption": "Format PHP Array Console Dump", + "command": "format_php_array" + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Default (Linux).sublime-keymap b/config/home/.config/sublime-text/Packages/User/Default (Linux).sublime-keymap new file mode 100644 index 0000000..5e31ca6 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Default (Linux).sublime-keymap @@ -0,0 +1,163 @@ +[ + // Basic settings + { "keys": ["alt+ctrl+down"], "command": "select_lines", "args": { "forward": true } }, + { "keys": ["alt+ctrl+up"], "command": "select_lines", "args": { "forward": false } }, + { "keys": ["ctrl+c"], "command": "copy" }, + { "keys": ["ctrl+d"], "command": "find_under_expand" }, + { "keys": ["ctrl+end"], "command": "move_to", "args": { "to": "eof", "extend": false } }, + { "keys": ["ctrl+f4"], "command": "close_file" }, + { "keys": ["ctrl+f9"], "command": "sort_lines", "args": { "case_sensitive": true } }, + { "keys": ["ctrl+home"], "command": "move_to", "args": { "to": "bof", "extend": false } }, + { "keys": ["ctrl+k", "ctrl+l"], "command": "lower_case" }, + { "keys": ["ctrl+k", "ctrl+u"], "command": "upper_case" }, + { "keys": ["ctrl+l"], "command": "expand_selection", "args": {"to": "line"} }, + { "keys": ["ctrl+left"], "command": "move", "args": { "by": "words", "forward": false } }, + { "keys": ["ctrl+n"], "command": "new_file" }, + { "keys": ["ctrl+right"], "command": "move", "args": { "by": "word_ends", "forward": true } }, + { "keys": ["ctrl+shift+d"], "command": "duplicate_line" }, + { "keys": ["ctrl+shift+down"], "command": "swap_line_down" }, + { "keys": ["ctrl+shift+end"], "command": "move_to", "args": { "to": "eof", "extend": true } }, + { "keys": ["ctrl+shift+home"], "command": "move_to", "args": { "to": "bof", "extend": true } }, + { "keys": ["ctrl+shift+l"], "command": "split_selection_into_lines" }, + { "keys": ["ctrl+shift+left"], "command": "move", "args": { "by": "words", "forward": false, "extend": true } }, + { "keys": ["ctrl+shift+right"], "command": "move", "args": { "by": "word_ends", "forward": true, "extend": true } }, + { "keys": ["ctrl+shift+s"], "command": "prompt_save_as" }, + { "keys": ["ctrl+shift+t"], "command": "reopen_last_file" }, + { "keys": ["ctrl+shift+up"], "command": "swap_line_up" }, + { "keys": ["ctrl+v"], "command": "paste" }, + { "keys": ["ctrl+x"], "command": "cut" }, + { "keys": ["end"], "command": "move_to", "args": { "to": "eol", "extend": false } }, + { "keys": ["f3"], "command": "find_next" }, + { "keys": ["f9"], "command": "sort_lines", "args": { "case_sensitive": false } }, + { "keys": ["home"], "command": "move_to", "args": { "to": "bol", "extend": false } }, + { "keys": ["shift+end"], "command": "move_to", "args": { "to": "eol", "extend": true } }, + { "keys": ["shift+home"], "command": "move_to", "args": { "to": "bol", "extend": true } }, + { "keys": ["shift+left"], "command": "move", "args": { "by": "characters", "forward": false, "extend": true } }, + { "keys": ["shift+right"], "command": "move", "args": { "by": "characters", "forward": true, "extend": true } }, + { "keys": ["ctrl+/"], "command": "toggle_comment", "args": { "block": true } }, + { "keys": ["ctrl+shift+/"], "command": "toggle_comment", "args": { "block": false } }, + + // Custom keymap + { "keys": ["ctrl+alt+c"], "command": "show_panel", "args": { "panel": "console", "toggle": true } }, + { "keys": ["ctrl+alt+i"], "command": "reindent", "args": { "single_line": false } }, + { "keys": ["ctrl+alt+s"], "command": "save_all", "args": {"encoding": "UTF-8"} }, + { "keys": ["ctrl+alt+w"], "command": "toggle_setting", "args": { "setting": "word_wrap" } }, + { "keys": ["ctrl+delete"], "command": "run_macro_file", "args": { "file": "res://Packages/Default/Delete to Hard EOL.sublime-macro" } }, + { "keys": ["ctrl+e"], "command": "open_dir", "args": { "dir": "$file_path", "file": "$file_name" } }, + { "keys": ["ctrl+i"], "command": "expand_tabs", "args": {"set_translate_tabs": true} }, + { "keys": ["ctrl+t"], "command": "terminal" }, + { "keys": ["ctrl+shift+t"], "command": "execute" }, + // { "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" }, + // { "keys": ["ctrl+k"], "command": "select_lines", "args": {"forward": true} }, + { "keys": ["ctrl+shift+c"], "command": "show_panel", "args": { "panel": "console", "toggle": true } }, + { "keys": ["ctrl+shift+i"], "command": "unexpand_tabs", "args": { "set_translate_tabs": true } }, + { "keys": ["ctrl+shift+k"], "command": "select_lines", "args": { "forward": false } }, + { "keys": ["ctrl+shift+w"], "command": "toggle_setting", "args": { "setting": "word_wrap" } }, + // { "keys": ["ctrl+t"], "command": "new_file" }, + // { "keys": ["ctrl+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/Snippets/long-tag.sublime-snippet" } }, + { "keys": ["f4"], "command": "close_all" }, + + // Plugin settings + { "keys": ["ctrl+alt+a"], "command": "alignment" }, + { "keys": ["ctrl+alt+m"], "command": "markdown_preview", "args": { "target": "browser", "parser": "markdown" } }, + { "keys": ["ctrl+alt+space"], "command": "trimmer" }, + { "keys": ["ctrl+alt+enter"], "command": "collapse_lines" }, + { "keys": ["ctrl+alt+/"], "command": "remove_comments" }, + { "keys": ["ctrl+alt+t"], "command": "markdown_table_format", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } ] }, + { "keys": ["ctrl+alt+x"], "command": "auto_indent" }, + + // Macros and custom commands + // { "keys": ["ctrl+alt+s"], "command": "save_as_and_close" }, + // { "keys": ["ctrl+k", "ctrl+a"], "command": "strip_accents" }, + { "keys": ["ctrl+k", "ctrl+l"], "command": "lowercase_cycle" }, + { "keys": ["ctrl+k", "ctrl+t"], "command": "titlecase_cycle" }, + { "keys": ["ctrl+k", "ctrl+u"], "command": "uppercase_cycle" }, + { "keys": ["ctrl+shift+delete"], "command": "run_macro_file", "args": { "file": "res://Packages/User/Delete to EOF.sublime-macro" } }, + { "keys": ["f5"], "command": "insert_datetime" }, + { "keys": ["ctrl+f5"], "command": "insert_date" }, + { "keys": ["ctrl+shift+r"], "command": "rename_log" }, + + // Advanced CSV settings (Context specific) + { "keys": ["ctrl+down"], "command": "csv_sort_by_col_asc", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+enter"], "command": "csv_format_expand", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+shift+insert"], "command": "csv_insert_col", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+shift+delete"], "command": "csv_delete_col", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+shift+enter"], "command": "csv_format_compact", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+up"], "command": "csv_sort_by_col_desc", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + + // View Layout + { + "keys": ["ctrl+alt+1"], + "command": "set_layout", + "args": + { + "cols": [0.0, 1.0], + "rows": [0.0, 1.0], + "cells": [[0, 0, 1, 1]] + } + }, + { + "keys": ["ctrl+alt+2"], + "command": "set_layout", + "args": + { + "cols": [0.0, 0.5, 1.0], + "rows": [0.0, 1.0], + "cells": [[0, 0, 1, 1], [1, 0, 2, 1]] + } + }, + { + "keys": ["ctrl+alt+3"], + "command": "set_layout", + "args": + { + "cols": [0.0, 0.33, 0.66, 1.0], + "rows": [0.0, 1.0], + "cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1]] + } + }, + { + "keys": ["ctrl+alt+4"], + "command": "set_layout", + "args": + { + "cols": [0.0, 0.25, 0.5, 0.75, 1.0], + "rows": [0.0, 1.0], + "cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1]] + } + }, + { + "keys": ["ctrl+alt+8"], + "command": "set_layout", + "args": + { + "cols": [0.0, 1.0], + "rows": [0.0, 0.5, 1.0], + "cells": [[0, 0, 1, 1], [0, 1, 1, 2]] + } + }, + { + "keys": ["ctrl+alt+9"], + "command": "set_layout", + "args": + { + "cols": [0.0, 1.0], + "rows": [0.0, 0.33, 0.66, 1.0], + "cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]] + } + }, + { + "keys": ["ctrl+alt+5"], + "command": "set_layout", + "args": + { + "cols": [0.0, 0.5, 1.0], + "rows": [0.0, 0.5, 1.0], + "cells": + [ + [0, 0, 1, 1], [1, 0, 2, 1], + [0, 1, 1, 2], [1, 1, 2, 2] + ] + } + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Default (Linux).sublime-mousemap b/config/home/.config/sublime-text/Packages/User/Default (Linux).sublime-mousemap new file mode 100644 index 0000000..96033c4 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Default (Linux).sublime-mousemap @@ -0,0 +1,12 @@ +[ + { + "button": "button1", "count": 1, "modifiers": ["ctrl"], + "press_command": "drag_select", + "press_args": { "additive": true } + }, + { + "button": "button1", "modifiers": ["alt"], + "press_command": "drag_select", + "press_args": { "by": "columns" } + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Default (OSX).sublime-keymap b/config/home/.config/sublime-text/Packages/User/Default (OSX).sublime-keymap new file mode 100644 index 0000000..2ccaced --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Default (OSX).sublime-keymap @@ -0,0 +1,52 @@ +[ + { "keys": ["end"], "command": "move_to", "args": {"to": "eol", "extend": false} }, + { "keys": ["f3"], "command": "find_next" }, + { "keys": ["f9"], "command": "sort_lines", "args": {"case_sensitive": false} }, + { "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} }, + { "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} }, + { "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true} }, + { "keys": ["shift+left"], "command": "move", "args": {"by": "characters", "forward": false, "extend": true} }, + { "keys": ["shift+right"], "command": "move", "args": {"by": "characters", "forward": true, "extend": true} }, + { "keys": ["super+a"], "command": "select_all" }, + { "keys": ["super+c"], "command": "copy" }, + { "keys": ["super+d"], "command": "find_under_expand" }, + { "keys": ["super+end"], "command": "move_to", "args": {"to": "eof", "extend": false} }, + { "keys": ["super+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} }, + { "keys": ["super+f4"], "command": "close_file" }, + { "keys": ["super+f9"], "command": "sort_lines", "args": {"case_sensitive": true} }, + { "keys": ["super+home"], "command": "move_to", "args": {"to": "bof", "extend": false} }, + { "keys": ["super+k", "super+l"], "command": "lower_case" }, + { "keys": ["super+k", "super+u"], "command": "upper_case" }, + { "keys": ["super+left"], "command": "move", "args": {"by": "words", "forward": false} }, + { "keys": ["super+left"], "command": "move", "args": {"by": "words", "forward": false} }, + { "keys": ["super+right"], "command": "move", "args": {"by": "word_ends", "forward": true} }, + { "keys": ["super+right"], "command": "move", "args": {"by": "word_ends", "forward": true} }, + { "keys": ["super+s"], "command": "save" }, + { "keys": ["super+shift+d"], "command": "duplicate_line" }, + { "keys": ["super+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true} }, + { "keys": ["super+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true} }, + { "keys": ["super+shift+l"], "command": "split_selection_into_lines" }, { "keys": ["super+shift+down"], "command": "swap_line_down" }, + { "keys": ["super+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} }, + { "keys": ["super+shift+right"], "command": "move", "args": {"by": "word_ends", "forward": true, "extend": true} }, + { "keys": ["super+shift+s"], "command": "prompt_save_as" }, + { "keys": ["super+shift+t"], "command": "reopen_last_file" }, + { "keys": ["super+shift+up"], "command": "swap_line_up" }, + { "keys": ["super+v"], "command": "paste" }, + { "keys": ["super+x"], "command": "cut" }, + { "keys": ["super+y"], "command": "redo" }, + { "keys": ["super+z"], "command": "undo" }, + + { "keys": ["super+²"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }, + { "keys": ["super+alt+a"], "command": "alignment" }, + { "keys": ["super+alt+c"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }, + { "keys": ["super+alt+l"], "command": "reindent", "args": {"single_line": false} }, + { "keys": ["super+alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} }, + { "keys": ["super+alt+s"], "command": "save_as_and_close" }, + { "keys": ["super+alt+space"], "command": "trimmer" }, + { "keys": ["super+alt+t"], "command": "markdown_table_format", "context": [ {"key": "selector", "operator": "equal", "operand": "text.html.markdown"} ] }, + { "keys": ["super+e"], "command": "open_dir", "args": {"dir": "$file_path", "file": "$file_name"} }, + { "keys": ["super+f5"], "command": "insert_date" }, + { "keys": ["super+k", "super+t"], "command": "title_case" }, + { "keys": ["super+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/Snippets/long-tag.sublime-snippet" } }, + { "keys": ["f5"], "command": "insert_datetime" } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Default (Windows).sublime-keymap b/config/home/.config/sublime-text/Packages/User/Default (Windows).sublime-keymap new file mode 100644 index 0000000..931cfe8 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Default (Windows).sublime-keymap @@ -0,0 +1,77 @@ +[ + // Basic settings + { "keys": ["ctrl+alt+down"], "command": "select_lines", "args": { "forward": true } }, + { "keys": ["ctrl+alt+up"], "command": "select_lines", "args": { "forward": false } }, + { "keys": ["ctrl+c"], "command": "copy" }, + { "keys": ["ctrl+d"], "command": "find_under_expand" }, + { "keys": ["ctrl+end"], "command": "move_to", "args": { "to": "eof", "extend": false } }, + { "keys": ["ctrl+f4"], "command": "close_file" }, + { "keys": ["ctrl+f9"], "command": "sort_lines", "args": { "case_sensitive": true } }, + { "keys": ["ctrl+home"], "command": "move_to", "args": { "to": "bof", "extend": false } }, + { "keys": ["ctrl+k", "ctrl+l"], "command": "lower_case" }, + { "keys": ["ctrl+k", "ctrl+u"], "command": "upper_case" }, + { "keys": ["ctrl+l"], "command": "expand_selection", "args": {"to": "line"} }, + { "keys": ["ctrl+left"], "command": "move", "args": { "by": "words", "forward": false } }, + { "keys": ["ctrl+n"], "command": "new_file" }, + { "keys": ["ctrl+right"], "command": "move", "args": { "by": "word_ends", "forward": true } }, + { "keys": ["ctrl+shift+d"], "command": "duplicate_line" }, + { "keys": ["ctrl+shift+down"], "command": "swap_line_down" }, + { "keys": ["ctrl+shift+end"], "command": "move_to", "args": { "to": "eof", "extend": true } }, + { "keys": ["ctrl+shift+home"], "command": "move_to", "args": { "to": "bof", "extend": true } }, + { "keys": ["ctrl+shift+l"], "command": "split_selection_into_lines" }, + { "keys": ["ctrl+shift+left"], "command": "move", "args": { "by": "words", "forward": false, "extend": true } }, + { "keys": ["ctrl+shift+right"], "command": "move", "args": { "by": "word_ends", "forward": true, "extend": true } }, + { "keys": ["ctrl+shift+s"], "command": "prompt_save_as" }, + { "keys": ["ctrl+shift+t"], "command": "reopen_last_file" }, + { "keys": ["ctrl+shift+up"], "command": "swap_line_up" }, + { "keys": ["ctrl+v"], "command": "paste" }, + { "keys": ["ctrl+x"], "command": "cut" }, + { "keys": ["end"], "command": "move_to", "args": { "to": "eol", "extend": false } }, + { "keys": ["f3"], "command": "find_next" }, + { "keys": ["f9"], "command": "sort_lines", "args": { "case_sensitive": false } }, + { "keys": ["home"], "command": "move_to", "args": { "to": "bol", "extend": false } }, + { "keys": ["shift+end"], "command": "move_to", "args": { "to": "eol", "extend": true } }, + { "keys": ["shift+home"], "command": "move_to", "args": { "to": "bol", "extend": true } }, + { "keys": ["shift+left"], "command": "move", "args": { "by": "characters", "forward": false, "extend": true } }, + { "keys": ["shift+right"], "command": "move", "args": { "by": "characters", "forward": true, "extend": true } }, + + // Custom keymap + { "keys": ["ctrl+alt+c"], "command": "show_panel", "args": { "panel": "console", "toggle": true } }, + { "keys": ["ctrl+alt+l"], "command": "reindent", "args": { "single_line": false } }, + { "keys": ["ctrl+alt+s"], "command": "save_all", "args": {"encoding": "UTF-8"} }, + { "keys": ["ctrl+alt+w"], "command": "toggle_setting", "args": { "setting": "word_wrap" } }, + { "keys": ["ctrl+delete"], "command": "run_macro_file", "args": { "file": "res://Packages/Default/Delete to Hard EOL.sublime-macro" } }, + { "keys": ["ctrl+e"], "command": "open_dir", "args": { "dir": "$file_path", "file": "$file_name" } }, + { "keys": ["ctrl+i"], "command": "expand_tabs", "args": {"set_translate_tabs": true} }, + { "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" }, + // { "keys": ["ctrl+k"], "command": "select_lines", "args": {"forward": true} }, + { "keys": ["ctrl+shift+c"], "command": "show_panel", "args": { "panel": "console", "toggle": true } }, + { "keys": ["ctrl+shift+i"], "command": "unexpand_tabs", "args": {"set_translate_tabs": true} }, + { "keys": ["ctrl+shift+k"], "command": "select_lines", "args": {"forward": false} }, + { "keys": ["ctrl+shift+w"], "command": "toggle_setting", "args": { "setting": "word_wrap" } }, + // { "keys": ["ctrl+t"], "command": "new_file" }, + { "keys": ["ctrl+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/Snippets/long-tag.sublime-snippet" } }, + { "keys": ["f4"], "command": "close_all" }, + + // Plugin settings + { "keys": ["ctrl+alt+a"], "command": "alignment" }, + { "keys": ["ctrl+alt+m"], "command": "markdown_preview", "args": { "target": "browser", "parser": "markdown" } }, + { "keys": ["ctrl+alt+space"], "command": "trimmer" }, + { "keys": ["ctrl+alt+enter"], "command": "collapse_lines" }, + { "keys": ["ctrl+alt+/"], "command": "remove_comments" }, + { "keys": ["ctrl+alt+t"], "command": "markdown_table_format", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } ] }, + + // Macros and custom commands + // { "keys": ["ctrl+alt+s"], "command": "save_as_and_close" }, + { "keys": ["ctrl+f5"], "command": "insert_date" }, + { "keys": ["ctrl+shift+delete"], "command": "run_macro_file", "args": { "file": "res://Packages/User/Delete to EOF.sublime-macro" } }, + { "keys": ["f5"], "command": "insert_datetime" }, + + // Advanced CSV settings (Context specific) + { "keys": ["ctrl+down"], "command": "csv_sort_by_col_asc", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+enter"], "command": "csv_format_expand", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+shift+insert"], "command": "csv_insert_col", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+shift+delete"], "command": "csv_delete_col", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+shift+enter"], "command": "csv_format_compact", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] }, + { "keys": ["ctrl+up"], "command": "csv_sort_by_col_desc", "context": [ { "key": "selector", "operator": "equal", "operand": "(text.advanced_csv, text.html.markdown)" } ] } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Default (Windows).sublime-mousemap b/config/home/.config/sublime-text/Packages/User/Default (Windows).sublime-mousemap new file mode 100644 index 0000000..96033c4 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Default (Windows).sublime-mousemap @@ -0,0 +1,12 @@ +[ + { + "button": "button1", "count": 1, "modifiers": ["ctrl"], + "press_command": "drag_select", + "press_args": { "additive": true } + }, + { + "button": "button1", "modifiers": ["alt"], + "press_command": "drag_select", + "press_args": { "by": "columns" } + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Delete to EOF.sublime-macro b/config/home/.config/sublime-text/Packages/User/Delete to EOF.sublime-macro new file mode 100644 index 0000000..9a32b08 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Delete to EOF.sublime-macro @@ -0,0 +1,5 @@ +[ + { "command": "move_to", "args": { "to": "eof", "extend": true } }, + { "command": "add_to_kill_ring", "args": { "forward": true } }, + { "command": "right_delete" } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/EasyDiff/Context.sublime-menu b/config/home/.config/sublime-text/Packages/User/EasyDiff/Context.sublime-menu new file mode 100755 index 0000000..7037d62 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/EasyDiff/Context.sublime-menu @@ -0,0 +1,22 @@ +[ + { + "caption": "-" + }, + { + "command": "easy_diff_compare_both", + "args": { + "clipboard": true + } + }, + { + "caption": "Git Diff", + "command": "easy_diff_git" + }, + { + "caption": "Git Diff with Previous Revision", + "command": "easy_diff_git", + "args": { + "last": true + } + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/EasyDiff/Side Bar.sublime-menu b/config/home/.config/sublime-text/Packages/User/EasyDiff/Side Bar.sublime-menu new file mode 100755 index 0000000..aefdf7b --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/EasyDiff/Side Bar.sublime-menu @@ -0,0 +1,38 @@ +[ + { + "caption": "-" + }, + { + "caption": "EasyDiff", + "children": [ + { + "command": "easy_diff_compare_both", + "args": { + "paths": [] + } + }, + { + "command": "easy_diff_compare_both", + "args": { + "clipboard": true, + "paths": [] + } + }, + { + "caption": "Git Diff", + "command": "easy_diff_git", + "args": { + "paths": [] + } + }, + { + "caption": "Git Diff with Previous Revision", + "command": "easy_diff_git", + "args": { + "last": true, + "paths": [] + } + } + ] + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/EasyDiff/Tab Context.sublime-menu b/config/home/.config/sublime-text/Packages/User/EasyDiff/Tab Context.sublime-menu new file mode 100755 index 0000000..9bab64d --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/EasyDiff/Tab Context.sublime-menu @@ -0,0 +1,42 @@ +[ + { + "caption": "-" + }, + { + "caption": "EasyDiff", + "children": [ + { + "command": "easy_diff_compare_both", + "args": { + "group": -1, + "index": -1 + } + }, + { + "command": "easy_diff_compare_both", + "args": { + "clipboard": true, + "group": -1, + "index": -1 + } + }, + { + "caption": "Git Diff", + "command": "easy_diff_git", + "args": { + "group": -1, + "index": -1 + } + }, + { + "caption": "Git Diff with Previous Revision", + "command": "easy_diff_git", + "args": { + "last": true, + "group": -1, + "index": -1 + } + } + ] + } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/HTML-ASP.sublime-settings b/config/home/.config/sublime-text/Packages/User/HTML-ASP.sublime-settings new file mode 100644 index 0000000..ca2291e --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/HTML-ASP.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "hta" + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/HTML.sublime-settings b/config/home/.config/sublime-text/Packages/User/HTML.sublime-settings new file mode 100644 index 0000000..f5d0c2b --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/HTML.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "vue" + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/JSON.sublime-settings b/config/home/.config/sublime-text/Packages/User/JSON.sublime-settings new file mode 100644 index 0000000..451da7f --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/JSON.sublime-settings @@ -0,0 +1,6 @@ +// These settings override both User and Default settings for the JSON syntax +{ + "translate_tabs_to_spaces": false, + "detect_indentation": false, + "auto_indent": true +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/JavaScript.sublime-settings b/config/home/.config/sublime-text/Packages/User/JavaScript.sublime-settings new file mode 100644 index 0000000..0b06423 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/JavaScript.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "jsx" + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Lua.sublime-settings b/config/home/.config/sublime-text/Packages/User/Lua.sublime-settings new file mode 100644 index 0000000..ff609aa --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Lua.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "regex" + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Markdown.sublime-settings b/config/home/.config/sublime-text/Packages/User/Markdown.sublime-settings new file mode 100644 index 0000000..74e4e24 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Markdown.sublime-settings @@ -0,0 +1,12 @@ +{ + "extensions": + [ + "md" + ], + "word_wrap": false, + "wrap_width": 120, + "translate_tabs_to_spaces": false, + "enable_table_editor": true, + "delimiter": "|", + "auto_quote": false +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Plain text.sublime-settings b/config/home/.config/sublime-text/Packages/User/Plain text.sublime-settings new file mode 100644 index 0000000..f509102 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Plain text.sublime-settings @@ -0,0 +1,6 @@ +{ + "word_wrap": true, + "wrap_width": 80, + "translate_tabs_to_spaces": false, + "enable_table_editor": true +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Preferences.sublime-settings b/config/home/.config/sublime-text/Packages/User/Preferences.sublime-settings new file mode 100644 index 0000000..e1d83ba --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Preferences.sublime-settings @@ -0,0 +1,45 @@ +{ + "auto_indent": true, + "detect_indentation": true, + "enable_telemetry": "disabled", + "file_exclude_patterns": + [ + "*.pyc", + "*.pyo", + "*.exe", + "*.dll", + "*.obj", + "*.o", + "*.a", + "*.lib", + "*.so", + "*.dylib", + "*.ncb", + "*.sdf", + "*.suo", + "*.pdb", + "*.idb", + ".DS_Store", + "*.class", + "*.psd", + "*.sublime-workspace" + ], + "folder_exclude_patterns": + [ + ".git", + ".hg", + ".svn", + "CVS" + ], + "font_size": 10, + "hot_exit": false, + "ignored_packages": + [ + "Vintage" + ], + "show_encoding": true, + "translate_tabs_to_spaces": true, + "use_tab_stops": true, + "word_wrap": false, + "wrap_width": 120 +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Pretty JSON.sublime-settings b/config/home/.config/sublime-text/Packages/User/Pretty JSON.sublime-settings new file mode 100644 index 0000000..5b8e124 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Pretty JSON.sublime-settings @@ -0,0 +1,12 @@ +{ + "use_entire_file_if_no_selection": true, + "indent": 2, + "sort_keys": false, + "ensure_ascii": false, + "line_separator": ",", + "value_separator": ": ", + "keep_arrays_single_line": false, + "max_arrays_line_length": 120, + "pretty_on_save": false, + "validate_on_save": true +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Python.sublime-settings b/config/home/.config/sublime-text/Packages/User/Python.sublime-settings new file mode 100644 index 0000000..59a628a --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Python.sublime-settings @@ -0,0 +1,4 @@ +// These settings override both User and Default settings for the Python syntax +{ + "translate_tabs_to_spaces": true +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/Reindent.sublime-macro b/config/home/.config/sublime-text/Packages/User/Reindent.sublime-macro new file mode 100644 index 0000000..9ae8e19 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/Reindent.sublime-macro @@ -0,0 +1,3 @@ +[ + { "command": "reindent", "args": { "single_line": false } } +] \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/XML.sublime-settings b/config/home/.config/sublime-text/Packages/User/XML.sublime-settings new file mode 100644 index 0000000..09e5348 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/XML.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "mm" + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/YAML.sublime-settings b/config/home/.config/sublime-text/Packages/User/YAML.sublime-settings new file mode 100644 index 0000000..f0e80cc --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/YAML.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "toml" + ] +} diff --git a/config/home/.config/sublime-text/Packages/User/bash.sublime-completions b/config/home/.config/sublime-text/Packages/User/bash.sublime-completions new file mode 100644 index 0000000..32fd097 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/bash.sublime-completions @@ -0,0 +1,19 @@ +{ + "scope": "source.shell", + "completions": [ + { + "trigger": "\\$", + "annotation": "Expand variable", + "contents": "\"\\${$0}\"", + "kind": "snippet", + "details": "Expand variable" + }, + { + "trigger": "!", + "annotation": "Expand header", + "contents": "#!/bin/sh\n\n#/*\n# * This file is part of TangoMan package.\n# *\n# * Copyright (c) 2024 \"Matthias Morin\" \n# *\n# * This source file is subject to the MIT license that is bundled\n# * with this source code in the file LICENSE.\n# */\n\n", + "kind": "snippet", + "details": "Expand header" + } + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/bash.sublime-snippet b/config/home/.config/sublime-text/Packages/User/bash.sublime-snippet new file mode 100644 index 0000000..d460601 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/bash.sublime-snippet @@ -0,0 +1,7 @@ + + + + $ + + source.shell + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/case_cycle.py b/config/home/.config/sublime-text/Packages/User/case_cycle.py new file mode 100644 index 0000000..89e4631 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/case_cycle.py @@ -0,0 +1,188 @@ +""" +Cycle through: lower case, Capitalize, Title Case, sanitized, UPPER CASE, train-case, train-case (strip accents), snake_case, UPPER_SNAKE_CASE, UpperCamelCase, and lowerCamelCase +""" + +from unicodedata import normalize, category +import re +import sublime_plugin + +class CaseCycleCommand(sublime_plugin.TextCommand): + def run(self, edit): + sels = self.view.sel(); + # get all selected text + for sel in sels: + if not sel.empty(): + # Get the selected text + string = self.view.substr(sel) + + if len(string) == 1: + if self.isLower(string): + string = string.upper() + + elif self.isUpper(string): + string = string.lower() + + elif self.hasAccents(string): + string = self.removeAccents(string) + + elif self.isUpperCamel(string): + string = self.camelCase(string, False) + + elif self.isLowerCamel(string): + string = self.humanize(string) + + elif self.isTrain(string): + if self.hasAccents(string): + string = self.removeAccents(string) + else: + string = self.snakeCase(string, False) + + elif self.isLowerSnake(string): + string = self.snakeCase(string, True) + + elif self.isUpperSnake(string): + string = self.camelCase(string, True) + + elif self.isCapitalized(string): + string = string.title(); + + elif self.isLower(string): + string = string.capitalize(); + + elif self.isTitle(string): + if self.isDirty(string): + string = self.sanitize(string) + else: + string = string.upper(); + + elif self.isUpper(string): + string = self.trainCase(string) + + else: + string = string.lower() + + # Replace the selection with transformed text + self.view.replace(edit, sel, string) + + def isLower(self, string): + return string == string.lower() + + def isUpper(self, string): + return string == string.upper() + + def isCapitalized(self, string): + return string == string.capitalize() + + def isTitle(self, string): + if ' ' not in string: + return False + + return string == string.title() + + def isUpperCamel(self, string): + if ' ' in string or '-' in string or '_' in string or string == string.lower() or string == string.upper(): + return False + + return string == self.camelCase(string, True) + + def isLowerCamel(self, string): + if ' ' in string or '-' in string or '_' in string or string == string.lower() or string == string.upper(): + return False + + return string == self.camelCase(string, False) + + def isDirty(self, string): + return string != self.sanitize(string) + + def hasAccents(self, string): + return string != self.removeAccents(string) + + def isTrain(self, string): + if ' ' in string or '_' in string: + return False + + return '-' in string and string == self.trainCase(string) + + def isUpperSnake(self, string): + if ' ' in string or '-' in string: + return False + + return string == self.snakeCase(string, True) + + def isLowerSnake(self, string): + if ' ' in string or '-' in string: + return False + + return string == self.snakeCase(string, False) + + def humanize(self, string): + if self.isUpperCamel(string) or self.isLowerCamel(string): + # humanize + string = re.sub('[A-Z]', lambda match: ' '+str(match.group(0)), string) + + # remove first space from string if any + string = re.sub('^\s', '', string) + + # Replace underscores and dashes + string = re.sub('[_-]+', ' ', string) + + string = self.sanitize(string) + + return string + + def camelCase(self, string, upper = False): + string = self.removeAccents(string) + + if self.isUpperSnake(string): + string = string.lower() + + string = self.sanitize(string) + string = re.sub('_', ' ', string) + + if ' ' in string: + string = string.title() + # Remove all spaces + string = re.sub(' ', '', string) + + if False == upper: + string = string[:1].lower() + string[1:] + + if True == upper: + string = string[:1].upper() + string[1:] + + return string + + def trainCase(self, string): + string = self.sanitize(string) + + # Replace spaces or underscores with dashes + string = re.sub('[\s_]', '-', string) + + # convert string to lowercase + string = string.lower() + + return string + + def snakeCase(self, string, upper = False): + string = self.removeAccents(string) + + string = self.sanitize(string) + + # Replace spaces or dashed with underscores + string = re.sub('[\s-]', '_', string) + + if True == upper: + string = string.upper() + else: + string = string.lower() + + return string + + def removeAccents(self, string): + # Remove accents from string (unicodedata method) + return ''.join(char for char in normalize('NFD', string) if category(char) != 'Mn') + + def sanitize(self, string): + # Replace all non word characters (except underscores and dashes) and removes extra spaces + return re.sub('([^\w_-]|\s)+', ' ', string).strip() + diff --git a/config/home/.config/sublime-text/Packages/User/easy_diff.sublime-settings b/config/home/.config/sublime-text/Packages/User/easy_diff.sublime-settings new file mode 100644 index 0000000..469b72c --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/easy_diff.sublime-settings @@ -0,0 +1,7 @@ +{ + // Turn off svn completely + "svn_disabled": true, + + // Turn off (Mercurial) hg completely + "hg_disabled": true, +} diff --git a/config/home/.config/sublime-text/Packages/User/execute.py b/config/home/.config/sublime-text/Packages/User/execute.py new file mode 100644 index 0000000..f412c5e --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/execute.py @@ -0,0 +1,15 @@ +""" +This plugin is meant for linux +Execute this +""" + +import os +import sublime_plugin + +class ExecuteCommand(sublime_plugin.TextCommand): + def run(self, edit): + file_path = self.view.file_name() + current_directory = os.path.dirname(file_path) + command = 'chmod +x {} && gnome-terminal --working-directory={} -- sh -c "{}; echo; echo press ctrl+c to quit...; tail"'.format(file_path, current_directory, file_path) + # command = 'chmod +x {} && gnome-terminal --working-directory={} -x sh -c "{}; echo; echo press ctrl+c to quit...; tail"'.format(file_path, current_directory, file_path) + os.system(command) diff --git a/config/home/.config/sublime-text/Packages/User/format_php_array.py b/config/home/.config/sublime-text/Packages/User/format_php_array.py new file mode 100644 index 0000000..a3e90e4 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/format_php_array.py @@ -0,0 +1,37 @@ +""" +Format PHP array console dump to proer syntax +""" + +import sublime_plugin +import sublime +from re import sub + +class FormatPhpArrayCommand(sublime_plugin.TextCommand): + def run(self, edit): + # https://www.sublimetext.com/docs/3/api_reference.html#sublime.View + # Get the region + region = sublime.Region(0, self.view.size()) + + # Get the whole text as string + text = self.view.substr(region) + + # remove "array:1 " + text = sub('array:\d+\s', '', text) + + # remove "0 => " + text = sub('\d+\s=>\s', '', text) + + # place comma at the end + text = sub('\n', ',\n', text) + + # remove extra commas + text = sub('\[,', '[', text) + + # Trim content + text = text.strip() + + # replace last comma with semicolon + text = sub('\],$', '];', text) + + # Replace the region with transformed text + self.view.replace(edit, region, text) \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/git_checkout.py b/config/home/.config/sublime-text/Packages/User/git_checkout.py new file mode 100644 index 0000000..1ba4fa0 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/git_checkout.py @@ -0,0 +1,16 @@ +""" +This plugin is meant for linux +git checkout this file +""" + +import os +import sublime_plugin + +class GitCheckoutCommand(sublime_plugin.TextCommand): + def run(self, edit): + file_name = self.view.file_name() + current_directory = os.path.dirname(file_name) + command = 'gnome-terminal --working-directory='+current_directory+' -x sh -c "git checkout '+file_name+'"' + + print(command) + os.system(command) diff --git a/config/home/.config/sublime-text/Packages/User/html-target-blank.sublime-snippet b/config/home/.config/sublime-text/Packages/User/html-target-blank.sublime-snippet new file mode 100644 index 0000000..55c6609 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/html-target-blank.sublime-snippet @@ -0,0 +1,7 @@ + + + + target + + text.html + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/insert_date.py b/config/home/.config/sublime-text/Packages/User/insert_date.py new file mode 100644 index 0000000..b5d04eb --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/insert_date.py @@ -0,0 +1,26 @@ +""" +Insert date +""" + +import sublime_plugin +import time + +""" +date_format_en = '%Y-%m-%d' # 2016-01-01 +date_format_fr = '%d/%m/%Y' # 01/01/2016 +datetime_format_long_en = '%Y-%m-%d_%H-%M' # 2016-01-01_00-00 +datetime_format_long_fr = '%H:%M %d/%m/%Y' # 00:00 01/01/2016 +time_format_long = '%H:%M:%S' # 00:00:00 +time_format_short = '%H:%M' # 00:00 +""" + +class InsertDateCommand(sublime_plugin.TextCommand): + def run(self, edit): + # 2016-01-01 + date_format_en = '%Y-%m-%d' + sels = self.view.sel(); + for sel in sels: + if sel.empty(): + self.view.insert(edit, sel.a, time.strftime(date_format_en)) + else: + self.view.replace(edit, sel, time.strftime(date_format_en)) diff --git a/config/home/.config/sublime-text/Packages/User/insert_datetime.py b/config/home/.config/sublime-text/Packages/User/insert_datetime.py new file mode 100644 index 0000000..f7813ed --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/insert_datetime.py @@ -0,0 +1,26 @@ +""" +Insert datetime +""" + +import sublime_plugin +import time + +""" +date_format_en = '%Y-%m-%d' # 2016-01-01 +date_format_fr = '%d/%m/%Y' # 01/01/2016 +datetime_format_long_en = '%Y-%m-%d_%H-%M' # 2016-01-01_00-00 +datetime_format_long_fr = '%H:%M %d/%m/%Y' # 00:00 01/01/2016 +time_format_long = '%H:%M:%S' # 00:00:00 +time_format_short = '%H:%M' # 00:00 +""" + +class InsertDatetimeCommand(sublime_plugin.TextCommand): + def run(self, edit): + # 00:00 01/01/2016 + datetime_format_long_fr = '%H:%M %d/%m/%Y' + sels = self.view.sel(); + for sel in sels: + if sel.empty(): + self.view.insert(edit, sel.a, time.strftime(datetime_format_long_fr)) + else: + self.view.replace(edit, sel, time.strftime(datetime_format_long_fr)) diff --git a/config/home/.config/sublime-text/Packages/User/javascript.sublime-snippet b/config/home/.config/sublime-text/Packages/User/javascript.sublime-snippet new file mode 100644 index 0000000..d7a945f --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/javascript.sublime-snippet @@ -0,0 +1,7 @@ + + + + log + + source.js + diff --git a/config/home/.config/sublime-text/Packages/User/lowercase_cycle.py b/config/home/.config/sublime-text/Packages/User/lowercase_cycle.py new file mode 100644 index 0000000..f03d2ee --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/lowercase_cycle.py @@ -0,0 +1,162 @@ +""" +Cycle through: lower case, strip accents, sanitized, train-case, snake_case +""" + +from unicodedata import normalize, category +import re +import sublime_plugin + +class LowercaseCycleCommand(sublime_plugin.TextCommand): + def run(self, edit): + sels = self.view.sel(); + # get all selected text + for sel in sels: + if not sel.empty(): + # Get the selected text + string = self.view.substr(sel) + + if self.isLower(string): + + if self.hasAccents(string): + string = self.removeAccents(string) + + elif self.isDirty(string): + string = self.sanitize(string) + + elif self.isTrain(string): + string = self.snakeCase(string, False) + + elif self.isLowerSnake(string): + string = self.humanize(string) + + else: + string = self.trainCase(string) + + else: + string = string.lower() + + # Replace the selection with transformed text + self.view.replace(edit, sel, string) + + def isLower(self, string): + return string == string.lower() + + def isUpper(self, string): + return string == string.upper() + + def isCapitalized(self, string): + return string == string.capitalize() + + def isTitle(self, string): + if ' ' not in string: + return False + + return string == string.title() + + def isUpperCamel(self, string): + if ' ' in string or '-' in string or '_' in string or string == string.lower() or string == string.upper(): + return False + + return string == self.camelCase(string, True) + + def isLowerCamel(self, string): + if ' ' in string or '-' in string or '_' in string or string == string.lower() or string == string.upper(): + return False + + return string == self.camelCase(string, False) + + def isDirty(self, string): + return string != self.sanitize(string) + + def hasAccents(self, string): + return string != self.removeAccents(string) + + def isTrain(self, string): + if ' ' in string or '_' in string: + return False + + return '-' in string and string == self.trainCase(string) + + def isUpperSnake(self, string): + if ' ' in string or '-' in string: + return False + + return string == self.snakeCase(string, True) + + def isLowerSnake(self, string): + if ' ' in string or '-' in string: + return False + + return string == self.snakeCase(string, False) + + def humanize(self, string): + if self.isUpperCamel(string) or self.isLowerCamel(string): + # humanize + string = re.sub('[A-Z]', lambda match: ' '+str(match.group(0)), string) + + # remove first space from string if any + string = re.sub('^\s', '', string) + + # Replace underscores and dashes + string = re.sub('[_-]+', ' ', string) + + string = self.sanitize(string) + + return string + + def camelCase(self, string, upper = False): + string = self.removeAccents(string) + + if self.isUpperSnake(string): + string = string.lower() + + string = self.sanitize(string) + string = re.sub('_', ' ', string) + + if ' ' in string: + string = string.title() + # Remove all spaces + string = re.sub(' ', '', string) + + if False == upper: + string = string[:1].lower() + string[1:] + + if True == upper: + string = string[:1].upper() + string[1:] + + return string + + def trainCase(self, string): + string = self.sanitize(string) + + # Replace spaces or underscores with dashes + string = re.sub('[\s_]', '-', string) + + # convert string to lowercase + string = string.lower() + + return string + + def snakeCase(self, string, upper = False): + string = self.removeAccents(string) + + string = self.sanitize(string) + + # Replace spaces or dashed with underscores + string = re.sub('[\s-]', '_', string) + + if True == upper: + string = string.upper() + else: + string = string.lower() + + return string + + def removeAccents(self, string): + # Remove accents from string (unicodedata method) + return ''.join(char for char in normalize('NFD', string) if category(char) != 'Mn') + + def sanitize(self, string): + # Replace all non word characters (except underscores and dashes) and removes extra spaces + return re.sub('([^\w_-]|\s)+', ' ', string).strip() + diff --git a/config/home/.config/sublime-text/Packages/User/markdown-bash.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-bash.sublime-snippet new file mode 100644 index 0000000..fc56993 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-bash.sublime-snippet @@ -0,0 +1,11 @@ + + + + bash + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-cmd.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-cmd.sublime-snippet new file mode 100644 index 0000000..448fdf2 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-cmd.sublime-snippet @@ -0,0 +1,11 @@ + + + + cmd + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-css.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-css.sublime-snippet new file mode 100644 index 0000000..87d91d3 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-css.sublime-snippet @@ -0,0 +1,13 @@ + + + + css + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-diff.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-diff.sublime-snippet new file mode 100644 index 0000000..b13577e --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-diff.sublime-snippet @@ -0,0 +1,12 @@ + + + + diff + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-javascript.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-javascript.sublime-snippet new file mode 100644 index 0000000..055bcdd --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-javascript.sublime-snippet @@ -0,0 +1,13 @@ + + + + javascript + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-json.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-json.sublime-snippet new file mode 100644 index 0000000..c11b2b4 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-json.sublime-snippet @@ -0,0 +1,15 @@ + + + + json + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-php.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-php.sublime-snippet new file mode 100644 index 0000000..8525100 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-php.sublime-snippet @@ -0,0 +1,13 @@ + + + + php + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-phpstorm.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-phpstorm.sublime-snippet new file mode 100644 index 0000000..9bf7644 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-phpstorm.sublime-snippet @@ -0,0 +1,7 @@ + + + + storm + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-python.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-python.sublime-snippet new file mode 100644 index 0000000..c554640 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-python.sublime-snippet @@ -0,0 +1,11 @@ + + + + python + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-shell.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-shell.sublime-snippet new file mode 100644 index 0000000..66ee93d --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-shell.sublime-snippet @@ -0,0 +1,11 @@ + + + + shell + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-sql.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-sql.sublime-snippet new file mode 100644 index 0000000..1443fab --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-sql.sublime-snippet @@ -0,0 +1,11 @@ + + + + sql + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-sublime.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-sublime.sublime-snippet new file mode 100644 index 0000000..ba5ea77 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-sublime.sublime-snippet @@ -0,0 +1,7 @@ + + + + subl + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-twig.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-twig.sublime-snippet new file mode 100644 index 0000000..8be8aa6 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-twig.sublime-snippet @@ -0,0 +1,13 @@ + + + + twig + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-yaml.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-yaml.sublime-snippet new file mode 100644 index 0000000..48c608b --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-yaml.sublime-snippet @@ -0,0 +1,11 @@ + + + + yaml + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown-yml.sublime-snippet b/config/home/.config/sublime-text/Packages/User/markdown-yml.sublime-snippet new file mode 100644 index 0000000..1647a6e --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown-yml.sublime-snippet @@ -0,0 +1,11 @@ + + + + yml + + text.html.markdown + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/markdown.sublime-completions b/config/home/.config/sublime-text/Packages/User/markdown.sublime-completions new file mode 100644 index 0000000..28b0570 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/markdown.sublime-completions @@ -0,0 +1,103 @@ +{ + "scope": "markdown.raw", + "completions": [ + { + "trigger": "bash", + "annotation": "bash", + "contents": "```bash\n\\$ $0\n```", + "kind": "snippet", + "details": "bash markup for markdown" + }, + { + "trigger": "cmd", + "annotation": "cmd", + "contents": "```cmd\n\\$ $0\n```", + "kind": "snippet", + "details": "cmd markup for markdown" + }, + { + "trigger": "css", + "annotation": "css", + "contents": "```css\n$1: {\n $2: $3;\n}\n```", + "kind": "snippet", + "details": "css markup for markdown" + }, + { + "trigger": "diff", + "annotation": "diff", + "contents": "```diff\n- $1\n+ $2\n```", + "kind": "snippet", + "details": "diff markup for markdown" + }, + { + "trigger": "javascript", + "annotation": "javascript", + "contents": "```javascript\nfunction (e) {\n $0\n}\n```", + "kind": "snippet", + "details": "javascript markup for markdown" + }, + { + "trigger": "json", + "annotation": "json", + "contents": "```json\n[\n {\n \"$0\": \"$1\"\n }\n]\n```", + "kind": "snippet", + "details": "json markup for markdown" + }, + { + "trigger": "php", + "annotation": "php", + "contents": "```php\n + + + ! + + source.python + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/rename_log.py b/config/home/.config/sublime-text/Packages/User/rename_log.py new file mode 100644 index 0000000..848f70d --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/rename_log.py @@ -0,0 +1,34 @@ +""" +Rename log to current date +""" + +import sublime_plugin +import time +import re + + +class RenameLogCommand(sublime_plugin.TextCommand): + def run(self, edit): + # Get the region + region = self.view.line(0) + # Get current line as string + text = self.view.substr(region) + + pattern = r'^(\d{4}-\d{2}-\d{2})(.+)' + match = re.match(pattern, text) + + if match: + # Get today's date in YYYY-MM-DD format + today = time.strftime('%Y-%m-%d') + text = re.sub(pattern, f"{today}\\2", text) + new_name = text.strip() + + ################################################## + # change document title + ################################################## + + # Replace the region with transformed text + self.view.replace(edit, region, text) + + # rename file tab + self.view.set_name(new_name) diff --git a/config/home/.config/sublime-text/Packages/User/save_as_and_close.py b/config/home/.config/sublime-text/Packages/User/save_as_and_close.py new file mode 100644 index 0000000..0440319 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/save_as_and_close.py @@ -0,0 +1,11 @@ +""" +Save as UTF-8 and close file +""" + +import sublime_plugin + +class SaveAsAndCloseCommand(sublime_plugin.WindowCommand): + def run(self): + #self.window.run_command('save', {'encoding': 'Western (Windows 1252)'}) + self.window.run_command('save', {'encoding': 'UTF-8'}) + self.window.run_command('close') diff --git a/config/home/.config/sublime-text/Packages/User/shell.sublime-completions b/config/home/.config/sublime-text/Packages/User/shell.sublime-completions new file mode 100644 index 0000000..32fd097 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/shell.sublime-completions @@ -0,0 +1,19 @@ +{ + "scope": "source.shell", + "completions": [ + { + "trigger": "\\$", + "annotation": "Expand variable", + "contents": "\"\\${$0}\"", + "kind": "snippet", + "details": "Expand variable" + }, + { + "trigger": "!", + "annotation": "Expand header", + "contents": "#!/bin/sh\n\n#/*\n# * This file is part of TangoMan package.\n# *\n# * Copyright (c) 2024 \"Matthias Morin\" \n# *\n# * This source file is subject to the MIT license that is bundled\n# * with this source code in the file LICENSE.\n# */\n\n", + "kind": "snippet", + "details": "Expand header" + } + ] +} \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/shell.sublime-snippet b/config/home/.config/sublime-text/Packages/User/shell.sublime-snippet new file mode 100644 index 0000000..e9a1d0e --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/shell.sublime-snippet @@ -0,0 +1,19 @@ + + +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +]]> + + ! + + source.shell + \ No newline at end of file diff --git a/config/home/.config/sublime-text/Packages/User/shellcheck.py b/config/home/.config/sublime-text/Packages/User/shellcheck.py new file mode 100644 index 0000000..8b0c74e --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/shellcheck.py @@ -0,0 +1,14 @@ +""" +This plugin is meant for linux +Shellcheck this +""" + +import os +import sublime_plugin + +class ShellcheckCommand(sublime_plugin.TextCommand): + def run(self, edit): + file_path = self.view.file_name() + current_directory = os.path.dirname(file_path) + command = 'gnome-terminal --working-directory={} -- sh -c "shellcheck -x {}; echo; echo press ctrl+c to quit...; tail"'.format(current_directory, file_path) + os.system(command) diff --git a/config/home/.config/sublime-text/Packages/User/strip_accents.py b/config/home/.config/sublime-text/Packages/User/strip_accents.py new file mode 100644 index 0000000..ed02972 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/strip_accents.py @@ -0,0 +1,21 @@ +""" +Remove accents from string +""" + +import sublime_plugin +from unicodedata import normalize, category + +class StripAccentsCommand(sublime_plugin.TextCommand): + def run(self, edit): + sels = self.view.sel(); + # get all selected text + for sel in sels: + if not sel.empty(): + # Get the selected text + string = self.view.substr(sel) + + # Remove accents from string (unicodedata method) + string = ''.join(char for char in normalize('NFD', string) if category(char) != 'Mn') + + # Replace the selection with transformed text + self.view.replace(edit, sel, string) diff --git a/config/home/.config/sublime-text/Packages/User/terminal.py b/config/home/.config/sublime-text/Packages/User/terminal.py new file mode 100644 index 0000000..8d1d6b1 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/terminal.py @@ -0,0 +1,38 @@ +""" +This plugin is compatible with both linux and windows +This Opens new external terminal + + - Open Terminal Here + - Open Command Promt/Git Bash Here + +""" + +import os +import sys +import sublime_plugin + +class TerminalCommand(sublime_plugin.TextCommand): + def run(self, edit): + file_name = self.view.file_name() + + if os.name == 'posix' and sys.platform == 'linux': + current_directory = os.path.dirname(file_name) + command = 'gnome-terminal --working-directory=' + format(current_directory) + + elif os.name == 'nt': + path = file_name.split("\\") + path.pop() + current_directory = "\\".join(path) + git_path = "\"C:\\Program Files\\Git\\git-bash.exe\"" + + if os.path.isfile(git_path): + command = git_path + ' --cd=' + current_directory + + else: + command = 'cd ' + current_directory + ' & start cmd' + + else: + raise NotImplementedError + + print(command) + os.system(command) diff --git a/config/home/.config/sublime-text/Packages/User/titlecase_cycle.py b/config/home/.config/sublime-text/Packages/User/titlecase_cycle.py new file mode 100644 index 0000000..a2dfe3a --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/titlecase_cycle.py @@ -0,0 +1,171 @@ +""" +Cycle through: Capitalize, Title Case, strip accents, sanitizz, UpperCamelCase, and lowerCamelCase +""" + +from unicodedata import normalize, category +import re +import sublime_plugin + +class TitlecaseCycleCommand(sublime_plugin.TextCommand): + def run(self, edit): + sels = self.view.sel(); + # get all selected text + for sel in sels: + if not sel.empty(): + # Get the selected text + string = self.view.substr(sel) + + if self.isTrain(string): + string = self.humanize(string); + + elif self.isLowerSnake(string): + string = self.humanize(string); + + elif self.isLowerCamel(string): + string = self.humanize(string) + + if self.isCapitalized(string): + string = string.title(); + + elif self.isTitle(string): + + if self.hasAccents(string): + string = self.removeAccents(string) + + elif self.isDirty(string): + string = self.sanitize(string) + + else: + string = self.camelCase(string, True) + + elif self.isUpperCamel(string): + string = self.camelCase(string, False) + + else: + string = string.capitalize() + + # Replace the selection with transformed text + self.view.replace(edit, sel, string) + + def isLower(self, string): + return string == string.lower() + + def isUpper(self, string): + return string == string.upper() + + def isCapitalized(self, string): + return string == string.capitalize() + + def isTitle(self, string): + if ' ' not in string: + return False + + return string == string.title() + + def isUpperCamel(self, string): + if ' ' in string or '-' in string or '_' in string or string == string.lower() or string == string.upper(): + return False + + return string == self.camelCase(string, True) + + def isLowerCamel(self, string): + if ' ' in string or '-' in string or '_' in string or string == string.lower() or string == string.upper(): + return False + + return string == self.camelCase(string, False) + + def isDirty(self, string): + return string != self.sanitize(string) + + def hasAccents(self, string): + return string != self.removeAccents(string) + + def isTrain(self, string): + if ' ' in string or '_' in string: + return False + + return '-' in string and string == self.trainCase(string) + + def isUpperSnake(self, string): + if ' ' in string or '-' in string: + return False + + return string == self.snakeCase(string, True) + + def isLowerSnake(self, string): + if ' ' in string or '-' in string: + return False + + return string == self.snakeCase(string, False) + + def humanize(self, string): + if self.isUpperCamel(string) or self.isLowerCamel(string): + # humanize + string = re.sub('[A-Z]', lambda match: ' '+str(match.group(0)), string) + + # remove first space from string if any + string = re.sub('^\s', '', string) + + # Replace underscores and dashes + string = re.sub('[_-]+', ' ', string) + + string = self.sanitize(string) + + return string + + def camelCase(self, string, upper = False): + string = self.removeAccents(string) + + if self.isUpperSnake(string): + string = string.lower() + + string = self.sanitize(string) + string = re.sub('_', ' ', string) + + if ' ' in string: + string = string.title() + # Remove all spaces + string = re.sub(' ', '', string) + + if False == upper: + string = string[:1].lower() + string[1:] + + if True == upper: + string = string[:1].upper() + string[1:] + + return string + + def trainCase(self, string): + string = self.sanitize(string) + + # Replace spaces or underscores with dashes + string = re.sub('[\s_]', '-', string) + + # convert string to lowercase + string = string.lower() + + return string + + def snakeCase(self, string, upper = False): + string = self.removeAccents(string) + + string = self.sanitize(string) + + # Replace spaces or dashed with underscores + string = re.sub('[\s-]', '_', string) + + if True == upper: + string = string.upper() + else: + string = string.lower() + + return string + + def removeAccents(self, string): + # Remove accents from string (unicodedata method) + return ''.join(char for char in normalize('NFD', string) if category(char) != 'Mn') + + def sanitize(self, string): + # Replace all non word characters (except underscores and dashes) and removes extra spaces + return re.sub('([^\w_-]|\s)+', ' ', string).strip() + diff --git a/config/home/.config/sublime-text/Packages/User/uppercase_cycle.py b/config/home/.config/sublime-text/Packages/User/uppercase_cycle.py new file mode 100644 index 0000000..80a4bd7 --- /dev/null +++ b/config/home/.config/sublime-text/Packages/User/uppercase_cycle.py @@ -0,0 +1,159 @@ +""" +Cycle through: UPPER CASE, strip accents, sanitize, train-case, snake_case +""" + +from unicodedata import normalize, category +import re +import sublime_plugin + +class UppercaseCycleCommand(sublime_plugin.TextCommand): + def run(self, edit): + sels = self.view.sel(); + # get all selected text + for sel in sels: + if not sel.empty(): + # Get the selected text + string = self.view.substr(sel) + + if self.isUpper(string): + + if self.hasAccents(string): + string = self.removeAccents(string) + + elif self.isDirty(string): + string = self.sanitize(string) + + elif self.isUpperSnake(string): + string = self.humanize(string) + + else: + string = self.snakeCase(string, True) + + else: + string = string.upper() + + # Replace the selection with transformed text + self.view.replace(edit, sel, string) + + def isLower(self, string): + return string == string.lower() + + def isUpper(self, string): + return string == string.upper() + + def isCapitalized(self, string): + return string == string.capitalize() + + def isTitle(self, string): + if ' ' not in string: + return False + + return string == string.title() + + def isUpperCamel(self, string): + if ' ' in string or '-' in string or '_' in string or string == string.lower() or string == string.upper(): + return False + + return string == self.camelCase(string, True) + + def isLowerCamel(self, string): + if ' ' in string or '-' in string or '_' in string or string == string.lower() or string == string.upper(): + return False + + return string == self.camelCase(string, False) + + def isDirty(self, string): + return string != self.sanitize(string) + + def hasAccents(self, string): + return string != self.removeAccents(string) + + def isTrain(self, string): + if ' ' in string or '_' in string: + return False + + return '-' in string and string == self.trainCase(string) + + def isUpperSnake(self, string): + if ' ' in string or '-' in string: + return False + + return string == self.snakeCase(string, True) + + def isLowerSnake(self, string): + if ' ' in string or '-' in string: + return False + + return string == self.snakeCase(string, False) + + def humanize(self, string): + if self.isUpperCamel(string) or self.isLowerCamel(string): + # humanize + string = re.sub('[A-Z]', lambda match: ' '+str(match.group(0)), string) + + # remove first space from string if any + string = re.sub('^\s', '', string) + + # Replace underscores and dashes + string = re.sub('[_-]+', ' ', string) + + string = self.sanitize(string) + + return string + + def camelCase(self, string, upper = False): + string = self.removeAccents(string) + + if self.isUpperSnake(string): + string = string.lower() + + string = self.sanitize(string) + string = re.sub('_', ' ', string) + + if ' ' in string: + string = string.title() + # Remove all spaces + string = re.sub(' ', '', string) + + if False == upper: + string = string[:1].lower() + string[1:] + + if True == upper: + string = string[:1].upper() + string[1:] + + return string + + def trainCase(self, string): + string = self.sanitize(string) + + # Replace spaces or underscores with dashes + string = re.sub('[\s_]', '-', string) + + # convert string to lowercase + string = string.lower() + + return string + + def snakeCase(self, string, upper = False): + string = self.removeAccents(string) + + string = self.sanitize(string) + + # Replace spaces or dashed with underscores + string = re.sub('[\s-]', '_', string) + + if True == upper: + string = string.upper() + else: + string = string.lower() + + return string + + def removeAccents(self, string): + # Remove accents from string (unicodedata method) + return ''.join(char for char in normalize('NFD', string) if category(char) != 'Mn') + + def sanitize(self, string): + # Replace all non word characters (except underscores and dashes) and removes extra spaces + return re.sub('([^\w_-]|\s)+', ' ', string).strip() + diff --git a/config/home/.mozilla/firefox/default/user.js b/config/home/.mozilla/firefox/default/user.js new file mode 100644 index 0000000..96f8edc --- /dev/null +++ b/config/home/.mozilla/firefox/default/user.js @@ -0,0 +1,44 @@ +user_pref("app.normandy.first_run", false); +user_pref("app.shield.optoutstudies.enabled", false); +user_pref("app.update.lastUpdateTime.services-settings-poll-changes", 0); +user_pref("browser.contentblocking.category", "strict"); +user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); +user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); +user_pref("browser.newtabpage.activity-stream.feeds.section.highlights", false); +user_pref("browser.newtabpage.activity-stream.feeds.snippets", false); +user_pref("browser.newtabpage.activity-stream.feeds.topsites", false); +user_pref("browser.newtabpage.activity-stream.showSearch", false); +user_pref("browser.newtabpage.enabled", false); +user_pref("browser.privatebrowsing.autostart", true); +user_pref("browser.search.suggest.enabled", false); +user_pref("browser.startup.homepage", "https://check.torproject.org"); +user_pref("browser.tabs.warnOnClose", false); +user_pref("browser.urlbar.suggest.bookmark", false); +user_pref("browser.urlbar.suggest.history", false); +user_pref("browser.urlbar.suggest.openpage", false); +user_pref("browser.urlbar.suggest.topsites", false); +user_pref("datareporting.healthreport.uploadEnabled", false); +user_pref("general.autoScroll", false); +user_pref("general.smoothScroll", false); +user_pref("layout.spellcheckDefault", 0); +user_pref("media.autoplay.default", 5); +user_pref("media.hardwaremediakeys.enabled", false); +user_pref("media.videocontrols.picture-in-picture.video-toggle.enabled", false); +user_pref("network.proxy.socks", "0.0.0.0"); +user_pref("network.proxy.socks_port", 9050); +user_pref("network.proxy.type", 1); +user_pref("permissions.default.camera", 2); +user_pref("permissions.default.desktop-notification", 2); +user_pref("permissions.default.geo", 2); +user_pref("permissions.default.microphone", 2); +user_pref("permissions.default.xr", 2); +user_pref("privacy.donottrackheader.enabled", true); +user_pref("security.default_personal_cert", "Select Automatically"); +user_pref("security.OCSP.enabled", 0); +user_pref("signon.autofillForms", false); +user_pref("signon.generation.enabled", false); +user_pref("signon.management.page.breach-alerts.enabled", false); +user_pref("signon.rememberSignons", false); +user_pref("toolkit.telemetry.pioneer-new-studies-available", true); +user_pref("toolkit.telemetry.reportingpolicy.firstRun", false); +user_pref("trailhead.firstrun.didSeeAboutWelcome", true); \ No newline at end of file diff --git a/config/home/.mozilla/firefox/installs.ini b/config/home/.mozilla/firefox/installs.ini new file mode 100644 index 0000000..15f562b --- /dev/null +++ b/config/home/.mozilla/firefox/installs.ini @@ -0,0 +1,4 @@ +[4F96D1932A9F858E] +Default=symfony +Locked=1 + diff --git a/config/home/.mozilla/firefox/profiles.ini b/config/home/.mozilla/firefox/profiles.ini new file mode 100644 index 0000000..6ad76f8 --- /dev/null +++ b/config/home/.mozilla/firefox/profiles.ini @@ -0,0 +1,14 @@ +[Install4F96D1932A9F858E] +Default=default +Locked=1 + +[Profile0] +Name=default +IsRelative=1 +Path=default +Default=1 + +[General] +StartWithLastProfile=1 +Version=2 + diff --git a/config/home/.p10k.zsh b/config/home/.p10k.zsh new file mode 100644 index 0000000..331699a --- /dev/null +++ b/config/home/.p10k.zsh @@ -0,0 +1,1842 @@ +# Generated by Powerlevel10k configuration wizard on 2024-06-15 at 19:33 CEST. +# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 44011. +# Wizard options: nerdfont-v3 + powerline, large icons, rainbow, unicode, 24h time, +# angled separators, round heads, round tails, 2 lines, dotted, full frame, +# lightest-ornaments, sparse, many icons, concise, instant_prompt=off. +# Type `p10k configure` to generate another config. +# +# Config for Powerlevel10k with powerline prompt style with colorful background. +# Type `p10k configure` to generate your own config based on it. +# +# Tip: Looking for a nice color? Here's a one-liner to print colormap. +# +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. This allows you to apply configuration changes without + # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return + + # The list of segments shown on the left. Fill it with the most important segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + os_icon # os identifier + dir # current directory + vcs # git status + # =========================[ Line #2 ]========================= + newline # \n + # prompt_char # prompt symbol + ) + + # The list of segments shown on the right. Fill it with less important segments. + # Right prompt on the last prompt line (where you are typing your commands) gets + # automatically hidden when the input line reaches it. Right prompt above the + # last prompt line gets hidden if it would overlap with left prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + status # exit code of the last command + command_execution_time # duration of the last command + background_jobs # presence of background jobs + direnv # direnv status (https://direnv.net/) + asdf # asdf version manager (https://github.com/asdf-vm/asdf) + virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + anaconda # conda environment (https://conda.io/) + pyenv # python environment (https://github.com/pyenv/pyenv) + goenv # go environment (https://github.com/syndbg/goenv) + nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + # node_version # node.js version + # go_version # go version (https://golang.org) + # rust_version # rustc version (https://www.rust-lang.org) + # dotnet_version # .NET version (https://dotnet.microsoft.com) + # php_version # php version (https://www.php.net/) + # laravel_version # laravel php framework version (https://laravel.com/) + # java_version # java version (https://www.java.com/) + # package # name@version from package.json (https://docs.npmjs.com/files/package.json) + rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) + rvm # ruby version from rvm (https://rvm.io) + fvm # flutter version management (https://github.com/leoafarias/fvm) + luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) + jenv # java version from jenv (https://github.com/jenv/jenv) + plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) + phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) + haskell_stack # haskell version from stack (https://haskellstack.org/) + kubecontext # current kubernetes context (https://kubernetes.io/) + terraform # terraform workspace (https://www.terraform.io) + # terraform_version # terraform version (https://www.terraform.io) + aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) + aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) + azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) + gcloud # google cloud cli account and project (https://cloud.google.com/) + google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) + context # user@hostname + nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) + ranger # ranger shell (https://github.com/ranger/ranger) + yazi # yazi shell (https://github.com/sxyazi/yazi) + nnn # nnn shell (https://github.com/jarun/nnn) + lf # lf shell (https://github.com/gokcehan/lf) + xplr # xplr shell (https://github.com/sayanarijit/xplr) + vim_shell # vim shell indicator (:sh) + midnight_commander # midnight commander shell (https://midnight-commander.org/) + nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) + vi_mode # vi mode (you don't need this if you've enabled prompt_char) + # vpn_ip # virtual private network indicator + # load # CPU load + # disk_usage # disk usage + # ram # free RAM + # swap # used swap + todo # todo items (https://github.com/todotxt/todo.txt-cli) + timewarrior # timewarrior tracking status (https://timewarrior.net/) + taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator + # cpu_arch # CPU architecture + time # current time + # =========================[ Line #2 ]========================= + newline + # ip # ip address and bandwidth usage for a specified network interface + # public_ip # public IP address + # proxy # system-wide http/https/ftp proxy + # battery # internal battery + # wifi # wifi speed + # example # example user-defined segment (see prompt_example function below) + ) + + # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. + typeset -g POWERLEVEL9K_MODE=nerdfont-v3 + # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid + # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. + typeset -g POWERLEVEL9K_ICON_PADDING=moderate + + # When set to true, icons appear before content on both sides of the prompt. When set + # to false, icons go after content. If empty or not set, icons go before content in the left + # prompt and after content in the right prompt. + # + # You can also override it for a specific segment: + # + # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false + # + # Or for a specific segment in specific state: + # + # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + + # Add an empty line before each prompt. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + + # Connect left prompt lines with these symbols. You'll probably want to use the same color + # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%244F╭─' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%244F├─' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%244F╰─' + # Connect right prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%244F─╮' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%244F─┤' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%244F─╯' + + # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or + # '─'. The last two make it easier to see the alignment between left and right prompt and to + # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + # for more compact prompt if using this option. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='·' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= + if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then + # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE + # ornaments defined above. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=244 + # Start filler from the edge of the screen if there are no left segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + # End filler on the edge of the screen if there are no right segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + # Separator between same-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' + # Separator between same-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' + # Separator between different-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' + # Separator between different-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + # To remove a separator between two segments, add "_joined" to the second segment name. + # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined) + + # The right end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B4' + # The left end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6' + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6' + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B4' + # Left prompt terminator for lines without any segments. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + #################################[ os_icon: os identifier ]################################## + # OS identifier color. + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 + typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' + + ################################[ prompt_char: prompt symbol ]################################ + # Transparent background. + typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= + # Green prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + # Prompt symbol in visual vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + # Prompt symbol in overwrite vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + # No line terminator if prompt_char is the last segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + # No line introducer if prompt_char is the first segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # No surrounding whitespace. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= + + ##################################[ dir: current directory ]################################## + # Current directory background color. + typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 + # Default current directory foreground color. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 + # If directory is too long, shorten some of its segments to the shortest possible unique + # prefix. The shortened directory can be tab-completed to the original. + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + # Replace removed segment suffixes with this symbol. + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + # Color of the shortened directory segments. + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 + # Color of the anchor directory segments. Anchor segments are never shortened. The first + # segment is always an anchor. + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 + # Display anchor directory segments in bold. + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + # Don't shorten directories that contain any of these files. They are anchors. + local anchor_files=( + .bzr + .citc + .git + .hg + .node-version + .python-version + .go-version + .ruby-version + .lua-version + .java-version + .perl-version + .php-version + .tool-versions + .shorten_folder_marker + .svn + .terraform + CVS + Cargo.toml + composer.json + go.mod + package.json + stack.yaml + ) + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains + # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) + # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers + # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + # Don't shorten this many last directory segments. They are anchors. + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # Shorten directory if it's longer than this even if there is space for it. The value can + # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, + # directory will be shortened only when prompt doesn't fit or when other parameters demand it + # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). + # If set to `0`, directory will always be shortened to its minimum length. + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this + # many columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least + # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + # If set to true, embed a hyperlink into the directory. Useful for quickly + # opening a directory in the file manager simply by clicking the link. + # Can also be handy when the directory is shortened, as it allows you to see + # the full directory that was used in previous commands. + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + + # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different + # directories. It must be an array with 3 * N elements. Each triplet consists of: + # + # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with + # extended_glob option enabled. + # 2. Directory class for the purpose of styling. + # 3. An empty string. + # + # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. + # + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=( + # '~/work(|/*)' WORK '' + # '~(|/*)' HOME '' + # '*' DEFAULT '') + # + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. + # + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an + # option to define custom colors and icons for different directory classes. + # + # # Styling for WORK. + # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NOT_WRITABLE. + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 + # + # If a styling parameter isn't explicitly defined for some class, it falls back to the classless + # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls + # back to POWERLEVEL9K_DIR_FOREGROUND. + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=() + + # Custom prefix. + # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' + + #####################################[ vcs: git status ]###################################### + # Version control background colors. + typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 + + # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter for Git status. + # + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # + # You can edit the function to customize how Git status looks. + # + # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: + # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from + # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. + typeset -g my_git_format=$P9K_CONTENT + return + fi + + # Styling for different parts of Git status. + local meta='%7F' # white foreground + local clean='%0F' # black foreground + local modified='%0F' # black foreground + local untracked='%0F' # black foreground + local conflicted='%1F' # red foreground + + local res + + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" + fi + + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi + + # Display the current Git commit if there is no branch and no tag. + # Tip: To always display the current Git commit, delete the next line. + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + + # Show tracking branch name if it differs from local branch. + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" + fi + + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" + fi + + # ⇠42 if behind the push remote. + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + # *42 if have stashes. + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + # 'merge' if the repo is in an unusual state. + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + # ~42 if have merge conflicts. + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + # +42 if have staged changes. + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + # !42 if have unstaged changes. + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + # "─" if the number of unstaged files is unknown. This can happen due to + # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower + # than the number of files in the Git index, or due to bash.showDirtyState being set to false + # in the repository config. The number of staged and untracked files may also be unknown + # in this case. + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Don't count the number of unstaged, untracked and conflicted files in Git repositories with + # more than this many files in the index. Negative value means infinity. + # + # If you are working in Git repositories with tens of millions of files and seeing performance + # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output + # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's + # config: `git config bash.showDirtyState false`. + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + + # Don't show Git status in prompt for repositories whose workdir matches this pattern. + # For example, if set to '~', the Git repository at $HOME/.git will be ignored. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + + # Disable the default Git status formatting. + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + # Install our own Git status formatter. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' + # Enable counters for staged, unstaged, etc. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + # Custom icon. + # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_VCS_PREFIX='on ' + + # Show status of repositories of these types. You can add svn and/or hg if you are + # using them. If you do, your prompt may become slow even when your current directory + # isn't in an svn or hg repository. + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + ##########################[ status: exit code of the last command ]########################### + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as + # it will signify success by turning green. + typeset -g POWERLEVEL9K_STATUS_OK=true + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 + + # Status when some part of a pipe command fails but the overall exit status is zero. It may look + # like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + + # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as + # it will signify error by turning red. + typeset -g POWERLEVEL9K_STATUS_ERROR=true + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 + + # Status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 + + # Status when some part of a pipe command fails and the overall exit status is also non-zero. + # It may look like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 + + ###################[ command_execution_time: duration of the last command ]################### + # Execution time color. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 + # Show duration of the last command if takes at least this many seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + # Show this many fractional digits. Zero means round to seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' + + #######################[ background_jobs: presence of background jobs ]####################### + # Background jobs color. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 + # Don't show the number of background jobs. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false + # Custom icon. + # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ direnv: direnv status (https://direnv.net/) ]######################## + # Direnv color. + typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 + typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and + # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + + # There are four parameters that can be used to hide asdf tools. Each parameter describes + # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at + # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to + # hide a tool, it gets shown. + # + # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and + # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + + # If set to non-empty value, hide tools unless there is a file matching the specified file pattern + # in the current directory, or its parent directory, or its grandparent directory, and so on. + # + # Note: If this parameter is set to empty value, it won't hide tools. + # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. + # + # Example: Hide nodejs version when there is no package.json and no *.js files in the current + # directory, in `..`, in `../..` and so on. + # + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 + typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' + + # PHP version from asdf. + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Haskell version from asdf. + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 + # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### + # NordVPN connection indicator color. + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 + typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 + # Hide NordVPN connection indicator when not connected. + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icon. + # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## + # Ranger shell color. + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 + typeset -g POWERLEVEL9K_YAZI_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### + # Nnn shell color. + typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 + typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=0 + typeset -g POWERLEVEL9K_LF_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 + typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### + # Vim shell indicator color. + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ disk_usage: disk usage ]################################## + # Colors for different levels of disk usage. + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 + # Thresholds for different levels of disk usage (percentage points). + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + # Custom icon. + # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### + # Foreground color. + typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 + # Text and color for normal (a.k.a. command) vi mode. + typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL + typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 + # Text and color for visual vi mode. + typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL + typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 + # Text and color for overtype (a.k.a. overwrite and replace) vi mode. + typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE + typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 + # Text and color for insert vi mode. + typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= + typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + # Custom icon. + # typeset -g POWERLEVEL9K_VI_MODE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ ram: free RAM ]####################################### + # RAM color. + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################################[ swap: used swap ]###################################### + # Swap color. + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 + typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ load: CPU load ]###################################### + # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + # Load color when load is under 50%. + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 + # Load color when load is between 50% and 70%. + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 + # Load color when load is over 70%. + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ + # Todo color. + typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 + typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 + # Hide todo when the total number of tasks is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + # Hide todo when the number of tasks after filtering is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Todo format. The following parameters are available within the expansion. + # + # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. + # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. + # + # These variables correspond to the last line of the output of `todo.sh -p ls`: + # + # TODO: 24 of 42 tasks shown + # + # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. + # + # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ + # Timewarrior color. + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 + typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 + + # If the tracked task is longer than 24 characters, truncate and append "…". + # Tip: To always display tasks without truncation, delete the following parameter. + # Tip: To hide task names and display just the icon when time tracking is enabled, set the + # value of the following parameter to "". + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + # Custom icon. + # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## + # Taskwarrior color. + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 + typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 + + # Taskwarrior segment format. The following parameters are available within the expansion. + # + # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. + # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. + # + # Zero values are represented as empty parameters. + # + # The default format: + # + # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' + # + # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_BACKGROUND=5 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_BACKGROUND=3 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 + typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ context: user@hostname ]################################## + # Context color when running with privileges. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 + # Context color in SSH without privileges. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 + # Default context color (no privileges, no SSH). + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 + + # Context format when running with privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' + # Context format when in SSH without privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' + # Default context format (no privileges, no SSH): user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + + # Don't show context unless running with privileges or in SSH. + # Tip: Remove the next line to always show context. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' + + ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### + # Python virtual environment color. + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 + # Don't show Python version next to the virtual environment name. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + # Separate environment name from Python version only with a space. + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ anaconda: conda environment (https://conda.io/) ]###################### + # Anaconda environment color. + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ + # Pyenv color. + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 + # Hide python version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + # If set to false, hide python version if it's the same as global: + # $(pyenv version-name) == $(pyenv global). + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide python version if it's equal to "system". + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # The default format has the following logic: + # + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ + # Goenv color. + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 + # Hide go version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + # If set to false, hide go version if it's the same as global: + # $(goenv version-name) == $(goenv global). + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide go version if it's equal to "system". + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## + # Nodenv color. + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 + # Hide node version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + # If set to false, hide node version if it's the same as global: + # $(nodenv version-name) == $(nodenv global). + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### + # Nvm color. + typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ + # Nodeenv color. + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 + # Don't show Node version next to the environment name. + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + # Separate environment name from Node version only with a space. + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############################[ node_version: node.js version ]############################### + # Node version color. + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 + # Show node version only when in a directory tree containing package.json. + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ go_version: go version (https://golang.org) ]######################## + # Go version color. + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 + typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 + # Show go version only when in a go project subdirectory. + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## + # Rust version color. + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 + # Show rust version only when in a rust project subdirectory. + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ + # .NET version color. + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 + # Show .NET version only when in a .NET project subdirectory. + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ php_version: php version (https://www.php.net/) ]###################### + # PHP version color. + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 + # Show PHP version only when in a PHP project subdirectory. + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### + # Laravel version color. + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## + # Rbenv color. + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 + # Hide ruby version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + # If set to false, hide ruby version if it's the same as global: + # $(rbenv version-name) == $(rbenv global). + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide ruby version if it's equal to "system". + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ java_version: java version (https://www.java.com/) ]#################### + # Java version color. + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 + # Show java version only when in a java project subdirectory. + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + # Show brief version. + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + # Custom icon. + # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### + # Package color. + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 + typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 + + # Package format. The following parameters are available within the expansion. + # + # - P9K_PACKAGE_NAME The value of `name` field in package.json. + # - P9K_PACKAGE_VERSION The value of `version` field in package.json. + # + # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## + # Rvm color. + typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 + # Don't show @gemset at the end. + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + # Don't show ruby- at the front. + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ + # Fvm color. + typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### + # Lua color. + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 + # Hide lua version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + # If set to false, hide lua version if it's the same as global: + # $(luaenv version-name) == $(luaenv global). + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide lua version if it's equal to "system". + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ + # Java color. + typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 + typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 + # Hide java version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + # If set to false, hide java version if it's the same as global: + # $(jenv version-name) == $(jenv global). + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide java version if it's equal to "system". + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ + # Perl color. + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 + # Hide perl version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + # If set to false, hide perl version if it's the same as global: + # $(plenv version-name) == $(plenv global). + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide perl version if it's equal to "system". + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show "perl-" at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ + # PHP color. + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 + # Hide php version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + # If set to false, hide php version if it's the same as global: + # $(phpenv version-name) == $(phpenv global). + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide PHP version if it's equal to "system". + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### + # Haskell color. + typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 + typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 + + # Hide haskell version if it doesn't come from one of these sources. + # + # shell: version is set by STACK_YAML + # local: version is set by stack.yaml up the directory tree + # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + # If set to false, hide haskell version if it's the same as in the implicit global project. + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + # Custom icon. + # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# + # Show kubecontext only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show kubecontext. + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' + + # Kubernetes context classes for the purpose of using different colors, icons and expansions with + # different contexts. + # + # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current kubernetes context gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current kubernetes context is "deathray-testing/default", its class is TEST + # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext + # segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # Within the expansion the following parameters are always available: + # + # - P9K_CONTENT The content that would've been displayed if there was no content + # expansion defined. + # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE + # in the output of `kubectl config get-contexts`. If there is no + # namespace, the parameter is set to "default". + # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the + # output of `kubectl config get-contexts`. + # + # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), + # the following extra parameters are available: + # + # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. + # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. + # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. + # + # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, + # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=gke + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + # + # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=eks + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + # Append the current context's namespace if it's not "default". + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + # Custom prefix. + # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' + + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# + # Show aws only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show aws. + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AWS profile gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AWS profile is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 + # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# + # AWS Elastic Beanstalk environment color. + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## + # Show azure only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show azure. + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "company_test", its class is TEST because "company_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_AZURE_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_OTHER_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### + # Show gcloud only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show gcloud. + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' + # Google cloud color. + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 + typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 + + # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or + # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative + # enough. You can use the following parameters in the expansions. Each of them corresponds to the + # output of `gcloud` tool. + # + # Parameter | Source + # -------------------------|-------------------------------------------------------------------- + # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' + # P9K_GCLOUD_ACCOUNT | gcloud config get-value account + # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project + # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. + # + # Obtaining project name requires sending a request to Google servers. This can take a long time + # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud + # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets + # set and gcloud prompt segment transitions to state COMPLETE. + # + # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL + # and COMPLETE. You can also hide gcloud in state PARTIAL by setting + # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and + # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + + # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name + # this often. Negative value disables periodic polling. In this mode project name is retrieved + # only when the current configuration, account or project id changes. + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + + # Custom icon. + # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# + # Show google_app_cred only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show google_app_cred. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Google application credentials classes for the purpose of using different colors, icons and + # expansions with different credentials. + # + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first + # element in each pair defines a pattern against which the current kubernetes context gets + # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion + # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION + # parameters, you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. + # The first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD + # '*:*test*:*' TEST + # '*' DEFAULT) + # + # If your current Google application credentials is "service_account deathray-testing x@y.com", + # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD # These values are examples that are unlikely + # '*:*test*:*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by + # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # You can use the following parameters in the expansion. Each of them corresponds to one of the + # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. + # + # Parameter | JSON key file field + # ---------------------------------+--------------- + # P9K_GOOGLE_APP_CRED_TYPE | type + # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id + # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 + typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' + + ###############################[ public_ip: public IP address ]############################### + # Public IP color. + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 + typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ########################[ vpn_ip: virtual private network indicator ]######################### + # VPN IP color. + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 + typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 + # When on VPN, show just an icon without the IP address. + # Tip: To display the private IP address when on VPN, remove the next line. + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' + # If set to true, show one segment per matching network interface. If set to false, show only + # one segment corresponding to the first matching network interface. + # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + # Custom icon. + # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #########################[ proxy: system-wide http/https/ftp proxy ]########################## + # Proxy color. + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 + typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ battery: internal battery ]################################# + # Show battery in red when it's below this level and not connected to power supply. + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + # Show battery in green when it's charging or fully charged. + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 + # Show battery in yellow when it's discharging. + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 + # Battery pictograms going from low to high level of charge. + typeset -g POWERLEVEL9K_BATTERY_STAGES='\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079' + # Don't show the remaining time to charge/discharge. + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 + + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + + ####################################[ time: current time ]#################################### + # Current time color. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands as opposed to the default + # behavior where they contain the end times of their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TIME_PREFIX='at ' + + # Example of a user-defined prompt segment. Function prompt_example will be called on every + # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or + # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background + # greeting the user. + # + # Type `p10k help segment` for documentation and a more sophisticated example. + function prompt_example() { + p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' + } + + # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job + # is to generate the prompt segment for display in instant prompt. See + # https://github.com/romkatv/powerlevel10k#instant-prompt. + # + # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function + # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k + # will replay these calls without actually calling instant_prompt_*. It is imperative that + # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this + # rule is not observed, the content of instant prompt will be incorrect. + # + # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If + # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. + function instant_prompt_example() { + # Since prompt_example always makes the same `p10k segment` calls, we can call it from + # instant_prompt_example. This will give us the same `example` prompt segment in the instant + # and regular prompts. + prompt_example + } + + # User-defined prompt segments can be customized the same way as built-in segments. + typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 + typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 + # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=off + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/config/kali/dconf/org_gnome.conf b/config/kali/dconf/org_gnome.conf new file mode 100755 index 0000000..090f2a4 --- /dev/null +++ b/config/kali/dconf/org_gnome.conf @@ -0,0 +1,36 @@ +[settings-daemon/plugins/power] +power-button-action='interactive' + +[settings-daemon/plugins/media-keys] +home='e' + +[settings-daemon/plugins/media-keys/custom-keybindings/custom0] +binding='t' +command='gnome-terminal' +name='gnome-terminal' + +[settings-daemon/peripherals/keyboard] +numlock-state='on' + +[gnome-screenshot] +default-file-type='jpg' + +[desktop/interface] +clock-show-date=true + +[desktop/input-sources] +sources=[('xkb', 'fr+oss')] +xkb-options=['shift:breaks_caps'] + +[desktop/wm/keybindings] +move-to-monitor-down=@as [] +move-to-monitor-left=['Left'] +move-to-monitor-right=['Right'] +move-to-monitor-up=@as [] +show-desktop=['d'] +switch-applications=['Tab'] +switch-to-workspace-down=@as [] +switch-to-workspace-left=@as [] +switch-to-workspace-right=@as [] +switch-to-workspace-up=@as [] +toggle-maximized=['Up'] diff --git a/config/nautilus/compiz/CompizConfig.profile b/config/nautilus/compiz/CompizConfig.profile new file mode 100755 index 0000000..527dd0f --- /dev/null +++ b/config/nautilus/compiz/CompizConfig.profile @@ -0,0 +1,73 @@ +[move] +s0_initiate_button = Button1 + +[put] +s0_avoid_offscreen = true +s0_put_bottom_key = Disabled +s0_put_bottomleft_key = Disabled +s0_put_bottomright_key = Disabled +s0_put_left_key = Disabled +s0_put_right_key = Disabled +s0_put_top_key = Disabled +s0_put_topleft_key = Disabled +s0_put_topright_key = Disabled + +s0_put_center_key = Up +s0_put_next_output_key = Right +s0_put_previous_output_key = Left + +[commands] +s0_command0 = google-chrome +s0_command1 = subl ~/bash_aliases +s0_command2 = subl ~/chef-base +s0_command3 = subl ~/display +s0_command4 = subl ~/Documents +s0_command5 = subl ~/Snippets +s0_command6 = subl ~/vagrant +s0_command7 = subl ~/www/vm-shared +s0_command8 = /usr/bin/gnome-system-monitor -p +s0_run_command0_key = c +s0_run_command1_key = b +s0_run_command2_key = f +s0_run_command3_key = i +s0_run_command4_key = d +s0_run_command5_key = s +s0_run_command6_key = v +s0_run_command7_key = w +s0_run_command8_key = Delete + +[resize] +s0_initiate_button = Button2 + +[grid] +s0_put_top_key = KP_8 +s0_put_bottom_key = KP_2 +s0_put_topleft_key = KP_7 +s0_put_topright_key = KP_9 +s0_put_bottomleft_key = KP_1 +s0_put_bottomright_key = KP_3 + +s0_put_center_key = Up +s0_left_maximize = Left +s0_right_maximize = Right +s0_top_edge_action = 5 +s0_bottom_edge_action = 10 + +[unityshell] +s0_execute_command = r +s0_show_desktop_key = d +s0_show_launcher = Disabled +s0_launcher_switcher_forward = Disabled +s0_num_launchers = 1 +s0_launcher_capture_mouse = false +s0_disable_show_desktop = true + +[core] +s0_active_plugins = core;composite;opengl;move;place;compiztoolbox;put;commands;resize;grid;imgpng;scale;expo;unityshell; +s0_outputs = 1920x1080+0+0; +s0_window_menu_button = Button3 + +[scale] +s0_initiate_key = Disabled +s0_initiate_all_key = Tab + diff --git a/config/usr/share/X11/xkb/symbols/pc_focal.bkp b/config/usr/share/X11/xkb/symbols/pc_focal.bkp new file mode 100644 index 0000000..dbe08bb --- /dev/null +++ b/config/usr/share/X11/xkb/symbols/pc_focal.bkp @@ -0,0 +1,87 @@ +default partial alphanumeric_keys modifier_keys +xkb_symbols "pc105" { + + key { [ Escape ] }; + + // The extra key on many European keyboards: + key { [ less, greater, bar, brokenbar ] }; + + // The following keys are common to all layouts. + key { [ backslash, bar ] }; + key { [ space ] }; + + include "srvr_ctrl(fkey2vt)" + include "pc(editing)" + include "keypad(x11)" + + key { [ BackSpace, BackSpace ] }; + + key { [ Tab, ISO_Left_Tab ] }; + key { [ Return ] }; + + key { [ Caps_Lock ] }; + key { [ Num_Lock ] }; + + key { [ Shift_L ] }; + key { [ Control_L ] }; + key { [ Super_L ] }; + + key { [ Shift_R ] }; + key { [ Control_R ] }; + key { [ Super_R ] }; + key { [ Menu ] }; + + // Beginning of modifier mappings. + modifier_map Shift { Shift_L, Shift_R }; + modifier_map Lock { Caps_Lock }; + modifier_map Control{ Control_L, Control_R }; + modifier_map Mod2 { Num_Lock }; + modifier_map Mod4 { Super_L, Super_R }; + + // Fake keys for virtual<->real modifiers mapping: + key { [ ISO_Level3_Shift ] }; + key { [ Mode_switch ] }; + modifier_map Mod5 { , }; + + key { [ NoSymbol, Alt_L ] }; + include "altwin(meta_alt)" + + key { [ NoSymbol, Meta_L ] }; + modifier_map Mod1 { }; + + key { [ NoSymbol, Super_L ] }; + modifier_map Mod4 { }; + + key { [ NoSymbol, Hyper_L ] }; + modifier_map Mod4 { }; + // End of modifier mappings. + + key { [ XF86Display ] }; + key { [ XF86KbdLightOnOff ] }; + key { [ XF86KbdBrightnessDown ] }; + key { [ XF86KbdBrightnessUp ] }; +}; + +hidden partial alphanumeric_keys +xkb_symbols "editing" { + key { + type= "PC_ALT_LEVEL2", + symbols[Group1]= [ Print, Sys_Req ] + }; + key { [ Scroll_Lock ] }; + key { + type= "PC_CONTROL_LEVEL2", + symbols[Group1]= [ Pause, Break ] + }; + key { [ Insert ] }; + key { [ Home ] }; + key { [ Prior ] }; + key { [ Delete ] }; + key { [ End ] }; + key { [ Next ] }; + + key { [ Up ] }; + key { [ Left ] }; + key { [ Down ] }; + key { [ Right ] }; +}; diff --git a/config/usr/share/X11/xkb/symbols/pc_noble.bkp b/config/usr/share/X11/xkb/symbols/pc_noble.bkp new file mode 100644 index 0000000..8560a96 --- /dev/null +++ b/config/usr/share/X11/xkb/symbols/pc_noble.bkp @@ -0,0 +1,91 @@ +// The keys that are common to all standard layouts. +default partial alphanumeric_keys modifier_keys +xkb_symbols "pc105" { + + key {[ Escape ]}; + key {[ Tab, ISO_Left_Tab ]}; + key {[ Caps_Lock ]}; + + key {[ BackSpace, BackSpace ]}; + key {[ backslash, bar ]}; + key {[ Return ]}; + + // The extra key on many European keyboards: + key {[ less, greater, bar, brokenbar ]}; + + key {[ space ]}; + + key {[ Shift_L ]}; + key {[ Shift_R ]}; + key {[ Control_L ]}; + key {[ Control_R ]}; + key {[ Alt_L, Meta_L ]}; + key {[ Alt_R, Meta_R ]}; + key {[ Super_L ]}; + key {[ Super_R ]}; + + key {[ Menu ]}; + + modifier_map Shift { Shift_L, Shift_R }; + modifier_map Lock { Caps_Lock }; + modifier_map Control { Control_L, Control_R }; + modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; + modifier_map Mod2 { Num_Lock }; + modifier_map Mod4 { Super_L, Super_R }; + + // Six fake keys for virtual<->real modifiers mapping: + key {[ ISO_Level3_Shift ]}; + modifier_map Mod5 { }; + + key {[ ISO_Level5_Shift ]}; + modifier_map Mod3 { }; + + key {[ NoSymbol, Alt_L ]}; + modifier_map Mod1 { }; + + key {[ NoSymbol, Meta_L ]}; + modifier_map Mod1 { }; + + key {[ NoSymbol, Super_L ]}; + modifier_map Mod4 { }; + + key {[ NoSymbol, Hyper_L ]}; + modifier_map Mod4 { }; + + include "srvr_ctrl(fkey2vt)" + + key {[ Print, Sys_Req ], type="PC_ALT_LEVEL2" }; + key {[ Scroll_Lock ]}; + key {[ Pause, Break ], type="PC_CONTROL_LEVEL2" }; + + key {[ Insert ]}; + key {[ Delete ]}; + key {[ Home ]}; + key {[ End ]}; + key {[ Prior ]}; + key {[ Next ]}; + + key {[ Up ]}; + key {[ Down ]}; + key {[ Left ]}; + key {[ Right ]}; + + key {[ Num_Lock ]}; + include "keypad(x11)" + + // Extra Japanese keys: + key {[ Muhenkan ]}; + key {[ Henkan ]}; + key {[ Hiragana_Katakana ]}; + key {[ Hiragana ]}; // This key and the next are rare. + key {[ Katakana ]}; + + // Extra Korean keys: + key {[ Hangul ]}; + key {[ Hangul_Hanja ]}; + + key {[ XF86Display ]}; + key {[ XF86KbdLightOnOff ]}; + key {[ XF86KbdBrightnessDown ]}; + key {[ XF86KbdBrightnessUp ]}; +}; diff --git a/crypto/build_xmrig-cuda.sh b/crypto/build_xmrig-cuda.sh new file mode 100755 index 0000000..f4e359a --- /dev/null +++ b/crypto/build_xmrig-cuda.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * build_xmrig-cuda +# * +# * cryptocurrency miner +# * +# * @category crypto +# * @link https://github.com/xmrig/xmrig-cuda +# * @link https://xmrig.com/docs/miner/build/ubuntu +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +REPOSITORY=xmrig/xmrig-cuda +VERSION=$(get_latest_release "${REPOSITORY}") +if [ -z "${VERSION}" ]; then + VERSION=6.15.1 +fi + +alert_primary "Build xmrig-cuda v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'" + exit 1 +fi + +for app in \ + build-essential \ + cmake \ + automake \ + libtool \ + autoconf \ +; do + echo_info "sudo apt-get install -y ${app}" + sudo apt-get install -y ${app} +done + +# download source from github +echo_info "wget -qO \"xmrig-cuda.zip https://github.com/xmrig/xmrig-cuda/archive/refs/tags/v${VERSION}.zip\"" +wget -qO "xmrig-cuda.zip https://github.com/xmrig/xmrig-cuda/archive/refs/tags/v${VERSION}.zip" + +# unzip in current directory +echo_info "unzip xmrig-cuda.zip" +unzip xmrig-cuda.zip + +# create build directory +echo_info "mkdir \"./xmrig-cuda-${VERSION}/build\"" +mkdir "./xmrig-cuda-${VERSION}/build" + +echo_info "cd \"./xmrig-cuda-${VERSION}/build\" || exit" +cd "./xmrig-cuda-${VERSION}/build" || exit + +# build +echo_info 'cmake .. -DCUDA_LIB=/usr/local/cuda/lib64/stubs/libcuda.so -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda' +cmake .. -DCUDA_LIB=/usr/local/cuda/lib64/stubs/libcuda.so -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda + +echo_info "make -j\"$(nproc)\"" +make -j"$(nproc)" + +echo_info "mkdir ~/.xmrig" +mkdir ~/.xmrig + +echo_info "cp -vf \"./xmrig-cuda-${VERSION}/build/libxmrig-cuda.so\" ~/.xmrig" +cp -vf "./xmrig-cuda-${VERSION}/build/libxmrig-cuda.so" ~/.xmrig + +echo_info "rm -rf \"xmrig-cuda-${VERSION}\"" +rm -rf "xmrig-cuda-${VERSION}" + +echo_info "rm -f xmrig-cuda.zip" +rm -f xmrig-cuda.zip + diff --git a/crypto/build_xmrig.sh b/crypto/build_xmrig.sh new file mode 100755 index 0000000..e99b821 --- /dev/null +++ b/crypto/build_xmrig.sh @@ -0,0 +1,97 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * build_xmrig +# * +# * cryptocurrency miner +# * +# * @category crypto +# * @link https://github.com/xmrig/xmrig +# * @link https://xmrig.com/docs/miner/build/ubuntu +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +REPOSITORY=xmrig/xmrig +VERSION=$(get_latest_release "${REPOSITORY}") +if [ -z "${VERSION}" ]; then + VERSION=6.15.3 +fi + +alert_primary "Build xmrig v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'" + exit 1 +fi + +for app in \ + build-essential \ + cmake \ + libuv1-dev \ + libssl-dev \ + libhwloc-dev \ +; do + echo_info "sudo apt-get install -y ${app}" + sudo apt-get install -y ${app} +done + +# download source from github +echo_info "wget -qO \"xmrig.zip https://github.com/xmrig/xmrig/archive/refs/tags/v${VERSION}.zip\"" +wget -qO "xmrig.zip https://github.com/xmrig/xmrig/archive/refs/tags/v${VERSION}.zip" + +# unzip in current directory +echo_info "unzip xmrig.zip" +unzip xmrig.zip + +# remove donation +echo_info "sed -i -E 's/= 1;$/= 0;/' \"./xmrig-${VERSION}/src/donate.h\"" +sed -i -E 's/= 1;$/= 0;/' "./xmrig-${VERSION}/src/donate.h" + +# create build directory +echo_info "mkdir \"./xmrig-${VERSION}/build\"" +mkdir "./xmrig-${VERSION}/build" + +echo_info "cd \"./xmrig-${VERSION}/build\" || exit" +cd "./xmrig-${VERSION}/build" || exit + +# build +echo_info 'cmake ..' +cmake .. + +echo_info "make -j\"$(nproc)\"" +make -j"$(nproc)" + +echo_info "mkdir ~/.xmrig" +mkdir ~/.xmrig + +echo_info "cp -vf \"./xmrig-${VERSION}/build/xmrig\" ~/.xmrig" +cp -vf "./xmrig-${VERSION}/build/xmrig" ~/.xmrig + +echo_info "cp -vf ./config.json ~/.xmrig" +cp -vf ./config.json ~/.xmrig + +echo_info "rm -rf \"xmrig-${VERSION}\"" +rm -rf "xmrig-${VERSION}" + +echo_info "rm -f xmrig.zip" +rm -f xmrig.zip + diff --git a/crypto/config.json b/crypto/config.json new file mode 100644 index 0000000..ae224b5 --- /dev/null +++ b/crypto/config.json @@ -0,0 +1,169 @@ +{ + "api": { + "id": null, + "worker-id": null + }, + "http": { + "enabled": false, + "host": "127.0.0.1", + "port": 0, + "access-token": null, + "restricted": true + }, + "autosave": true, + "background": false, + "colors": true, + "title": true, + "randomx": { + "init": -1, + "init-avx2": -1, + "mode": "auto", + "1gb-pages": false, + "rdmsr": true, + "wrmsr": true, + "cache_qos": false, + "numa": true, + "scratchpad_prefetch_mode": 1 + }, + "cpu": { + "enabled": true, + "huge-pages": true, + "huge-pages-jit": false, + "hw-aes": null, + "priority": null, + "memory-pool": false, + "yield": true, + "asm": true, + "argon2-impl": null, + "astrobwt-max-size": 550, + "astrobwt-avx2": false, + "argon2": [0, 1, 3], + "astrobwt": [0, 2, 1, 3], + "cn": [ + [1, 0], + [1, 1] + ], + "cn-heavy": [ + [1, 0] + ], + "cn-lite": [ + [1, 0], + [1, 1], + [1, 3] + ], + "cn-pico": [ + [2, 0], + [2, 2], + [2, 1], + [2, 3] + ], + "cn/upx2": [ + [2, 0], + [2, 2], + [2, 1], + [2, 3] + ], + "rx": [0, 1], + "rx/arq": [0, 2, 1, 3], + "rx/wow": [0, 1, 3], + "cn-lite/0": false, + "cn/0": false, + "rx/keva": "rx/wow" + }, + "opencl": { + "enabled": false, + "cache": true, + "loader": null, + "platform": "AMD", + "adl": true, + "cn-lite/0": false, + "cn/0": false + }, + "cuda": { + "enabled": false, + "loader": null, + "nvml": true, + "cn-lite/0": false, + "cn/0": false + }, + "log-file": null, + "donate-level": 1, + "donate-over-proxy": 1, + "pools": [ + { + "algo": null, + "coin": "eth", + "url": "rx.unmineable.com:3333", + "user": "ETH:0xD595d5455aD343E501cb889458c5BF6F89C59f8f.Tangoman75#e4xd-wmzl", + "pass": "x", + "rig-id": null, + "nicehash": false, + "keepalive": false, + "enabled": true, + "tls": false, + "tls-fingerprint": null, + "daemon": false, + "socks5": null, + "self-select": null, + "submit-to-origin": false + }, + { + "algo": "rx/0", + "coin": "monero", + "url": "xmr-eu1.nanopool.org:14433", + "user": "", + "pass": "x", + "rig-id": null, + "nicehash": false, + "keepalive": false, + "enabled": true, + "tls": false, + "tls-fingerprint": null, + "daemon": false, + "socks5": null, + "self-select": null, + "submit-to-origin": false + }, + { + "algo": "rx/0", + "coin": "eth", + "url": "eth-eu1.nanopool.org:9433", + "user": "0xD595d5455aD343E501cb889458c5BF6F89C59f8f", + "pass": "x", + "rig-id": null, + "nicehash": false, + "keepalive": false, + "enabled": true, + "tls": false, + "tls-fingerprint": null, + "daemon": false, + "socks5": null, + "self-select": null, + "submit-to-origin": false + } + ], + "retries": 5, + "retry-pause": 5, + "print-time": 60, + "health-print-time": 60, + "dmi": true, + "syslog": false, + "tls": { + "enabled": false, + "protocols": null, + "cert": null, + "cert_key": null, + "ciphers": null, + "ciphersuites": null, + "dhparam": null + }, + "dns": { + "ipv6": false, + "ttl": 30 + }, + "user-agent": null, + "verbose": 0, + "watch": true, + "pause-on-battery": false, + "pause-on-active": false +} \ No newline at end of file diff --git a/crypto/derivative.asc.1 b/crypto/derivative.asc.1 new file mode 100644 index 0000000..fa83892 --- /dev/null +++ b/crypto/derivative.asc.1 @@ -0,0 +1,1193 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFLYY+gBEACb5AqqsBuxzGlqSQZoua/CI/kr9YOagD9G8I+aBXoTUqyTSafy +JvamqxcV1mti0QKhyQsw43f340R9lGvdGTm7JhsESuHwbkAPxa6hOdjvNy//5NkK +N+wWUm6PGiAmLmgxYp69PHMUzSkKeMIlOxEINFlvnkAsB945Zm1mEZcWiSIQEpgd +crfi8B0CKw/9hzHoQZpvc9Jt9ZeWlZOQR/vowz0Mb5vGT9IwMVoVjmdDJF4K/Nuo +cj9PrBOfzS1UBtgaornkddCVYvOSr2YWu1baKtyf2JkLx1uCSU34kvyy8/11e3Rh +xmskoqvT/P7ChCHRxQTKNN4Zz/iB/OjlXWOA1e1E46NvIfxezMtz7smbV2WPk799 +mXjqpZJWJirJWZAB6B4GDm1vc0K1qvWMKrdNHPu02To96KgYW8iHH0Vn+0jgz7ag +7ocLvgFxOZwDUc8qkWxPZBOUFClv1epW1UIGCsZ/OmHfpm6qTjUgLA6pijUEEYBs +i7gzKKg6wvt6UK19FYrtBk93H0rQN8eS48U5e45JGmvLVgb523uN+OOkkKuJIGOP +ue60lE4euUuKOSgGQKZPL8bAnz3YdpRVPacPzgYnMhns4m1fQFkhpmMAYN6YYl3P +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BhedvzZJtq +YSM35Xau7ktDUQsEiBNrfmKh7MXhxTDrXvNtZyB0q1D4Qs5gemv0MU17XAX14jbe +MSAHqx+mLcFokR5tnQN1jgOwV/OYUy6l6Ybq3+t2iIdofjeiiDrpv5RJ/bIEmopO +lGe/k38Tm0QfO+3nTE34IqVBYAxp4IvCPux8mcdiqkg/FXW4Ml76ftXmKxGJIhip +gn75gy40OxFX4IRaLMLT+eb3DTUfmNe9f7j4aeVwWwOhpL25wCefZfWWdPLLU4Fc +CxNIHHHqgcxO3wrm2XTLvAlqoQlBCrqTdOwxr5VGUCrN/rwAqInLW3urSJoB5ckj +XMfEesAVZcRq9a3dRDQNNBJTg3ezCjFjdNr9VKQhDdOA2862xkUxpJkLghS2HOt2 +/1g+hDJ2Lua3YhcA8ogsP+f3MWCwXGM72ynoa2Jr2q/pFxHdsYT9bF7uE+FhMS6k +fbv+c8nLSB25DrQGLE5+v1YzsS+bQ4V+f8rgzchKF7rxcEj8BDXHYwR64RBIPqfY +QhdxPvxQmxdJ2D4irkSfeICN2KaDVm8q8QcnsjS2fwvADx8s9I3xBaMxBu9t/px1 +Whapos8dv40= +=AgOr +-----END PGP PUBLIC KEY BLOCK----- diff --git a/crypto/electrum.png b/crypto/electrum.png new file mode 100644 index 0000000..a980433 Binary files /dev/null and b/crypto/electrum.png differ diff --git a/crypto/install_electrum.sh b/crypto/install_electrum.sh new file mode 100755 index 0000000..aa3e3ce --- /dev/null +++ b/crypto/install_electrum.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * electrum +# * +# * bitcoin wallet +# * +# * @category crypto +# * @link https://electrum.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=4.1.5 + +alert_primary "Install electrum v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'mkdir ~/.electrum' +mkdir ~/.electrum + +echo_info "wget -qO ~/.electrum/electrum.AppImage https://download.electrum.org/${VERSION}/electrum-${VERSION}-x86_64.AppImage" +wget -qO ~/.electrum/electrum.AppImage https://download.electrum.org/${VERSION}/electrum-${VERSION}-x86_64.AppImage + +echo_info 'chmod a+x ~/.electrum/electrum.AppImage' +chmod a+x ~/.electrum/electrum.AppImage + +echo_info 'cp -fv electrum.png ~/.electrum' +cp -fv electrum.png ~/.electrum + +# create desktop shortcut +cat > "$(xdg-user-dir DESKTOP)"/electrum.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * monero-gui +# * +# * monero wallet +# * +# * @category crypto +# * @link https://getmonero.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install monero' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +# download the apt signing key +echo_info 'wget -q https://www.whonix.org/derivative.asc' +wget -q https://www.whonix.org/derivative.asc + +# add the apt signing key +echo_info 'sudo mv -fv ./derivative.asc /usr/share/keyrings/derivative.asc' +sudo mv -fv ./derivative.asc /usr/share/keyrings/derivative.asc + +# add the derivative repository +echo_info 'echo "deb [signed-by=/usr/share/keyrings/derivative.asc] https://deb.whonix.org bullseye main contrib non-free" | sudo tee /etc/apt/sources.list.d/derivative.list' +echo "deb [signed-by=/usr/share/keyrings/derivative.asc] https://deb.whonix.org bullseye main contrib non-free" | sudo tee /etc/apt/sources.list.d/derivative.list + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install monero-gui' +sudo apt-get install monero-gui + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/monero-gui.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/monero-gui.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/crypto/install_mycrypto.sh b/crypto/install_mycrypto.sh new file mode 100755 index 0000000..00e8746 --- /dev/null +++ b/crypto/install_mycrypto.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mycrypto +# * +# * ethereum wallet +# * +# * @category crypto +# * @link https://app.mycrypto.com +# * @link https://www.mycrypto.com +# * @link https://github.com/MyCryptoHQ/MyCrypto +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=1.7.17 + +alert_primary "Install MyCrypto v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'mkdir ~/.mycrypto' +mkdir ~/.mycrypto + +# -O, --output-document=FILE write documents to FILE +echo_info "wget -qO ~/.mycrypto/mycrypto.AppImage https://github.com/MycryptoHQ/MyCrypto/releases/download/${VERSION}/linux-x86-64_${VERSION}_MyCrypto.AppImage" +wget -qO ~/.mycrypto/mycrypto.AppImage https://github.com/MycryptoHQ/MyCrypto/releases/download/${VERSION}/linux-x86-64_${VERSION}_MyCrypto.AppImage + +echo_info 'chmod a+x ~/.mycrypto/mycrypto.AppImage' +chmod a+x ~/.mycrypto/mycrypto.AppImage + +echo_info 'cp -fv mycrypto.png ~/.mycrypto' +cp -fv mycrypto.png ~/.mycrypto + +# create desktop shortcut +cat > "$(xdg-user-dir DESKTOP)"/mycrypto.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install_xmrig +# * +# * cryptocurrency miner +# * +# * @category crypto +# * @link https://github.com/xmrig/xmrig +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +REPOSITORY=xmrig/xmrig +VERSION=$(get_latest_release "${REPOSITORY}") +if [ -z "${VERSION}" ]; then + VERSION=6.15.1 +fi + +alert_primary "Install xmrig v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v tar)" ]; then + echo_error "\"$(basename "${0}")\" requires tar, try: 'sudo apt-get install -y tar'" + exit 1 +fi + +echo_info "wget -q \"https://github.com/xmrig/xmrig/releases/download/v${VERSION}/xmrig-${VERSION}-focal-x64.tar.gz\"" +wget -q "https://github.com/xmrig/xmrig/releases/download/v${VERSION}/xmrig-${VERSION}-focal-x64.tar.gz" + +echo_info "tar -zxf \"xmrig-${VERSION}-focal-x64.tar.gz\"" +tar -zxf "xmrig-${VERSION}-focal-x64.tar.gz" + +# remove previous version +echo_info "rm -rf ~/.xmrig" +rm -rf ~/.xmrig + +echo_info "mv -f \"xmrig-${VERSION}\" ~/.xmrig" +mv -f "xmrig-${VERSION}" ~/.xmrig + +echo_info "rm -f \"xmrig-${VERSION}-focal-x64.tar.gz\"" +rm -f "xmrig-${VERSION}-focal-x64.tar.gz" + diff --git a/crypto/mycrypto.png b/crypto/mycrypto.png new file mode 100644 index 0000000..f01682c Binary files /dev/null and b/crypto/mycrypto.png differ diff --git a/crypto/start_xmrig.sh b/crypto/start_xmrig.sh new file mode 100755 index 0000000..dacaaa9 --- /dev/null +++ b/crypto/start_xmrig.sh @@ -0,0 +1,498 @@ +#!/bin/sh +set -e + +#/* +# * This script is based on TangoMan Shoe Shell Microframework version 0.8.0-sm +# * +# * This file is distributed under to the MIT license. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * Permission is hereby granted, free of charge, to any person obtaining a copy +# * of this software and associated documentation files (the "Software"), to deal +# * in the Software without restriction, including without limitation the rights +# * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# * copies of the Software, and to permit persons to whom the Software is +# * furnished to do so, subject to the following conditions: +# * +# * The above copyright notice and this permission notice shall be included in all +# * copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# * SOFTWARE. +# * +# * Source code is available here: https://github.com/TangoMan75/shoe +# */ + +#/** +# * TangoMan Start xmrig +# * +# * NOTE: run as root to enable "MSR MOD" which allow higher hash rate +# * +# * @author "Matthias Morin" +# * @version 0.8.0-sm +# * +# * @link https://dev.to/courseprobe/how-to-mine-shiba-inu-shib-with-your-computer-in-under-5-minutes-in-2021-4e13 +# * @link https://unmineable.com/coins/SHIB +# * +# * @link https://eth.nanopool.org +# * @link https://xmr.nanopool.org +# */ + +#-------------------------------------------------- +# Place your parameters after this line +#-------------------------------------------------- + +## What is your bitcoin wallet public address ? /[a-zA-Z0-9]+/ +btc='3Dxh2xUgejCPWtdcmQgusJeyiYBChqRTHa' + +## What is your dogecoin wallet public address ? /[a-zA-Z0-9]+/ +doge='DJruqNbLiAiaTHZ7dWGtXfdoUhfCdpsyYH' + +## What is your ethereum wallet public address ? /[a-zA-Z0-9]+/ +eth='0xD595d5455aD343E501cb889458c5BF6F89C59f8f' + +## What is your XMR wallet public address ? /[a-zA-Z0-9]+/ +xmr='' + +## What is your shiba inu wallet public address ? /[a-zA-Z0-9]+/ +shib='0x16982149A74aE87C610F83E5f95a86133Bae89fd' + +## What is the worker name ? /[a-zA-Z0-9]+/ +worker='TangoMan75' + +## Set xmrig binary path /~?[a-zA-Z0-9/._-]+/ +path=~/.xmrig + +## Huge pages size /[0-9]+/ +hugepages=2048 + +## Referal code /[a-z0-9-]+/ +referal_code='e4xd-wmzl' + +## Pool url /[a-zA-Z0-9/._-]+/ +pool='' + +#-------------------------------------------------- +# Place flags after this line +#-------------------------------------------------- + +## Use cuda +cuda=false + +## Use nanopool.org +nanopool=false + +## Use unmineable pool +unmineable=false + +#-------------------------------------------------- +# Place your constants after this line +#-------------------------------------------------- + +## nanopool url for ethereum https://eth.nanopool.org +ETH_NANOPOOL='eth-eu1.nanopool.org:9433' + +## nanopool url for monero https://xmr.nanopool.org +XMR_NANOPOOL='xmr-eu1.nanopool.org:14433' + +## unmineable url +UNMINEABLE='rx.unmineable.com:3333' + +#-------------------------------------------------- +# Place your functions after this line +#-------------------------------------------------- + +## Start mining bitcoins +btc() { + _init + + if [ "${unmineable}" = true ]; then + echo_info "https://unmineable.com/coins/btc/address/${btc}\n" + + echo_info "sudo ${path}/xmrig --url \"${pool}\" --user \"BTC:${btc}.${worker}#${referal_code}\" --pass x\n" + sudo ${path}/xmrig --url "${pool}" --user "BTC:${btc}.${worker}#${referal_code}" --pass x + else + echo_danger "btc not configured to use \"${pool}\"\n" + fi +} + +## Start mining dogecoins +doge() { + _init + + if [ "${unmineable}" = true ]; then + echo_info "https://unmineable.com/coins/doge/address/${doge}\n" + + echo_info "sudo ${path}/xmrig --url \"${pool}\" --user \"DOGE:${doge}.${worker}#${referal_code}\" --pass x\n" + sudo ${path}/xmrig --url "${pool}" --user "DOGE:${doge}.${worker}#${referal_code}" --pass x + else + echo_danger "doge not configured to use \"${pool}\"\n" + fi +} + +## Start mining ethereum coins +eth() { + _init + + if [ "${unmineable}" = true ]; then + echo_info "https://unmineable.com/coins/eth/address/${eth}\n" + + echo_info "sudo ${path}/xmrig --url \"${pool}\" --user \"ETH:${eth}.${worker}#${referal_code}\" --pass x\n" + sudo ${path}/xmrig --url "${pool}" --user "ETH:${eth}.${worker}#${referal_code}" --pass x + fi + + if [ "${nanopool}" = true ]; then + pool="${ETH_NANOPOOL}" + + echo_info "sudo ${path}/xmrig --url \"${pool}\" --user \"${xmr}\" --tls --coin eth --algo rx/0\n" + sudo ${path}/xmrig --url "${pool}" --user "${xmr}" --tls --coin eth --algo rx/0 + fi +} + +## Start mining shiba inu coins +shib() { + _init + + if [ "${unmineable}" = true ]; then + echo_info "https://unmineable.com/coins/shib/address/${shib}\n" + + if [ "${cuda}" = true ]; then + echo_info "sudo ${path}/xmrig --url \"${pool}\" --user \"SHIB:${shib}.${worker}#${referal_code}\" --pass x --cuda --cuda-loader ~/.xmrig/libxmrig-cuda.so\n" + sudo ${path}/xmrig --url "${pool}" --user "SHIB:${shib}.${worker}#${referal_code}" --pass x --cuda --cuda-loader ~/.xmrig/libxmrig-cuda.so + else + echo_info "sudo ${path}/xmrig --url \"${pool}\" --user \"SHIB:${shib}.${worker}#${referal_code}\" --pass x\n" + sudo ${path}/xmrig --url "${pool}" --user "SHIB:${shib}.${worker}#${referal_code}" --pass x + fi + else + echo_danger "shib not configured to use \"${pool}\"\n" + fi +} + +## Start mining monero +xmr() { + _init + + if [ "${unmineable}" = true ]; then + echo_info "https://unmineable.com/coins/xmr/address/${xmr}\n" + + echo_info "sudo ${path}/xmrig --url \"${pool}\" --user \"XMR:${xmr}.${worker}#${referal_code}\" --pass x\n" + sudo ${path}/xmrig --url "${pool}" --user "XMR:${xmr}.${worker}#${referal_code}" --pass x + fi + + if [ "${nanopool}" = true ]; then + pool="${XMR_NANOPOOL}" + + echo_info "sudo ${path}/xmrig --url \"${pool}\" --user \"${xmr}\" --tls --coin monero\n" + sudo ${path}/xmrig --url "${pool}" --user "${xmr}" --tls --coin monero + fi +} + +## Config huge pages +config() { + echo_info 'grep Huge /proc/meminfo\n' + grep Huge /proc/meminfo + + echo_info "sudo sysctl -w vm.nr_hugepages=${hugepages}\n" + sudo sysctl -w vm.nr_hugepages=${hugepages} + + # refresh kernel parameters + echo_info 'sysctl -p' + sysctl -p + + echo_info 'sudo sysctl -a | grep vm.nr_hugepages\n' + sudo sysctl -a | grep vm.nr_hugepages +} + +#-------------------------------------------------- +# Place your private functions after this line +#-------------------------------------------------- + +## Init miner configuration +_init() { + if [ "${nanopool}" = true ] && [ "${unmineable}" = true ]; then + echo_danger 'Configuration error : "nanopool" and "unmineable" settings are mutually exclusive\n' + return 1 + fi + + if [ "${nanopool}" = false ] && [ "${unmineable}" = false ]; then + echo_danger 'Configuration error : pool setting is required\n' + return 1 + fi + + if [ "${unmineable}" = true ]; then + pool="${UNMINEABLE}" + fi +} + +## This allows to avoid "unused variable" shellcheck warning +_private() { + echo "${ETH_NANOPOOL}" + echo "${XMR_NANOPOOL}" + echo "${UNMINEABLE}" +} + +#-------------------------------------------------- +# Semantic colors set +#-------------------------------------------------- + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[1;104;97m'; ALERT_SECONDARY='\033[1;45;97m'; ALERT_SUCCESS='\033[1;42;97m'; ALERT_DANGER='\033[1;41;97m'; ALERT_WARNING='\033[1;43;97m'; ALERT_INFO='\033[1;44;97m'; ALERT_LIGHT='\033[1;47;90m'; ALERT_DARK='\033[1;40;37m'; +} + +echo_primary() { printf "%b%b${DEFAULT}" "${PRIMARY}" "${*}"; } +echo_secondary() { printf "%b%b${DEFAULT}" "${SECONDARY}" "${*}"; } +echo_success() { printf "%b%b${DEFAULT}" "${SUCCESS}" "${*}"; } +echo_danger() { printf "%b%b${DEFAULT}" "${DANGER}" "${*}"; } +echo_warning() { printf "%b%b${DEFAULT}" "${WARNING}" "${*}"; } +echo_info() { printf "%b%b${DEFAULT}" "${INFO}" "${*}"; } +echo_light() { printf "%b%b${DEFAULT}" "${LIGHT}" "${*}"; } +echo_dark() { printf "%b%b${DEFAULT}" "${DARK}" "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2"; else printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}"; fi } +echo_error() { printf "%berror: %b${DEFAULT}" "${DANGER}" "${*}"; } + +alert_primary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" ''; } +alert_secondary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" ''; } +alert_success() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "${*}" "${ALERT_SUCCESS}" ''; } +alert_danger() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DANGER}" '' "${ALERT_DANGER}" "${*}" "${ALERT_DANGER}" ''; } +alert_warning() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "${*}" "${ALERT_WARNING}" ''; } +alert_info() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "${*}" "${ALERT_INFO}" ''; } +alert_light() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" ''; } +alert_dark() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" ''; } + +#-------------------------------------------------- +# Self documentation +#-------------------------------------------------- + +### Help + +## Print this help (default) +help() { + _padding=$(_get_padding) + + _print_title "$(_get_docbloc_title)" + _print_infos "${_padding}" + _print_description "$(_get_docbloc_description)" + _print_usage + _print_options "${_padding}" + _print_commands "${_padding}" +} + +#-------------------------------------------------- + +_print_title() { + printf "${EOL}${ALERT_PRIMARY}%64s${EOL}${ALERT_PRIMARY} %-63s${EOL}${ALERT_PRIMARY}%64s${EOL}\n" '' "$1" ''; +} + +_print_infos() { + # $1 = padding + if [ -z "$1" ]; then set -- 12; fi + printf "%bInfos:%b\n" "${WARNING}" "${DEFAULT}" + printf "${SUCCESS} %-$1s ${DEFAULT}%s\n" 'author' "$(_get_docbloc 'author')" + printf "${SUCCESS} %-$1s ${DEFAULT}%s\n" 'version' "$(_get_docbloc 'version')" + printf "${SUCCESS} %-$1s ${DEFAULT}%s\n" 'link' "$(_get_docbloc 'link')" + printf '\n' +} + +_print_description() { + printf "%bDescription:%b\n" "${WARNING}" "${DEFAULT}" + printf "\033[97m %s${EOL}\n" "$(printf '%s' "$1" | fold -w 64 -s)" +} + +_print_usage() { + printf "%bUsage:%b\n" "${WARNING}" "${DEFAULT}" + printf "${INFO} sh %s${INFO} [${SUCCESS}command${INFO}]${DEFAULT} " "$(basename "${0}")" + awk -F '=' "/^[a-zA-Z0-9_]+=.+\$/ { + if (substr(PREV, 1, 3) == \"## \" && \$1 != toupper(\$1) && substr(\$0, 1, 1) != \"_\") + printf \"${INFO}(${SUCCESS}--%s ${WARNING}%s${INFO})${DEFAULT} \", \$1, \$2 + } { PREV = \$0 }" "$0" + printf '\n\n' +} + +_print_options() { + # $1 = padding + if [ -z "$1" ]; then set -- 12; fi + printf "%bOptions:%b\n" "${WARNING}" "${DEFAULT}" + awk -F '=' "/^[a-zA-Z0-9_]+=.+\$/ { + if (substr(PREV, 1, 3) == \"## \" && \$1 != toupper(\$1) && substr(\$0, 1, 1) != \"_\") { + if (match(PREV, / \/.+\//)) { + CONSTRAINT=substr(PREV, RSTART, RLENGTH); + ANNOTATION=substr(PREV, 4, length(PREV)-length(CONSTRAINT)-3); + printf \"${SUCCESS} --%-$1s ${DEFAULT}%s${SUCCESS}%s${INFO} (default: ${WARNING}%s${INFO})${EOL}\", \$1, ANNOTATION, CONSTRAINT, \$2 + } else { + printf \"${SUCCESS} --%-$1s ${DEFAULT}%s${INFO} (default: ${WARNING}%s${INFO})${EOL}\", \$1, substr(PREV, 4), \$2 + } + } + } { PREV = \$0 }" "$0" + printf '\n' +} + +_print_commands() { + # $1 = padding + if [ -z "$1" ]; then set -- 12; fi + printf "%bCommands:%b\n" "${WARNING}" "${DEFAULT}" + awk "/^### /{printf\"\n${WARNING}%s:${EOL}\",substr(\$0,5)} + /^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub(\"^function \",\"\"); gsub(\"[ ()]\",\"\"); + FUNCTION = substr(\$0, 1, index(\$0, \"{\")); + sub(\"{\$\", \"\", FUNCTION); + if (substr(PREV, 1, 3) == \"## \" && substr(\$0, 1, 1) != \"_\") + printf \"${SUCCESS} %-$(($1+2))s ${DEFAULT}%s\n\", FUNCTION, substr(PREV, 4) + } { PREV = \$0 }" "$0" + printf '\n' +} + +#-------------------------------------------------- +# Docbloc parsing +#-------------------------------------------------- + +_get_docbloc_title() { + awk '/^#\/\*\*$/,/^# \*\/$/{i+=1; if (i==2) print substr($0, 5)}' "$0" +} + +_get_docbloc_description() { + awk '/^# \* @/ {i=2} /^#\/\*\*$/,/^# \*\/$/{i+=1; if (i>3) printf "%s ", substr($0, 5)}' "$0" +} + +_get_docbloc() { + awk -v TAG="$1" '/^#\/\*\*$/,/^# \*\/$/{if($3=="@"TAG){for(i=4;i<=NF;++i){printf "%s ",$i}}}' "$0" +} + +_get_padding() { + awk -F '=' '/^[a-zA-Z0-9_]+=.+$/ { MATCH = $1 } + /^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); + MATCH = substr($0, 1, index($0, "{")); + sub("{$", "", MATCH); + } { if (substr(PREV, 1, 3) == "## " && substr(MATCH, 1, 1) != "_" && length(MATCH) > LENGTH) LENGTH = length(MATCH) } + { PREV = $0 } END { print LENGTH+1 }' "$0" +} + +#-------------------------------------------------- +# Core +#-------------------------------------------------- + +_get_functions() { + # this regular expression matches functions with either bash or sh syntax + awk '/^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); # remove leading "function ", round brackets and extra spaces + FUNCTION = substr($0, 1, index($0, "{")); # truncate string after opening curly brace + sub("{$", "", FUNCTION); # remove trailing curly brace + if (substr(PREV, 1, 3) == "## " && substr($0, 1, 1) != "_") print FUNCTION + } { PREV = $0 }' "$0" +} + +_get_variables() { + # constants and private variables will be ignored + awk -F '=' '/^[a-zA-Z0-9_]+=.+$/ { + if (substr(PREV, 1, 3) == "## " && $1 != toupper($1) && substr($0, 1, 1) != "_")print $1 + } { PREV = $0 }' "$0" +} + +#-------------------------------------------------- +# Validation +#-------------------------------------------------- + +_get_constraints() { + awk -v NAME="$1" -F '=' '/^[a-zA-Z0-9_]+=.+$/ { + if (substr(PREV, 1, 3) == "## " && $1 == NAME) {match(PREV, /\/.+\//); print substr(PREV, RSTART, RLENGTH)} + } { PREV = $0 }' "$0" +} + +_validate() { + _validate_variable=$(printf '%s' "$1" | cut -d= -f1) + _validate_value=$(printf '%s' "$1" | cut -d= -f2) + _validate_pattern=$(_get_constraints "${_validate_variable}") + if [ -z "${_validate_pattern}" ]; then + return 0 + fi + if [ "${_validate_value}" != "$(printf '%s' "${_validate_value}" | awk "match(\$0, ${_validate_pattern}) {print substr(\$0, RSTART, RLENGTH)}")" ]; then + printf "${DANGER}error: invalid \"%s\", expected \"%s\", \"%s\" given${EOL}" "${_validate_variable}" "${_validate_pattern}" "${_validate_value}" + exit 1 + fi +} + +#-------------------------------------------------- +# Main loop +#-------------------------------------------------- + +_main() { + if [ $# -lt 1 ]; then + help + exit 0 + fi + + _error='' + _eval='' + _execute='' + _requires_value='' + for _argument in "$@"; do + _is_valid=false + # check if previous argument requires value + if [ -n "${_requires_value}" ]; then + _eval="${_eval} ${_requires_value}=${_argument}" + _requires_value='' + continue + fi + # check argument is a valid option (must start with - or --) + if [ -n "$(printf '%s' "${_argument}" | awk '/^--?[a-zA-Z0-9_]+$/{print}')" ]; then + for _variable in $(_get_variables); do + # get shorthand character + _shorthand="$(printf '%s' "${_variable}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "--${_variable}" ] || [ "${_argument}" = "-${_shorthand}" ]; then + _requires_value="${_variable}" + _is_valid=true + break + fi + done + if [ "${_is_valid}" = false ]; then + _error="\"${_argument}\" is not a valid option" + break + fi + continue + fi + for _function in $(_get_functions); do + # get shorthand character + _shorthand="$(printf '%s' "${_function}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "${_function}" ] || [ "${_argument}" = "${_shorthand}" ]; then + # append argument to the execute stack + _execute="${_execute} ${_function}" + _is_valid=true + break + fi + done + if [ "${_is_valid}" = false ]; then + _error="\"${_argument}\" is not a valid command" + break + fi + done + + if [ -n "${_requires_value}" ]; then + _error="\"--${_requires_value}\" requires value" + fi + + if [ -n "${_error}" ]; then + printf "${DANGER}error: %s${EOL}" "${_error}" + exit 1 + fi + + for _variable in ${_eval}; do + # invalid parameters will raise errors + _validate "${_variable}" + eval "${_variable}" + done + + for _function in ${_execute}; do + eval "${_function}" + done +} + +_main "$@" diff --git a/dev/config_git.sh b/dev/config_git.sh new file mode 100755 index 0000000..d17d94f --- /dev/null +++ b/dev/config_git.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * git +# * distributed version control tool +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_secondary 'Config git' + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +# default push config +echo_info 'git config --global push.default simple' +git config --global push.default simple + +# default branch name config +echo_info 'git config --global init.defaultBranch main' +git config --global init.defaultBranch main + +# detached HEAD advice +git config --global advice.detachedHead false + +# Set git to use the credential memory cache +echo_info 'git config --global credential.helper cache' +git config --global credential.helper cache + +# Set the cache to timeout after 1 hour (setting is in seconds) +echo_info "git config --global credential.helper 'cache --timeout=3600'" +git config --global credential.helper 'cache --timeout=3600' + +# set vim as git default editor if installed +if [ -x /usr/bin/vim ] ; then + git config --global core.editor 'vim' +fi diff --git a/dev/config_php-xdebug.sh b/dev/config_php-xdebug.sh new file mode 100755 index 0000000..0d67bb6 --- /dev/null +++ b/dev/config_php-xdebug.sh @@ -0,0 +1,548 @@ +#!/bin/bash +set -e + +#/* +# * This script is based on TangoMan Shoe Shell Microframework version 0.8.0-xs +# * +# * This file is distributed under to the MIT license. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * Permission is hereby granted, free of charge, to any person obtaining a copy +# * of this software and associated documentation files (the "Software"), to deal +# * in the Software without restriction, including without limitation the rights +# * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# * copies of the Software, and to permit persons to whom the Software is +# * furnished to do so, subject to the following conditions: +# * +# * The above copyright notice and this permission notice shall be included in all +# * copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# * SOFTWARE. +# * +# * Source code is available here: https://github.com/TangoMan75/shoe +# */ + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config php-xdebug +# * +# * php debug module +# * +# * @category dev +# * @link https://xdebug.org/docs/install +# * @link https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html#updatingPhpIni +# */ + +## Install xdebug configuration +install() { + # find all "xdebug.ini" files path + find /etc/php/ -type f -name 'xdebug.ini' | while read -r XDEBUG_INI_PATH + do + _backup "${XDEBUG_INI_PATH}" + _remove_xdebug_config "${XDEBUG_INI_PATH}" + _create_xdebug_config "${XDEBUG_INI_PATH}" + _custom_settings "${XDEBUG_INI_PATH}" + done + + _restart_php_service "$(get_php_version)" + version +} + +## Print PHP version +get_php_version() { + # grep -o : only matching pattern + # grep -m1 : stop after first match + php --version | grep -o -m1 "[0-9]\.[0-9]" | head -n1 +} + +## Backup xdebug configuration +_backup() { + if [ "$#" -lt 1 ]; then + echo_error "some mandatory argument is missing\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [path]\n" + + return 1 + fi + + if [ "$#" -gt 1 ]; then + echo_error "too many arguments (${#})\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [path]\n" + + return 1 + fi + + if [ ! -e "$1" ]; then + echo_error "invalid path ($1)\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [path]\n" + + return 1 + fi + + if [ ! -d "$(get_curdir)" ]; then + echo_error "\"$(get_curdir)\" folder does not exist\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [path]\n" + + return 1 + fi + + # generate path with current date and current script name + local BACKUP_DIR + BACKUP_DIR="$(get_curdir)/../backups/$(date '+%Y-%m-%d')/$(basename "$0" .sh)" + + if [ ! -d "${BACKUP_DIR}" ]; then + echo_info "mkdir -p \"${BACKUP_DIR}\"\n" + mkdir -p "${BACKUP_DIR}" + fi + + if [ -d "$1" ]; then + # copy whole directory + echo_info "cp -rf \"$1\" \"${BACKUP_DIR}\"\n" + cp -rf "$1" "${BACKUP_DIR}" + else + # copy file + echo_info "cp -f \"$1\" \"${BACKUP_DIR}\"\n" + cp -f "$1" "${BACKUP_DIR}" + fi +} + +## Remove xdebug configuration +_remove_xdebug_config() { + if [ ! -f "$1" ]; then + echo_error "\"$1\" file does not exist\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [file_path]\n" + + return 1 + fi + + echo_info "sudo sed -i -E '/^\[xdebug\]$/d' \"$1\"\n" + sudo sed -i -E '/^\[xdebug\]$/d' "$1" + + echo_info "sudo sed -i -E '/zend_extension\s?=.*xdebug/d' \"$1\"\n" + sudo sed -i -E '/zend_extension\s?=.*xdebug/d' "$1" + + echo_info "sudo sed -i -E '/xdebug.+=.+/d' \"$1\"\n" + sudo sed -i -E '/xdebug.+=.+/d' "$1" +} + +## Create xdebug configuration +_create_xdebug_config() { + if [ ! -f "$1" ]; then + echo_error "\"$1\" file does not exist\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [file_path]\n" + + return 1 + fi + + if < "$1" grep -q -E 'zend_extension\s?=\s?.*xdebug'; then + echo_warning "xdebug settings already presents in \"$1\"" + _remove_xdebug_config "$1" + fi + + echo_info "cat >> \"$1\" <> \"$1\" < edit files in place + # sed -E => regexp extended + echo_info "sudo sed -i -E s/\"^;?${PARAMETER}\s?=.*$/${PARAMETER}=${VALUE}\"/g \"$2\"\n" + sudo sed -i -E s/"^;?${PARAMETER}\s?=.*$/${PARAMETER}=${VALUE}"/g "$2" +} + +## Unset parameter +_unset_parameter() { + if [ "$#" -lt 2 ]; then + echo_error "some mandatory argument is missing\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [ini_parameter] [file_path]\n" + + return 1 + fi + + if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [ini_parameter] [file_path]\n" + + return 1 + fi + + if [ ! -f "$2" ]; then + echo_error "\"$2\" file does not exist\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [ini_parameter] [file_path]\n" + + return 1 + fi + + # escaping slashes + PARAMETER=$(echo "$1" | cut -d= -f1| sed 's/\//\\\//g') + + echo_secondary "unset \"${PARAMETER}\"" + + # sed -i => edit files in place + # sed -E => regexp extended + echo_info "sudo sed -i -E s/\"(^${PARAMETER}\s?=.*$)/;\1\"/g \"$2\"\n" + sudo sed -i -E s/"(^${PARAMETER}\s?=.*$)/;\1"/g "$2" +} + +## Get curdir +get_curdir() { + dirname "$(realpath "${BASH_SOURCE[0]}")" +} + +## Get PHP ini path +get_php_ini_path() { + php -i 2>/dev/null | grep -E "Loaded Configuration File => .+php.ini" | sed 's/Loaded Configuration File => //' +} + +## Get xdebug ini path +get_xdebug_ini_path() { + local XDEBUG_INI_PATH + + find /etc/php/ -type f -name 'xdebug.ini' | while read -r XDEBUG_INI_PATH + do + echo "${XDEBUG_INI_PATH}" + done +} + +## Get xdebug bin path +get_xdebug_bin_path() { + local XDEBUG_BIN_PATH + + XDEBUG_BIN_PATH=$(find /usr/lib/php/ -name 'xdebug.so' | grep xdebug.so) + + echo "${XDEBUG_BIN_PATH}" +} + +## Restart php service +_restart_php_service() { + if [ "$#" -lt 1 ]; then + echo_error "some mandatory argument is missing\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [version]\n" + + return 1 + fi + + if [ "$#" -gt 1 ]; then + echo_error "too many arguments (${#})\n" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [version]\n" + + return 1 + fi + + echo_info "sudo systemctl restart \"php$1-fpm\"\n" + sudo systemctl restart "php$1-fpm" +} + +## Open in sublime text +open_in_sublime_text() { + PHP_INI_PATH=$(get_php_ini_path) + find /etc/php/ -type f -name 'xdebug.ini' | while read -r XDEBUG_INI_PATH + do + sudo subl "${XDEBUG_INI_PATH}" + done + sudo subl "${PHP_INI_PATH}" +} + +## Print version infos +version() { + local VERSION + VERSION=$(get_php_version) + + echo_info "php -v\n" + php -v + + echo_info "php-fpm${VERSION} -v\n" + php-fpm"$(get_php_version)" -v + + echo_info "php -v | grep -i xdebug\n" + php -v | grep -i xdebug + + # list installed modules + echo_info "php -m | grep xdebug\n" + php -m | grep xdebug + + echo_info "php --ini | grep xdebug\n" + php --ini | grep xdebug + + echo_label 3 'xdebug ini path' + get_xdebug_ini_path + + echo_label 3 'xdebug bin path' + get_xdebug_bin_path + + echo_label 3 'php ini path' + get_php_ini_path + +} + +#-------------------------------------------------- +# Semantic colors set +#-------------------------------------------------- + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[1;104;97m'; ALERT_SECONDARY='\033[1;45;97m'; ALERT_SUCCESS='\033[1;42;97m'; ALERT_DANGER='\033[1;41;97m'; ALERT_WARNING='\033[1;43;97m'; ALERT_INFO='\033[1;44;97m'; ALERT_LIGHT='\033[1;47;90m'; ALERT_DARK='\033[1;40;37m'; +} + +echo_primary() { printf "%b%b${DEFAULT}" "${PRIMARY}" "${*}"; } +echo_secondary() { printf "%b%b${DEFAULT}" "${SECONDARY}" "${*}"; } +echo_success() { printf "%b%b${DEFAULT}" "${SUCCESS}" "${*}"; } +echo_danger() { printf "%b%b${DEFAULT}" "${DANGER}" "${*}"; } +echo_warning() { printf "%b%b${DEFAULT}" "${WARNING}" "${*}"; } +echo_info() { printf "%b%b${DEFAULT}" "${INFO}" "${*}"; } +echo_light() { printf "%b%b${DEFAULT}" "${LIGHT}" "${*}"; } +echo_dark() { printf "%b%b${DEFAULT}" "${DARK}" "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2"; else printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}"; fi } +echo_error() { printf "%berror: %b${DEFAULT}" "${DANGER}" "${*}"; } + +alert_primary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" ''; } +alert_secondary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" ''; } +alert_success() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "${*}" "${ALERT_SUCCESS}" ''; } +alert_danger() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DANGER}" '' "${ALERT_DANGER}" "${*}" "${ALERT_DANGER}" ''; } +alert_warning() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "${*}" "${ALERT_WARNING}" ''; } +alert_info() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "${*}" "${ALERT_INFO}" ''; } +alert_light() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" ''; } +alert_dark() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" ''; } + +#-------------------------------------------------- +# Self documentation +#-------------------------------------------------- + +### Help + +## Print this help (default) +help() { + _padding=$(_get_padding) + + _print_title "$(_get_docbloc_title)" + _print_infos "${_padding}" + _print_description "$(_get_docbloc_description)" + _print_usage + _print_commands "${_padding}" +} + +#-------------------------------------------------- + +_print_title() { + printf "${EOL}${ALERT_PRIMARY}%64s${EOL}${ALERT_PRIMARY} %-63s${EOL}${ALERT_PRIMARY}%64s${EOL}\n" '' "$1" ''; +} + +_print_infos() { + # $1 = padding + if [ -z "$1" ]; then set -- 12; fi + printf "%bInfos:%b\n" "${WARNING}" "${DEFAULT}" + printf "${SUCCESS} %-$1s ${DEFAULT}%s\n" 'author' "$(_get_docbloc 'author')" + printf "${SUCCESS} %-$1s ${DEFAULT}%s\n" 'version' "$(_get_docbloc 'version')" + printf "${SUCCESS} %-$1s ${DEFAULT}%s\n" 'link' "$(_get_docbloc 'link')" + printf '\n' +} + +_print_description() { + printf "%bDescription:%b\n" "${WARNING}" "${DEFAULT}" + printf "\033[97m %s${EOL}\n" "$(printf '%s' "$1" | fold -w 64 -s)" +} + +_print_usage() { + printf "%bUsage:%b\n" "${WARNING}" "${DEFAULT}" + printf "${INFO} sh %s${INFO} [${SUCCESS}command${INFO}]${DEFAULT}\n\n" "$(basename "${0}")" +} + +_print_commands() { + # $1 = padding + if [ -z "$1" ]; then set -- 12; fi + printf "%bCommands:%b\n" "${WARNING}" "${DEFAULT}" + awk "/^### /{printf\"\n${WARNING}%s:${EOL}\",substr(\$0,5)} + /^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub(\"^function \",\"\"); gsub(\"[ ()]\",\"\"); + FUNCTION = substr(\$0, 1, index(\$0, \"{\")); + sub(\"{\$\", \"\", FUNCTION); + if (substr(PREV, 1, 3) == \"## \" && substr(\$0, 1, 1) != \"_\") + printf \"${SUCCESS} %-$1s ${DEFAULT}%s\n\", FUNCTION, substr(PREV, 4) + } { PREV = \$0 }" "$0" + printf '\n' +} + +#-------------------------------------------------- +# Docbloc parsing +#-------------------------------------------------- + +_get_docbloc_title() { + awk '/^#\/\*\*$/,/^# \*\/$/{i+=1; if (i==2) print substr($0, 5)}' "$0" +} + +_get_docbloc_description() { + awk '/^# \* @/ {i=2} /^#\/\*\*$/,/^# \*\/$/{i+=1; if (i>3) printf "%s ", substr($0, 5)}' "$0" +} + +_get_docbloc() { + awk -v TAG="$1" '/^#\/\*\*$/,/^# \*\/$/{if($3=="@"TAG){for(i=4;i<=NF;++i){printf "%s ",$i}}}' "$0" +} + +_get_padding() { + awk -F '=' '/^[a-zA-Z0-9_]+=.+$/ { MATCH = $1 } + /^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); + MATCH = substr($0, 1, index($0, "{")); + sub("{$", "", MATCH); + } { if (substr(PREV, 1, 3) == "## " && substr(MATCH, 1, 1) != "_" && length(MATCH) > LENGTH) LENGTH = length(MATCH) } + { PREV = $0 } END { print LENGTH+1 }' "$0" +} + +#-------------------------------------------------- +# Core +#-------------------------------------------------- + +_get_functions() { + # this regular expression matches functions with either bash or sh syntax + awk '/^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); # remove leading "function ", round brackets and extra spaces + FUNCTION = substr($0, 1, index($0, "{")); # truncate string after opening curly brace + sub("{$", "", FUNCTION); # remove trailing curly brace + if (substr(PREV, 1, 3) == "## " && substr($0, 1, 1) != "_") print FUNCTION + } { PREV = $0 }' "$0" +} + +#-------------------------------------------------- +# Main loop +#-------------------------------------------------- + +_main() { + if [ $# -lt 1 ]; then + help + exit 0 + fi + + _execute='' + for _argument in "$@"; do + _is_valid=false + for _function in $(_get_functions); do + # get shorthand character + _shorthand="$(printf '%s' "${_function}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "${_function}" ] || [ "${_argument}" = "${_shorthand}" ]; then + # append argument to the execute stack + _execute="${_execute} ${_function}" + _is_valid=true + break + fi + done + # unknown parameters will raise errors + if [ "${_is_valid}" = false ]; then + printf "${DANGER}error: \"%s\" is not a valid command${EOL}" "${_argument}" + exit 1 + fi + done + + for _function in ${_execute}; do + eval "${_function}" + done +} + +_main "$@" diff --git a/dev/config_php.sh b/dev/config_php.sh new file mode 100755 index 0000000..bb94e03 --- /dev/null +++ b/dev/config_php.sh @@ -0,0 +1,309 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config php modules +# * +# * @category dev +# * @link https://xdebug.org/docs/install +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +PHP_INI_PATH=$(php -i 2>/dev/null | sed -E -n 's/Loaded Configuration File => (.+php.ini)/\1/p') +PRODUCTION=false + +VALID_VERSIONS=(3.0 4.0 4.1 4.2 4.3 4.4 5.0 5.1 5.2 5.3 5.4 5.5 5.6 7.1 7.2 7.3 7.4 8.0 8.1 8.2) +DEFAULT_VERSION="$(php --version | grep -o -m1 "[0-9]\.[0-9]" | head -n1)" + +if [ "$#" -gt 3 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -d (development) -p (production) -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :dpv:h OPTION; do + case "${OPTION}" in + d) PRODUCTION=false;; + p) PRODUCTION=true;; + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install php' + echo_label 12 'usage'; echo_primary "${0} -v [version] -d (development) -p (production) -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi +# check valid version +INSTALL=false +for VALID_VERSION in "${VALID_VERSIONS[@]}"; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done + +alert_secondary "TangoMan PHP${VERSION} Configurator" + +if [ "${INSTALL}" != true ]; then + echo_error "Cannot config \"php${VERSION}\", invalid version" + exit 1 +fi + +function get_xdebug_path() { + find /usr/lib/php/ -name 'xdebug.so' | grep xdebug.so +} + +function production_settings() { + echo_primary 'disable remote urls for file handling functions (default: On)' + set_configuration 'allow_url_fopen=Off' + + echo_primary 'disable error message (default: Off)' + set_configuration 'display_errors=Off' + + echo_primary 'hiding the presence of php (default: On)' + set_configuration 'expose_php=Off' + + echo_primary 'enable logging (default: On)' + set_configuration 'log_errors=Off' + + echo_primary 'max script execution time (default: 30)' + set_configuration 'max_execution_time=30' + + echo_primary 'max time spent parsing input (default: 60)' + set_configuration 'max_input_time=60' + + echo_primary 'max memory used by one script (default: 128)' + set_configuration 'memory_limit=16M' + + echo_primary 'enable opcache (default: 1)' + set_configuration 'opcache.enable=1' + + echo_primary 'maximum number of files that can be stored in the cache (default: 10000)' + set_configuration 'opcache.max_accelerated_files=20000' + + echo_primary 'maximum memory that OPcache can use to store compiled PHP files (default: 128)' + set_configuration 'opcache.memory_consumption=256' + + echo_primary "Don't Check PHP Files Timestamps (default: 1)" + set_configuration 'opcache.validate_timestamps=0' + + echo_primary 'max post size (default: 8M))' + set_configuration 'post_max_size=8M' + + echo_primary 'maximum memory allocated to store the results (default: 4096k)' + set_configuration 'realpath_cache_size=4096k' + + echo_primary 'save the results for 10 minutes (600 seconds) (default: 120)' + set_configuration 'realpath_cache_ttl=600' + + echo_primary 'max upload file size (default: 2M)' + set_configuration 'upload_max_filesize=2M' + + echo_primary 'disable xdebug' + set_configuration 'zend_extension=xdebug.so' + + # echo_primary "restricting what php can read & write" + # set_configuration 'open_basedir=/var/www' + + # echo_primary "disable register global" + # set_configuration 'register_globals=Off' + + # echo_primary "advanced safe mode setting" + # set_configuration 'safe_mode=Off' + # set_configuration 'safe_mode_allowed_env_vars=PHP_' + # set_configuration 'safe_mode_exec_dir=/var/www/binaries' + # set_configuration 'safe_mode_gid=On' +} + +function development_settings() { + echo_primary 'show the presence of php (default: On)' + set_configuration 'expose_php=On' + + echo_primary 'enable logging (default: On)' + set_configuration 'log_errors=On' + + echo_primary 'unlimited execution time (default: 30)' + set_configuration 'max_execution_time=-1' + + echo_primary 'allow maximum memory usage (default: 128)' + set_configuration 'memory_limit=-1' + + echo_primary 'unlimited upload file size (default: 2M)' + set_configuration 'upload_max_filesize=-1' +} + +function default_settings() { + echo_primary 'disable remote urls for file handling functions (default: On)' + set_configuration 'allow_url_fopen=On' + + echo_primary 'disable error message (default: Off)' + set_configuration 'display_errors=Off' + + echo_primary 'show the presence of php (default: On)' + set_configuration 'expose_php=On' + + echo_primary 'enable logging (default: On)' + set_configuration 'log_errors=On' + + echo_primary 'max script execution time (default: 30)' + set_configuration 'max_execution_time=30' + + echo_primary 'max time spent parsing input (default: 60)' + set_configuration 'max_input_time=60' + + echo_primary 'max memory used by one script (default: 128)' + set_configuration 'memory_limit=128' + + echo_primary 'enable opcache (default: 1)' + set_configuration 'opcache.enable=1' + + echo_primary 'maximum number of files that can be stored in the cache (default: 10000)' + set_configuration 'opcache.max_accelerated_files=10000' + + echo_primary 'maximum memory that OPcache can use to store compiled PHP files (default: 128)' + set_configuration 'opcache.memory_consumption=128' + + echo_primary "Don't Check PHP Files Timestamps (default: 1)" + set_configuration 'opcache.validate_timestamps=0' + + echo_primary 'max post size (default: 8M))' + set_configuration 'post_max_size=8M' + + echo_primary 'maximum memory allocated to store the results (default: 4096k)' + set_configuration 'realpath_cache_size=4096k' + + echo_primary 'save the results for 10 minutes (600 seconds) (default: 120)' + set_configuration 'realpath_cache_ttl=120' + + echo_primary 'max upload file size (default: 2M)' + set_configuration 'upload_max_filesize=2M' +} + +function allow_alternative_php_versions() { + # allows to configure alternative php versions + echo_info 'sudo update-alternatives --config php' + sudo update-alternatives --config php +} + +function backup_php_ini() { + echo_info "cp \"${PHP_INI_PATH}\" ." + cp "${PHP_INI_PATH}" . +} + +function set_configuration() { + PARAMETER=$(echo "$1" | cut -d= -f1) + VALUE=$(echo "$1" | cut -d= -f2) + + echo_secondary "${PARAMETER}=${VALUE}" + + # sed -i => edit files in place + # sed -E => regexp extended + echo_info "sudo sed -i -E s/\"^;?${PARAMETER}\s?=.*$/${PARAMETER} = ${VALUE}\"/g \"${PHP_INI_PATH}\"" + sudo sed -i -E s/"^;?${PARAMETER}\s?=.*$/${PARAMETER}=${VALUE}"/g "${PHP_INI_PATH}" +} + +function enable_extensions() { + EXTENSIONS=(curl exif fileinfo gd2 intl mbstring openssl pdo_mysql pdo_pgsql pdo_sqlite soap sqlite3) + + for EXTENSION in "${EXTENSIONS[@]}"; do + enable_extension "${EXTENSION}" + done +} + +function disable_extensions() { + EXTENSIONS=(curl exif fileinfo gd2 intl mbstring openssl pdo_mysql pdo_pgsql pdo_sqlite soap sqlite3) + + for EXTENSION in "${EXTENSIONS[@]}"; do + disable_extension "${EXTENSION}" + done +} + +function enable_parameter() { + echo_info "sudo sed -i -E s/\"^;($1\s?=.*)/\1\"/g \"${PHP_INI_PATH}\"" + sudo sed -i -E s/"^;($1\s?=.*)/\1"/g "${PHP_INI_PATH}" +} + +function disable_parameter() { + echo_info "sudo sed -i -E s/\"^($1\s?=.*)/;\1\"/g \"${PHP_INI_PATH}\"" + sudo sed -i -E s/"^($1\s?=.*)/;\1"/g "${PHP_INI_PATH}" +} + +function enable_extension() { + echo_info "sudo sed -i -E s/\"^;extension=$1\s?.*/extension=$1\"/g \"${PHP_INI_PATH}\"" + sudo sed -i -E s/"^;extension=$1\s?.*/extension=$1"/g "${PHP_INI_PATH}" +} + +function disable_extension() { + echo_info "sudo sed -i -E s/\"^extension=$1.*/;extension=$1\"/g \"${PHP_INI_PATH}\"" + sudo sed -i -E s/"^extension=$1.*/;extension=$1"/g "${PHP_INI_PATH}" +} + +function open_in_sublime_text() { + echo_info "sudo subl \"${PHP_INI_PATH}\"" + sudo subl "${PHP_INI_PATH}" +} + +function restart_php_service() { + # restart php-fpm service + echo_info "sudo systemctl restart \"php${VERSION}-fpm\"" + sudo systemctl restart "php${VERSION}-fpm" +} + +function print_infos() { + echo_info 'php -v' + php -v + + echo_info "\"php-fpm${VERSION}\" -v" + "php-fpm${VERSION}" -v + + echo_info 'php --ini' + php --ini + + # list installed modules + echo_info 'php -m' + php -m +} + +function main() { + if [ -z "${PHP_INI_PATH}" ]; then + echo_error 'php is not installed' + return 1 + fi + + echo_info "${PHP_INI_PATH}" + + # backup_php_ini + # open_in_sublime_text + + default_settings + + if [ "${PRODUCTION}" = true ]; then + production_settings + else + development_settings + fi + + # enable_extensions + # disable_extensions + + restart_php_service + print_infos +} + +main diff --git a/dev/install_blackfire.sh b/dev/install_blackfire.sh new file mode 100755 index 0000000..424effa --- /dev/null +++ b/dev/install_blackfire.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * blackfire +# * php performance test profiler +# * +# * @link https://www.blackfire.io +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'wget -qO - https://packagecloud.io/gpg.key | sudo apt-key add -' +wget -qO - https://packagecloud.io/gpg.key | sudo apt-key add - + +echo_info 'echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list' +echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes blackfire-agent' +sudo apt-get install --assume-yes blackfire-agent + +echo_info 'sudo apt-get install --assume-yes blackfire-php' +sudo apt-get install --assume-yes blackfire-php + +echo_info 'sudo blackfire-agent -register' +sudo blackfire-agent -register + +echo_info 'blackfire-agent -d' +blackfire-agent -d diff --git a/dev/install_cachetool.sh b/dev/install_cachetool.sh new file mode 100755 index 0000000..b04a8af --- /dev/null +++ b/dev/install_cachetool.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * cachetool +# * php opcache manager +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v php)" ]; then + echo_error "\"$(basename "${0}")\" requires php, try: 'sudo apt-get install -y php'" + exit 1 +fi + +echo_info 'php -r "copy('http://gordalina.github.io/cachetool/downloads/cachetool.phar', 'cachetool.phar');"' +php -r "copy('http://gordalina.github.io/cachetool/downloads/cachetool.phar', 'cachetool.phar');" + +# install cachetool globally +echo_info 'sudo mv -fv cachetool.phar /usr/local/bin/cachetool' +sudo mv -fv cachetool.phar /usr/local/bin/cachetool + +# make cachetool executable +echo_info 'sudo chmod uga+x /usr/local/bin/cachetool' +sudo chmod uga+x /usr/local/bin/cachetool + +echo_info 'sync' +sync + diff --git a/dev/install_composer.sh b/dev/install_composer.sh new file mode 100755 index 0000000..a5493c8 --- /dev/null +++ b/dev/install_composer.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * composer +# * php dependency manager +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install composer' + +if [ ! -x "$(command -v php)" ]; then + echo_error "\"$(basename "${0}")\" requires php, try: 'sudo apt-get install -y php'" + exit 1 +fi + +# download latest stable composer.phar +echo_info "php -r \"copy('https://getcomposer.org/composer-stable.phar', 'composer.phar');\"" +php -r "copy('https://getcomposer.org/composer-stable.phar', 'composer.phar');" + +# install composer globally +echo_info 'sudo mv -fv composer.phar /usr/local/bin/composer' +sudo mv -fv composer.phar /usr/local/bin/composer + +# set executable permissions +echo_info 'sudo chmod uga+x /usr/local/bin/composer' +sudo chmod uga+x /usr/local/bin/composer + +echo_info 'sync' +sync + +echo_info 'composer clear-cache' +composer clear-cache diff --git a/dev/install_csvtool.sh b/dev/install_csvtool.sh new file mode 100755 index 0000000..e7265eb --- /dev/null +++ b/dev/install_csvtool.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * csvtool +# * csvtool is a tool for performing manipulations on csv files from shell scripts +# * +# * @category dev +# * @link http://colin.maudry.com/csvtool-manual-page +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes csvtool' +sudo apt-get install --assume-yes csvtool diff --git a/dev/install_gem.sh b/dev/install_gem.sh new file mode 100755 index 0000000..5578c4c --- /dev/null +++ b/dev/install_gem.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * gem +# * ruby gem bundle +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo gem install bundle' +sudo gem install bundle diff --git a/dev/install_git.sh b/dev/install_git.sh new file mode 100755 index 0000000..3622f91 --- /dev/null +++ b/dev/install_git.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * git +# * distributed version control tool +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install git' + +echo_info 'sudo apt-get install --assume-yes git' +sudo apt-get install --assume-yes git diff --git a/dev/install_github-cli.sh b/dev/install_github-cli.sh new file mode 100755 index 0000000..9da9b76 --- /dev/null +++ b/dev/install_github-cli.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Github CLI +# * +# * gh --help +# * +# * @category dev +# * @link https://github.com/cli/cli/ +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +VERSION=$(get_latest_release cli/cli) +if [ -z "${VERSION}" ]; then + VERSION=2.24.3 +fi + +alert_primary "Install git-cli v${VERSION}" + +# download archive +echo_info "wget \"https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz\"" +wget "https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz" + +# extract archive +echo_info "tar xvzf \"gh_${VERSION}_linux_amd64.tar.gz\"" +tar xvzf "gh_${VERSION}_linux_amd64.tar.gz" + +# install globally +echo_info "sudo mv -fv \"./gh_${VERSION}_linux_amd64/bin/gh\" /usr/local/bin/gh" +sudo mv -fv "./gh_${VERSION}_linux_amd64/bin/gh" /usr/local/bin/gh + +# set executable permissions +echo_info "sudo chmod uga+x /usr/local/bin/gh" +sudo chmod uga+x /usr/local/bin/gh + +# clean +echo_info "rm -rf \"gh_${VERSION}_linux_amd64\"" +rm -rf "gh_${VERSION}_linux_amd64" + +echo_info "rm -f \"gh_${VERSION}_linux_amd64.tar.gz\"" +rm -f "gh_${VERSION}_linux_amd64.tar.gz" + +echo_info 'sync' +sync + +# remove pager +echo_info 'gh config set pager cat' +gh config set pager cat + +echo_info 'gh config set editor vim' +gh config set editor vim + diff --git a/dev/install_jq.sh b/dev/install_jq.sh new file mode 100755 index 0000000..142fa49 --- /dev/null +++ b/dev/install_jq.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * jq +# * jq is a lightweight and flexible command-line json processor +# * +# * @category dev +# * @link https://stedolan.github.io/jq +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install jq' + +echo_info 'sudo apt-get install --assume-yes jq' +sudo apt-get install --assume-yes jq diff --git a/dev/install_mkcert.sh b/dev/install_mkcert.sh new file mode 100755 index 0000000..a95d08f --- /dev/null +++ b/dev/install_mkcert.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mkcert +# * manage locally-trusted development certificates +# * +# * @category dev +# * @link https://github.com/FiloSottile/mkcert +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=1.4.3 + +alert_primary "Install mkcert v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'sudo apt-get install --assume-yes libnss3-tools' +sudo apt-get install --assume-yes libnss3-tools + +# download binary +# -O, --output-document=FILE write documents to FILE +echo_info "wget -qO mkcert https://github.com/FiloSottile/mkcert/releases/download/v${VERSION}/mkcert-v${VERSION}-linux-amd64" +wget -qO mkcert https://github.com/FiloSottile/mkcert/releases/download/v${VERSION}/mkcert-v${VERSION}-linux-amd64 + +# install globally +echo_info "sudo mv -fv ./mkcert /usr/local/bin/mkcert" +sudo mv -fv ./mkcert /usr/local/bin/mkcert + +# set executable permissions +echo_info "sudo chmod uga+x /usr/local/bin/mkcert" +sudo chmod uga+x /usr/local/bin/mkcert + +echo_info 'sync' +sync diff --git a/dev/install_node-sass.sh b/dev/install_node-sass.sh new file mode 100755 index 0000000..8c00939 --- /dev/null +++ b/dev/install_node-sass.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * node-sass +# * +# * `yarn init` +# * `yarn add --dev node-sass` +# * `yarn build` +# * `yarn watch` +# * +# * ``` +# * "scripts": { +# * "build": "node-sass --include-path scss ./scss/style.scss ./css/style.css", +# * "watch": "node-sass --watch ./scss/style.scss ./css/style.css" +# * }, +# * ``` +# * +# * @category dev +# * @link https://sass-lang.com/install +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install node-sass' + +if [ ! -x "$(command -v npm)" ] && [ ! -x "$(command -v yarn)" ]; then + echo_error "\"$(basename "${0}")\" requires yarm, try: 'sudo apt-get install -y yarm'" + exit 1 +fi + +if [ -x "$(command -v yarn)" ]; then + echo_info 'yarn global add node-sass' + yarn global add node-sass + + echo_info 'yarn global list' + yarn global list + + echo_info 'node-sass --version' + node-sass --version + + exit 0 +fi + +if [ -x "$(command -v npm)" ]; then + echo_info 'npm install node-sass -g' + npm install node-sass -g + + echo_info 'node-sass --version' + node-sass --version + + exit 0 +fi + diff --git a/dev/install_nodejs.sh b/dev/install_nodejs.sh new file mode 100755 index 0000000..2dc8857 --- /dev/null +++ b/dev/install_nodejs.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * nodejs +# * javascript backend engine +# * +# * @link https://github.com/nodesource/distributions +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VALID_VERSIONS=(16 18 20) +DEFAULT_VERSION=18 +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install Node.js' + echo_label 12 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi +# check valid version +INSTALL=false +for VALID_VERSION in "${VALID_VERSIONS[@]}"; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done +if [ "${INSTALL}" != true ]; then + echo_error "\"$(basename "${0}")\" invalid version \"${VERSION}\"" + exit 1 +fi + +alert_primary "Install Node.js v${VERSION}" + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +echo_info 'sudo apt-get install -y ca-certificates gnupg' +sudo apt-get install -y ca-certificates gnupg + +echo_info 'sudo mkdir -p /etc/apt/keyrings' +sudo mkdir -p /etc/apt/keyrings + +echo_info 'curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg' +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + +echo_info "echo \"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${VERSION}.x nodistro main\" | sudo tee /etc/apt/sources.list.d/nodesource.list" +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${VERSION}.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes nodejs' +sudo apt-get install --assume-yes nodejs + +echo_info 'node --version' +node --version diff --git a/dev/install_npm.sh b/dev/install_npm.sh new file mode 100755 index 0000000..d350d01 --- /dev/null +++ b/dev/install_npm.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * npm +# * javascript package manager +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install npm' + +if [ ! -x "$(command -v node)" ]; then + echo_error "\"$(basename "${0}")\" requires node, try: 'sudo apt-get install -y nodejs'" + exit 1 +fi + +echo_info 'sudo npm install -g npm' +sudo npm install -g npm + +# security fix +# ------------ +# +# avoids npm runnig arbitrary postinstall scripts +# +# package.json +#```json +# "scripts": { +# "postinstall": "virus.js" +# } +#``` + +echo_info 'npm config set ignore-scripts true' +npm config set ignore-scripts true diff --git a/dev/install_phalcon_php-modules.sh b/dev/install_phalcon_php-modules.sh new file mode 100755 index 0000000..f27240b --- /dev/null +++ b/dev/install_phalcon_php-modules.sh @@ -0,0 +1,174 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * php-modules +# * php extensions +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VALID_VERSIONS=(7.3 7.4 8.0 8.1) +DEFAULT_VERSION="$(php --version | grep -o -m1 "[0-9]\.[0-9]" | head -n1)" + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -o (optional) -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install php-modules' + echo_label 12 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi +# check valid version +INSTALL=false +for VALID_VERSION in "${VALID_VERSIONS[@]}"; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done + +alert_primary "Install Phalcon PHP modules for PHP${VERSION}" + +if [ "${INSTALL}" = false ]; then + echo_error "Cannot install modules for \"php${VERSION}\", invalid version" + exit 1 +fi + +# install essential plugins for phalcon + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-calendar\"" +sudo apt-get install --assume-yes "php${VERSION}-calendar" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-ctype\"" +sudo apt-get install --assume-yes "php${VERSION}-ctype" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-curl\"" +sudo apt-get install --assume-yes "php${VERSION}-curl" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-dom\"" +sudo apt-get install --assume-yes "php${VERSION}-dom" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-exif\"" +sudo apt-get install --assume-yes "php${VERSION}-exif" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-ffi\"" +sudo apt-get install --assume-yes "php${VERSION}-ffi" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-fileinfo\"" +sudo apt-get install --assume-yes "php${VERSION}-fileinfo" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-ftp\"" +sudo apt-get install --assume-yes "php${VERSION}-ftp" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-gettext\"" +sudo apt-get install --assume-yes "php${VERSION}-gettext" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-iconv\"" +sudo apt-get install --assume-yes "php${VERSION}-iconv" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-igbinary\"" +sudo apt-get install --assume-yes "php${VERSION}-igbinary" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-json\"" +sudo apt-get install --assume-yes "php${VERSION}-json" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-mbstring\"" +sudo apt-get install --assume-yes "php${VERSION}-mbstring" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-opcache\"" +sudo apt-get install --assume-yes "php${VERSION}-opcache" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-pdo\"" +sudo apt-get install --assume-yes "php${VERSION}-pdo" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-pdo_pgsql\"" +sudo apt-get install --assume-yes "php${VERSION}-pdo_pgsql" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-pgsql\"" +sudo apt-get install --assume-yes "php${VERSION}-pgsql" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-phalcon\"" +sudo apt-get install --assume-yes "php${VERSION}-phalcon" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-phar\"" +sudo apt-get install --assume-yes "php${VERSION}-phar" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-posix\"" +sudo apt-get install --assume-yes "php${VERSION}-posix" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-psr\"" +sudo apt-get install --assume-yes "php${VERSION}-psr" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-readline\"" +sudo apt-get install --assume-yes "php${VERSION}-readline" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-redis\"" +sudo apt-get install --assume-yes "php${VERSION}-redis" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-shmop\"" +sudo apt-get install --assume-yes "php${VERSION}-shmop" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-simplexml\"" +sudo apt-get install --assume-yes "php${VERSION}-simplexml" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-sockets\"" +sudo apt-get install --assume-yes "php${VERSION}-sockets" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-sysvmsg\"" +sudo apt-get install --assume-yes "php${VERSION}-sysvmsg" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-sysvsem\"" +sudo apt-get install --assume-yes "php${VERSION}-sysvsem" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-sysvshm\"" +sudo apt-get install --assume-yes "php${VERSION}-sysvshm" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-tokenizer\"" +sudo apt-get install --assume-yes "php${VERSION}-tokenizer" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-wddx\"" +sudo apt-get install --assume-yes "php${VERSION}-wddx" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-xdebug\"" +sudo apt-get install --assume-yes "php${VERSION}-xdebug" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-xml\"" +sudo apt-get install --assume-yes "php${VERSION}-xml" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-xmlreader\"" +sudo apt-get install --assume-yes "php${VERSION}-xmlreader" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-xmlwriter\"" +sudo apt-get install --assume-yes "php${VERSION}-xmlwriter" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-xsl\"" +sudo apt-get install --assume-yes "php${VERSION}-xsl" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-zip\"" +sudo apt-get install --assume-yes "php${VERSION}-zip" diff --git a/dev/install_php-cs-fixer.sh b/dev/install_php-cs-fixer.sh new file mode 100755 index 0000000..3c07a03 --- /dev/null +++ b/dev/install_php-cs-fixer.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * PHP CS Fixer +# * +# * @link https://cs.symfony.com +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=3 + +alert_primary 'Install php-cs-fixer' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +# download with wget +echo_info "wget -q https://cs.symfony.com/download/php-cs-fixer-v${VERSION}.phar" +wget -q https://cs.symfony.com/download/php-cs-fixer-v${VERSION}.phar + +# install php-cs-fixer globally +echo_info "sudo mv -fv php-cs-fixer-v${VERSION}.phar /usr/local/bin/php-cs-fixer" +sudo mv -fv php-cs-fixer-v${VERSION}.phar /usr/local/bin/php-cs-fixer + +# set executable permissions +echo_info 'sudo chmod uga+x /usr/local/bin/php-cs-fixer' +sudo chmod uga+x /usr/local/bin/php-cs-fixer + +echo_info 'sync' +sync + diff --git a/dev/install_php-extension-installer.sh b/dev/install_php-extension-installer.sh new file mode 100755 index 0000000..4c33dbd --- /dev/null +++ b/dev/install_php-extension-installer.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * php-modules +# * +# * /!\ this is meant to install php extensions in containers only +# * +# * @category dev +# * @link https://github.com/mlocati/docker-php-extension-installer +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'wget -qO install-php-extensions https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions' +wget -qO install-php-extensions https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions + +# install installer globally +echo_info 'sudo mv -fv install-php-extensions /usr/local/bin/install-php-extensions' +sudo mv -fv install-php-extensions /usr/local/bin/install-php-extensions + +# set executable permissions +echo_info 'sudo chmod uga+x /usr/local/bin/install-php-extensions' +sudo chmod uga+x /usr/local/bin/install-php-extensions + +echo_info 'sync' +sync diff --git a/dev/install_php-modules.sh b/dev/install_php-modules.sh new file mode 100755 index 0000000..9c4cbc5 --- /dev/null +++ b/dev/install_php-modules.sh @@ -0,0 +1,163 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * php-modules +# * php extensions +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install PHP modules' + +OPTIONAL=false +VALID_VERSIONS=(7.3 7.4 8.0 8.1 8.2) +DEFAULT_VERSION="$(php --version | grep -o -m1 "[0-9]\.[0-9]" | head -n1)" + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -o (install optional modules) -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :ov:h OPTION; do + case "${OPTION}" in + o) OPTIONAL=true;; + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install php-modules' + echo_label 12 'usage'; echo_primary "$(basename "${0}") -o (install optional modules) -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi +# check valid version +INSTALL=false +for VALID_VERSION in "${VALID_VERSIONS[@]}"; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done + +alert_secondary "TangoMan Install Modules for PHP${VERSION}" + +if [ "${INSTALL}" != true ]; then + echo_error "Cannot install modules for \"php${VERSION}\", invalid version" + exit 1 +fi + +# install essential plugins + symfony +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-apcu\"" +sudo apt-get install --assume-yes "php${VERSION}-apcu" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-curl\"" +sudo apt-get install --assume-yes "php${VERSION}-curl" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-gd\"" +sudo apt-get install --assume-yes "php${VERSION}-gd" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-intl\"" +sudo apt-get install --assume-yes "php${VERSION}-intl" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-mbstring\"" +sudo apt-get install --assume-yes "php${VERSION}-mbstring" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-memcache\"" +sudo apt-get install --assume-yes "php${VERSION}-memcache" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-memcached\"" +sudo apt-get install --assume-yes "php${VERSION}-memcached" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-mysql\"" +sudo apt-get install --assume-yes "php${VERSION}-mysql" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-opcache\"" +sudo apt-get install --assume-yes "php${VERSION}-opcache" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-pgsql\"" +sudo apt-get install --assume-yes "php${VERSION}-pgsql" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-sqlite3\"" +sudo apt-get install --assume-yes "php${VERSION}-sqlite3" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-xdebug\"" +sudo apt-get install --assume-yes "php${VERSION}-xdebug" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-xml\"" +sudo apt-get install --assume-yes "php${VERSION}-xml" + +echo_info "sudo apt-get install --assume-yes \"php${VERSION}-zip\"" +sudo apt-get install --assume-yes "php${VERSION}-zip" + +# optional +if [ "${OPTIONAL}" = true ]; then + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-amqp\"" + sudo apt-get install --assume-yes "php${VERSION}-amqp" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-cgi\"" + sudo apt-get install --assume-yes "php${VERSION}-cgi" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-dev\"" + sudo apt-get install --assume-yes "php${VERSION}-dev" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-exif\"" + sudo apt-get install --assume-yes "php${VERSION}-exif" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-fileinfo\"" + sudo apt-get install --assume-yes "php${VERSION}-fileinfo" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-geoip\"" + sudo apt-get install --assume-yes "php${VERSION}-geoip" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-gmp\"" + sudo apt-get install --assume-yes "php${VERSION}-gmp" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-imagick\"" + sudo apt-get install --assume-yes "php${VERSION}-imagick" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-ldap\"" + sudo apt-get install --assume-yes "php${VERSION}-ldap" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-mcrypt\"" + sudo apt-get install --assume-yes "php${VERSION}-mcrypt" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-mongodb\"" + sudo apt-get install --assume-yes "php${VERSION}-mongodb" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-msgpack\"" + sudo apt-get install --assume-yes "php${VERSION}-msgpack" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-pdo_mysql\"" + sudo apt-get install --assume-yes "php${VERSION}-pdo_mysql" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-pdo_pgsql\"" + sudo apt-get install --assume-yes "php${VERSION}-pdo_pgsql" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-redis\"" + sudo apt-get install --assume-yes "php${VERSION}-redis" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-soap\"" + sudo apt-get install --assume-yes "php${VERSION}-soap" + + echo_info "sudo apt-get install --assume-yes \"php${VERSION}-xsl\"" + sudo apt-get install --assume-yes "php${VERSION}-xsl" +fi + diff --git a/dev/install_php-xdebug.sh b/dev/install_php-xdebug.sh new file mode 100755 index 0000000..9a329e4 --- /dev/null +++ b/dev/install_php-xdebug.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install php-xdebug +# * php debugger +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +#-------------------------------------------------- + +VALID_VERSIONS=(7.3 7.4 8.0 8.1 8.2) +VERSION='' + +#-------------------------------------------------- + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install php-xdebug' + echo_label 12 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +#-------------------------------------------------- + +function is_valid_version() { + local _version + + if [ "${#VALID_VERSIONS[@]}" -eq 0 ]; then + echo_error '"VALID_VERSIONS" array cannot be empty\n' + return 1 + fi + + if [ -z "$1" ]; then + echo false + return 0 + fi + + for _version in "${VALID_VERSIONS[@]}"; do + if [ "$1" = "${_version}" ]; then + echo true + return 0 + fi + done + + echo false +} + +#-------------------------------------------------- + +function get_php_version() { + # grep -o : only matching pattern + # grep -m1 : stop after first match + # head -n1 : print first result + php --version | grep -o -m1 "[0-9]\.[0-9]" | head -n1 +} + +#-------------------------------------------------- + +function install_xdebug() { + if [ -z "$1" ]; then + echo_error 'some mandatory argument is missing\n' + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [version]" + return 1 + fi + + echo_info "sudo apt-get install --assume-yes \"php$1-xdebug\"" + sudo apt-get install --assume-yes "php$1-xdebug" +} + +#-------------------------------------------------- + +if [ -z "${VERSION}" ]; then + VERSION="$(get_php_version)" +fi + +if [ "$(is_valid_version "${VERSION}")" != true ]; then + echo_error "\"$(basename "${0}")\" invalid version \"${VERSION}\"" + exit 1 +fi + +alert_primary "Install PHP-Xdebug v${VERSION}" + +install_xdebug "${VERSION}" + diff --git a/dev/install_php.sh b/dev/install_php.sh new file mode 100755 index 0000000..fbb1666 --- /dev/null +++ b/dev/install_php.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * php +# * php language +# * +# * @category dev +# * @link http://www.ansoncheunghk.info/article/8-essential-checks-securing-php +# * @link https://www.php.net/supported-versions.php +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +#-------------------------------------------------- + +VALID_VERSIONS=(7.3 7.4 8.0 8.1 8.2) +DEFAULT_VERSION=8.2 + +#-------------------------------------------------- + +function is_valid_version() { + local _version + + if [ "${#VALID_VERSIONS[@]}" -eq 0 ]; then + echo_error '"VALID_VERSIONS" array cannot be empty\n' + return 1 + fi + + if [ -z "$1" ]; then + echo false + return 0 + fi + + for _version in "${VALID_VERSIONS[@]}"; do + if [ "$1" = "${_version}" ]; then + echo true + return 0 + fi + done + + echo false +} + +#-------------------------------------------------- + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install php' + echo_label 12 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +#-------------------------------------------------- + +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi + +if [ "$(is_valid_version "${VERSION}")" != true ]; then + echo_error "\"$(basename "${0}")\" invalid version \"${VERSION}\"" + exit 1 +fi + +alert_primary "Install PHP ${VERSION}" + +#-------------------------------------------------- + +echo_info 'sudo add-apt-repository --yes ppa:ondrej/php' +sudo add-apt-repository --yes ppa:ondrej/php + +echo_info 'sudo apt-get update' +sudo apt-get update + +# note: following modules are installed by default (even with --no-install-recommends) +# "phpx.x-pdo" is included in "phpx.x-common" +# libapache2-mod-phpx.x +# php-common +# phpx.x +# phpx.x-calendar +# phpx.x-cli +# phpx.x-ctype +# phpx.x-exif +# phpx.x-ffi +# phpx.x-fileinfo +# phpx.x-ftp +# phpx.x-gettext +# phpx.x-iconv +# phpx.x-json +# phpx.x-opcache +# phpx.x-pdo +# phpx.x-phar +# phpx.x-posix +# phpx.x-readline +# phpx.x-shmop +# phpx.x-sockets +# phpx.x-sysvmsg +# phpx.x-sysvsem +# phpx.x-sysvshm +# phpx.x-tokenizer + +echo_info "sudo apt-get install --assume-yes --no-install-recommends \"php${VERSION}\"" +sudo apt-get install --assume-yes --no-install-recommends "php${VERSION}" + +echo_info "sudo apt-get install --assume-yes --no-install-recommends \"php${VERSION}-fpm\"" +sudo apt-get install --assume-yes --no-install-recommends "php${VERSION}-fpm" + diff --git a/dev/install_pipenv.sh b/dev/install_pipenv.sh new file mode 100755 index 0000000..bb52804 --- /dev/null +++ b/dev/install_pipenv.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * pipenv +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes pipenv' +sudo apt-get install --assume-yes pipenv diff --git a/dev/install_pipx.sh b/dev/install_pipx.sh new file mode 100755 index 0000000..4c02119 --- /dev/null +++ b/dev/install_pipx.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * pipx +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes pipx' +sudo apt-get install --assume-yes pipx diff --git a/dev/install_pyinstaller.sh b/dev/install_pyinstaller.sh new file mode 100755 index 0000000..3f9535c --- /dev/null +++ b/dev/install_pyinstaller.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * pyinstaller +# * compile python code to executable binary +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes pyinstaller' +sudo apt-get install --assume-yes pyinstaller diff --git a/dev/install_python-pip.sh b/dev/install_python-pip.sh new file mode 100755 index 0000000..fab3817 --- /dev/null +++ b/dev/install_python-pip.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * python-pip +# * +# * @deprecated +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes python-pip' +sudo apt-get install --assume-yes python-pip diff --git a/dev/install_python3-pip.sh b/dev/install_python3-pip.sh new file mode 100755 index 0000000..9ecf69e --- /dev/null +++ b/dev/install_python3-pip.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * python3-pip +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install python3-pip' + +echo_info 'sudo apt-get install --assume-yes python3-pip' +sudo apt-get install --assume-yes python3-pip diff --git a/dev/install_python3-tk.sh b/dev/install_python3-tk.sh new file mode 100755 index 0000000..283eb9e --- /dev/null +++ b/dev/install_python3-tk.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * python3-tk +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes python3-tk' +sudo apt-get install --assume-yes python3-tk + +echo_info 'sudo apt-get install --assume-yes python-imaging-tk' +sudo apt-get install --assume-yes python-imaging-tk diff --git a/dev/install_python3.sh b/dev/install_python3.sh new file mode 100755 index 0000000..551303f --- /dev/null +++ b/dev/install_python3.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * python3 +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes python3' +sudo apt-get install --assume-yes python3 diff --git a/dev/install_rector.sh b/dev/install_rector.sh new file mode 100755 index 0000000..4510bf3 --- /dev/null +++ b/dev/install_rector.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * rector +# * +# * @category dev +# * @link https://github.com/rectorphp/rector +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Rector' + +if [ ! -x "$(command -v composer)" ]; then + echo_error "\"$(basename "${0}")\" requires composer" + exit 1 +fi + +# install rector globally +# --prefer-dist: This flag tells Composer to prefer installing the package from a pre-built distribution file (.phar or similar) if available. This can be faster than downloading the source code and compiling it. +# --no-progress: This flag suppresses the progress bar that Composer normally shows during installation. +# --classmap-authoritative: This flag tells Composer to trust the classmap file provided by the package instead of generating its own. This can be helpful if the package has specific requirements for how its classes are loaded. +echo_info "composer global require 'rector/rector' --quiet --prefer-dist --classmap-authoritative" +composer global require 'rector/rector' --quiet --prefer-dist --classmap-authoritative + +echo_info 'composer clear-cache' +composer clear-cache diff --git a/dev/install_ruby.sh b/dev/install_ruby.sh new file mode 100755 index 0000000..b5289e1 --- /dev/null +++ b/dev/install_ruby.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ruby +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=latest + +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install ruby' + echo_label 12 'usage'; echo_primary "${0} -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +# check valid version +for VALID_VERSION in '2.4.9' '2.5.1' '2.5.7' '2.6.5' '2.7.0' 'dev' 'latest'; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done + +if [ "${INSTALL}" != true ]; then + echo_error "Cannot install \"ruby${VERSION}\", invalid version" + + exit 1 +fi + +if [ "${VERSION}" = 'latest' ]; then + echo_info 'sudo apt-get install --assume-yes ruby-full' + sudo apt-get install --assume-yes ruby-full + + exit 0 +fi + +if [ "${VERSION}" = 'dev' ]; then + echo_info 'sudo apt-get install --assume-yes ruby ruby-dev' + sudo apt-get install --assume-yes ruby ruby-dev + + exit 0 +fi + +if [ ! -x "$(command -v rvm)" ]; then + echo_error "\"$(basename "${0}")\" requires rvm, try: 'sudo apt-get install -y rvm'" + exit 1 +fi + +echo_info "rvm install \"ruby-${VERSION}\"" +rvm install "ruby-${VERSION}" + diff --git a/dev/install_rvm.sh b/dev/install_rvm.sh new file mode 100755 index 0000000..26f24ac --- /dev/null +++ b/dev/install_rvm.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * rvm +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +echo_info 'gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB' +gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB + +echo_info 'curl -sSL https://get.rvm.io | bash -s stable' +curl -sSL https://get.rvm.io | bash -s stable + +echo_info 'source ~/.rvm/scripts/rvm' +# shellcheck disable=SC1090 +source ~/.rvm/scripts/rvm diff --git a/dev/install_sass.sh b/dev/install_sass.sh new file mode 100755 index 0000000..557ee7f --- /dev/null +++ b/dev/install_sass.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * sass +# * +# * Sass standalone +# * +# * @category dev +# * @link https://sass-lang.com/install +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v npm)" ] && [ ! -x "$(command -v yarn)" ]; then + echo_error "\"$(basename "${0}")\" requires yarm, try: 'sudo apt-get install -y yarm'" + exit 1 +fi + +if [ -x "$(command -v yarn)" ]; then + echo_info 'sudo yarn global add sass' + sudo yarn global add sass + + echo_info 'yarn global list' + yarn global list + + echo_info 'sass --version' + sass --version + + exit 0 +fi + +if [ -x "$(command -v npm)" ]; then + echo_info 'sudo npm install sass -g' + sudo npm install sass -g + + echo_info 'sass --version' + sass --version + + exit 0 +fi + diff --git a/dev/install_shellcheck.sh b/dev/install_shellcheck.sh new file mode 100755 index 0000000..415ef9c --- /dev/null +++ b/dev/install_shellcheck.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * shellcheck +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install shellcheck' + +echo_info 'sudo apt-get install --assume-yes shellcheck' +sudo apt-get install --assume-yes shellcheck diff --git a/dev/install_symfony-cli.sh b/dev/install_symfony-cli.sh new file mode 100755 index 0000000..3dee788 --- /dev/null +++ b/dev/install_symfony-cli.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * symfony cli +# * +# * @category dev +# * @link https://symfony.com/doc/current/setup.html +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Symfony CLI' + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +# -s, --silent Silent mode +# -S, --show-error Show error even when -s is used +echo_info 'sudo curl -sS https://get.symfony.com/cli/installer | bash' +sudo curl -sS https://get.symfony.com/cli/installer | bash + +# install symfony installer globally +echo_info 'sudo mv -fv ~/.symfony5/bin/symfony /usr/local/bin/symfony' +sudo mv -fv ~/.symfony5/bin/symfony /usr/local/bin/symfony + +echo_info 'sync' +sync + diff --git a/dev/install_symfony-flex.sh b/dev/install_symfony-flex.sh new file mode 100755 index 0000000..5794a4d --- /dev/null +++ b/dev/install_symfony-flex.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * symfony flex +# * +# * @category dev +# * @link https://github.com/symfony/flex +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Symfony Flex' +echo_warning 'Requires user interaction' + +if [ ! -x "$(command -v composer)" ]; then + echo_error "\"$(basename "${0}")\" requires composer" + exit 1 +fi + +# add symfony/flex to composer allow-plugins config +echo_info 'composer global config --no-plugins allow-plugins.symfony/flex true' +composer global config --no-plugins allow-plugins.symfony/flex true + +# install symfony flex globally to speed up download of composer packages (parallelized prefetching) +# --prefer-dist: This flag tells Composer to prefer installing the package from a pre-built distribution file (.phar or similar) if available. This can be faster than downloading the source code and compiling it. +# --no-progress: This flag suppresses the progress bar that Composer normally shows during installation. +# --classmap-authoritative: This flag tells Composer to trust the classmap file provided by the package instead of generating its own. This can be helpful if the package has specific requirements for how its classes are loaded. +echo_info "composer global require 'symfony/flex' --prefer-dist --classmap-authoritative" +composer global require 'symfony/flex' --prefer-dist --classmap-authoritative + +echo_info 'composer clear-cache' +composer clear-cache diff --git a/dev/install_vue-cli.sh b/dev/install_vue-cli.sh new file mode 100755 index 0000000..b1a60b7 --- /dev/null +++ b/dev/install_vue-cli.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * vue-cli +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install vue-cli' + +if [ ! -x "$(command -v npm)" ] && [ ! -x "$(command -v yarn)" ]; then + echo_error "\"$(basename "${0}")\" requires yarm, try: 'sudo apt-get install -y yarm'" + exit 1 +fi + +if [ -x "$(command -v yarn)" ]; then + echo_info 'sudo yarn global add @vue/cli' + sudo yarn global add @vue/cli + + echo_info 'sudo yarn global add @vue/cli-init' + sudo yarn global add @vue/cli-init + + exit 0 +fi + +if [ -x "$(command -v npm)" ]; then + echo_info 'sudo npm install -g @vuecli' + sudo npm install -g @vuecli + + exit 0 +fi + diff --git a/dev/install_yamllint.sh b/dev/install_yamllint.sh new file mode 100755 index 0000000..20ca5da --- /dev/null +++ b/dev/install_yamllint.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install yamlint +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install yamllint' + +echo_info 'sudo apt-get install --assume-yes yamllint' +sudo apt-get install --assume-yes yamllint + diff --git a/dev/install_yarn.sh b/dev/install_yarn.sh new file mode 100755 index 0000000..6b36767 --- /dev/null +++ b/dev/install_yarn.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * yarn +# * fast, reliable, and secure dependency management +# * +# * @category dev +# * @link https://yarnpkg.com/en +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install yarn' + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +echo_info 'curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -' +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - + +echo_info 'echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list' +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes yarn' +sudo apt-get install --assume-yes yarn diff --git a/dev/install_yq.sh b/dev/install_yq.sh new file mode 100755 index 0000000..0a27576 --- /dev/null +++ b/dev/install_yq.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * yq +# * +# * command-line yaml/xml processor - jq wrapper for yaml and xml documents +# * +# * @category dev +# * @link https://yq.readthedocs.io/en/latest +# * @link https://github.com/mikefarah/yq +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v pip3)" ]; then + echo_error "\"$(basename "${0}")\" requires python3-pip, try: 'sudo apt-get install -y python3-pip'" + exit 1 +fi + +# -------------------------------------------------- + +PROJECT=yq +AUTHOR=mikefarah +REPOSITORY=${AUTHOR}/${PROJECT} +BINARY=yq_linux_amd64 +DESTINATION=/usr/bin/${PROJECT} + +# -------------------------------------------------- + +alert_primary "Install ${PROJECT}" + +# -------------------------------------------------- + +URL=https://github.com/${REPOSITORY}/releases/latest/download/${BINARY} + +if [ -x "$(command -v curl)" ]; then + # download latest version from github with curl + echo_info "sudo curl -L \"${URL}\" -o \"${DESTINATION}\"" + sudo curl -L "${URL}" -o "${DESTINATION}" + +elif [ -x "$(command -v wget)" ]; then + # download latest version from github with wget + echo_info "sudo wget -nv \"${URL}\" -O \"${DESTINATION}\"" + sudo wget -nv "${URL}" -O "${DESTINATION}" +fi + +# -------------------------------------------------- + +echo_info 'sudo chmod +x /usr/bin/yq' +sudo chmod +x /usr/bin/yq + diff --git a/dev/remove_composer.sh b/dev/remove_composer.sh new file mode 100755 index 0000000..c928728 --- /dev/null +++ b/dev/remove_composer.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove composer +# * +# * @category dev +# +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo rm -f /usr/local/bin/composer' +sudo rm -f /usr/local/bin/composer + diff --git a/dev/remove_nodejs.sh b/dev/remove_nodejs.sh new file mode 100755 index 0000000..47b773b --- /dev/null +++ b/dev/remove_nodejs.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove nodejs +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# uninstall nodejs +alert_secondary 'uninstall nodejs' + +echo_info 'sudo apt-get purge --assume-yes yarn' +sudo apt-get purge --assume-yes yarn + +echo_info 'sudo apt-get purge --assume-yes npm' +sudo apt-get purge --assume-yes npm + +echo_info 'sudo apt-get purge --assume-yes nodejs' +sudo apt-get purge --assume-yes nodejs + +echo_info 'rm -rf /etc/apt/sources.list.d/nodesource.list' +rm -rf /etc/apt/sources.list.d/nodesource.list + +echo_info 'rm -rf /etc/apt/keyrings/nodesource.gpg' +rm -rf /etc/apt/keyrings/nodesource.gpg + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove diff --git a/dev/remove_php-xdebug.sh b/dev/remove_php-xdebug.sh new file mode 100755 index 0000000..94dfe50 --- /dev/null +++ b/dev/remove_php-xdebug.sh @@ -0,0 +1,165 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove php-xdebug +# * php debug plugin +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +#-------------------------------------------------- + +VALID_VERSIONS=(7.3 7.4 8.0 8.1 8.2) +VERSION='' + +#-------------------------------------------------- + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install php' + echo_label 12 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +#-------------------------------------------------- + +function is_valid_version() { + local _version + + if [ "${#VALID_VERSIONS[@]}" -eq 0 ]; then + echo_error '"VALID_VERSIONS" array cannot be empty\n' + return 1 + fi + + if [ -z "$1" ]; then + echo false + return 0 + fi + + for _version in "${VALID_VERSIONS[@]}"; do + if [ "$1" = "${_version}" ]; then + echo true + return 0 + fi + done + + echo false +} + +#-------------------------------------------------- + +function get_php_version() { + # grep -o : only matching pattern + # grep -m1 : stop after first match + # head -n1 : print first result + php --version | grep -o -m1 "[0-9]\.[0-9]" | head -n1 +} + +#-------------------------------------------------- + +function uninstall_xdebug() { + if [ -z "$1" ]; then + echo_error 'some mandatory argument is missing\n' + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [version]" + return 1 + fi + + echo_info "sudo apt-get purge --assume-yes \"php$1-xdebug\"" + sudo apt-get purge --assume-yes "php$1-xdebug" + + echo_info 'sudo pecl uninstall xdebug' + sudo pecl uninstall xdebug + + echo_info 'sudo apt-get --assume-yes autoremove' + sudo apt-get --assume-yes autoremove +} + +#-------------------------------------------------- + +function get_php_ini_path() { + php -i 2>/dev/null | grep -E "Loaded Configuration File => .+php.ini" | sed 's/Loaded Configuration File => //' +} + +#-------------------------------------------------- + +function remove_xdebug_config() { + if [ ! -f "$1" ]; then + echo_error "\"$1\" file does not exist" + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [file_path]" + + return 1 + fi + + echo_info "sudo sed -i -E '/^\[xdebug\]$/d' \"$1\"" + sudo sed -i -E '/^\[xdebug\]$/d' "$1" + + echo_info "sudo sed -i -E '/zend_extension\s?=.*xdebug/d' \"$1\"" + sudo sed -i -E '/zend_extension\s?=.*xdebug/d' "$1" + + echo_info "sudo sed -i -E '/xdebug.+=.+/d' \"$1\"" + sudo sed -i -E '/xdebug.+=.+/d' "$1" +} + +#-------------------------------------------------- + +function delete_xdebug_ini() { + echo_info "sudo find /etc/php/ -type f -name 'xdebug.ini' -delete" + sudo find /etc/php/ -type f -name 'xdebug.ini' -delete +} + +#-------------------------------------------------- + +function restart_php_service() { + if [ -z "$1" ]; then + echo_error 'some mandatory argument is missing\n' + echo_label 3 'usage'; echo_primary "${FUNCNAME[0]} [version]" + return 1 + fi + + echo_info "sudo systemctl restart \"php$1-fpm\"" + sudo systemctl restart "php$1-fpm" +} + +#-------------------------------------------------- + +if [ -z "${VERSION}" ]; then + VERSION="$(get_php_version)" +fi + +if [ "$(is_valid_version "${VERSION}")" != true ]; then + echo_error "\"$(basename "${0}")\" invalid version \"${VERSION}\"" + exit 1 +fi + +alert_primary "Remove PHP-Xdebug v${VERSION}" + +uninstall_xdebug "${VERSION}" +remove_xdebug_config "$(get_php_ini_path)" +delete_xdebug_ini +restart_php_service "${VERSION}" + diff --git a/dev/remove_php.sh b/dev/remove_php.sh new file mode 100755 index 0000000..5343752 --- /dev/null +++ b/dev/remove_php.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove php +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes php-common' +sudo apt-get purge --assume-yes php-common + +echo_info 'sudo rm -rf /etc/php' +sudo rm -rf /etc/php + +echo_info 'sudo rm -rf /var/lib/php' +sudo rm -rf /var/lib/php + +echo_info 'sudo rm -rf /usr/lib/php' +sudo rm -rf /usr/lib/php + +echo_info 'sudo apt-get purge --assume-yes blackfire-php' +sudo apt-get purge --assume-yes blackfire-php + +echo_info 'sudo apt-get purge --assume-yes blackfire-agent' +sudo apt-get purge --assume-yes blackfire-agent + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/dev/remove_rvm.sh b/dev/remove_rvm.sh new file mode 100755 index 0000000..a5fa953 --- /dev/null +++ b/dev/remove_rvm.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove rvm +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# uninstall rvm +alert_secondary 'uninstall rvm' + +# This will remove the rvm/ directory and all the rubies built within it. +echo_info 'rvm implode' +rvm implode + +# In order to remove the final trace of rvm, you need to remove the rvm gem, too: +echo_info 'gem uninstall rvm' +gem uninstall rvm + +echo_info 'rm -rf /etc/rvmrc' +rm -rf /etc/rvmrc + +echo_info 'rm -rf ~/.rvmrc' +rm -rf ~/.rvmrc + diff --git a/dev/repair_yarn.sh b/dev/repair_yarn.sh new file mode 100755 index 0000000..ef7a6ed --- /dev/null +++ b/dev/repair_yarn.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * repair yarn +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get remove --assume-yes cmdtest' +sudo apt-get remove --assume-yes cmdtest + +echo_info 'sudo apt-get remove --assume-yes yarn' +sudo apt-get remove --assume-yes yarn + +echo_info 'curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -' +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - + +echo_info 'echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list' +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list + +echo_info 'sudo apt-get update ' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes yarn' +sudo apt-get install --assume-yes yarn diff --git a/dev/update_nodejs.sh b/dev/update_nodejs.sh new file mode 100755 index 0000000..047d827 --- /dev/null +++ b/dev/update_nodejs.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * update nodejs +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v npm)" ]; then + echo_error "\"$(basename "${0}")\" requires npm, try: 'sudo apt-get install -y npm'" + exit 1 +fi + +alert_secondary 'Update Node' + +echo_info 'sudo npm install -g n' +sudo npm install -g n + +echo_info 'sudo n latest' +sudo n latest + diff --git a/dev/update_python3-pip.sh b/dev/update_python3-pip.sh new file mode 100755 index 0000000..5a6695c --- /dev/null +++ b/dev/update_python3-pip.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * update python3-pip +# * +# * @category dev +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'python3 -m pip list --outdated --format=freeze | grep -v '^-e' | cut -d= -f1 | xargs -n1 python3 -m pip install -U' +python3 -m pip list --outdated --format=freeze | grep -v '^-e' | cut -d= -f1 | xargs -n1 python3 -m pip install -U diff --git a/dev/xdebug/index.php b/dev/xdebug/index.php new file mode 100644 index 0000000..6e825a3 --- /dev/null +++ b/dev/xdebug/index.php @@ -0,0 +1,311 @@ + + + + + + + + + + + + + Xdebug + + + + + + +
+ +
+ +
+
+
+

TangoMan Xdebug Configuration Helper

+
+
+

+ PHP logo + Xdebug logo +

+

+ Check your PHP configuration is correct with : +  php-info +

+

+ Enable xdebug in php.ini following official documentation here : +  xdebug documentation +

+

+ Check Xdebug is correcty configured here : +  xdebug-info +

+

+ Chrome Xdebug Extension is installable from here : +  Xdebug helper +

+

+ Enable xdebug in PHPStorm following official JetBrains documentation here : +  jetbrains.com +

+ +
+ +
+ +
+
+

php_ini_loaded_file()

+
+
+

+
+ +
+ +
+
+

php_ini_scanned_files()

+
+
+

+
+ +
+ +
+
+

PHPStorm Xdebug Configuration

+
+ + +
+ +
+ + + + + \ No newline at end of file diff --git a/dev/xdebug/php-info.php b/dev/xdebug/php-info.php new file mode 100644 index 0000000..f35a8ef --- /dev/null +++ b/dev/xdebug/php-info.php @@ -0,0 +1,3 @@ + +# */ + +# colors v6.0.0-min +echo_primary() { printf '\033[97m%b\033[0m' "${*}"; } +echo_secondary() { printf '\033[36m%b\033[0m' "${*}"; } +echo_success() { printf '\033[32m%b\033[0m' "${*}"; } +echo_danger() { printf '\033[31m%b\033[0m' "${*}"; } +echo_warning() { printf '\033[33m%b\033[0m' "${*}"; } +echo_info() { printf '\033[95m%b\033[0m' "${*}"; } +echo_light() { printf '\033[47;90m%b\033[0m' "${*}"; } +echo_dark() { printf '\033[40;37m%b\033[0m' "${*}"; } + +echo_label() { printf '\033[32m%-*b \033[0m' "$1" "$2"; } +echo_error() { printf '\033[1;31merror:\t\033[0;91m%s\033[0m' "${*}"; } + +alert_primary() { printf "\033[0m\n\033[1;104;97m%64s\033[0m\n\033[1;104;97m %-63s\033[0m\n\033[1;104;97m%64s\033[0m\n\n" '' "${*}" ''; } +alert_secondary() { printf "\033[0m\n\033[1;45;97m%64s\033[0m\n\033[1;45;97m %-63s\033[0m\n\033[1;45;97m%64s\033[0m\n\n" '' "${*}" ''; } +alert_success() { printf "\033[0m\n\033[1;42;37m%64s\033[0m\n\033[1;42;37m %-63s\033[0m\n\033[1;42;37m%64s\033[0m\n\n" '' "${*}" ''; } +alert_danger() { printf "\033[0m\n\033[1;41;37m%64s\033[0m\n\033[1;41;37m %-63s\033[0m\n\033[1;41;37m%64s\033[0m\n\n" '' "${*}" ''; } +alert_warning() { printf "\033[0m\n\033[1;43;97m%64s\033[0m\n\033[1;43;97m %-63s\033[0m\n\033[1;43;97m%64s\033[0m\n\n" '' "${*}" ''; } +alert_info() { printf "\033[0m\n\033[1;44;97m%64s\033[0m\n\033[1;44;97m %-63s\033[0m\n\033[1;44;97m%64s\033[0m\n\n" '' "${*}" ''; } +alert_light() { printf "\033[0m\n\033[1;47;90m%64s\033[0m\n\033[1;47;90m %-63s\033[0m\n\033[1;47;90m%64s\033[0m\n\n" '' "${*}" ''; } +alert_dark() { printf "\033[0m\n\033[1;40;37m%64s\033[0m\n\033[1;40;37m %-63s\033[0m\n\033[1;40;37m%64s\033[0m\n\n" '' "${*}" ''; } + +clear +alert_primary 'TangoMan PHP Serve' + +DOCROOT=. +IP=127.0.0.1 +PORT=8888 + +if [ ! -x "$(command -v php)" ]; then + echo_error "\"$(basename "${0}")\" requires php, try: 'sudo apt-get install -y php'\n" + exit 1 +fi + +nohup xdg-open http://${IP}:${PORT} >/dev/null 2>&1 + +# run php server command +echo_info "php -d memory-limit=-1 -S ${IP}:${PORT} -t \"${DOCROOT}\"\n" +php -d memory-limit=-1 -S ${IP}:${PORT} -t "${DOCROOT}" diff --git a/dev/xdebug/xdebug-info.php b/dev/xdebug/xdebug-info.php new file mode 100644 index 0000000..ec60b32 --- /dev/null +++ b/dev/xdebug/xdebug-info.php @@ -0,0 +1,3 @@ +Xdebug \ No newline at end of file diff --git a/devops/install_ansible-alt.sh b/devops/install_ansible-alt.sh new file mode 100755 index 0000000..bb48c85 --- /dev/null +++ b/devops/install_ansible-alt.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ansible-alt +# * +# * @note alternative install method with pip/virtual env +# * @link https://docs.ansible.com +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v pip3)" ]; then + echo_error "\"$(basename "${0}")\" requires pip3, try: 'sudo apt-get install -y pip3'" + exit 1 +fi + +echo_info 'adduser user-ansible' +adduser user-ansible + +echo_info 'sudo apt-get install --assume-yes python-virtualenv' +sudo apt-get install --assume-yes python-virtualenv + +echo_info 'sudo apt-get install --assume-yes sshpass' +sudo apt-get install --assume-yes sshpass + +echo_info 'su - user-ansible' +su - user-ansible + +# create virtual env +echo_info 'virtualenv ansible2.7.10' +virtualenv ansible2.7.10 + +# enable virtual env +echo_info 'source ansible2.7.10/bin/activate' +# shellcheck source=/dev/null +source ansible2.7.10/bin/activate + +# install ansible in virtualenv with pip +echo_info 'pip3 install ansible==2.7.10' +pip3 install ansible==2.7.10 + +echo_info 'ansible --version' +ansible --version + diff --git a/devops/install_ansible.sh b/devops/install_ansible.sh new file mode 100755 index 0000000..2a53bde --- /dev/null +++ b/devops/install_ansible.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ansible +# * +# * @category devops +# * @link https://docs.ansible.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes software-properties-common' +sudo apt-get install --assume-yes software-properties-common + +echo_info 'sudo add-apt-repository --yes ppa:ansible/ansible' +sudo add-apt-repository --yes ppa:ansible/ansible + +echo_info 'sudo apt-get install --assume-yes ansible' +sudo apt-get install --assume-yes ansible diff --git a/devops/install_chef-solo.sh b/devops/install_chef-solo.sh new file mode 100755 index 0000000..421509c --- /dev/null +++ b/devops/install_chef-solo.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * chef-solo +# * architecture as a code (obsolete version) +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -e /opt/chef/bin/chef-solo ] ; then + #echo_info 'curl -L https://www.opscode.com/chef/install.sh | bash' + #curl -L https://www.opscode.com/chef/install.sh | bash + + echo_info 'wget https://www.opscode.com/chef/install.sh' + wget https://www.opscode.com/chef/install.sh + + echo_info 'sudo bash install.sh' + sudo bash install.sh + + echo_info 'rm install.sh' + rm install.sh +else + echo_warning 'chef-solo already installed' +fi + +if [ ! -e /opt/chef/embedded/bin/berks ] ; then + echo_info 'sudo /opt/chef/embedded/bin/gem install berkshelf --no-ri --no-rdoc' + sudo /opt/chef/embedded/bin/gem install berkshelf --no-ri --no-rdoc + + echo_info 'sudo ln -s /opt/chef/embedded/bin/berks /usr/local/bin/berks' + sudo ln -s /opt/chef/embedded/bin/berks /usr/local/bin/berks +else + echo_warning 'berks already installed' +fi diff --git a/devops/install_chefdk.sh b/devops/install_chefdk.sh new file mode 100755 index 0000000..f6e0f89 --- /dev/null +++ b/devops/install_chefdk.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * chefdk +# * architecture as a code development kit +# * +# * @category devops +# * @link https://downloads.chef.io/chefdk +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=3.8.14 + +UBUNTU='' +DARWIN='' + +RELEASE="$(lsb_release -cs 2>/dev/null)" +for CODENAME in precise trusty xenial bionic cosmic disco eoan focal +do + if [ "${RELEASE}" = "${CODENAME}" ]; then + UBUNTU="$(lsb_release -ds)" + fi +done + +if [ -z "${UBUNTU}" ]; then + if sw_vers -productVersion 2>/dev/null | grep -q '10.12'; then + DARWIN='10.12' + + elif sw_vers -productVersion 2>/dev/null | grep -q '10.13'; then + DARWIN='10.13' + + elif sw_vers -productVersion 2>/dev/null | grep -q '10.14'; then + DARWIN='10.14' + + else + echo_error 'unsupported system, try installing manually: https://downloads.chef.io/chefdk' + exit 1 + fi +fi + +if [ -n "${UBUNTU}" ]; then + + if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 + fi + + echo_info "wget \"https://packages.chef.io/files/stable/chefdk/${VERSION}/ubuntu/${UBUNTU}/chefdk_${VERSION}-1_amd64.deb\"" + wget "https://packages.chef.io/files/stable/chefdk/${VERSION}/ubuntu/${UBUNTU}/chefdk_${VERSION}-1_amd64.deb" + + echo_info "sudo dpkg -i \"chefdk_${VERSION}-1_amd64.deb\"" + sudo dpkg -i "chefdk_${VERSION}-1_amd64.deb" + + echo_info "rm \"chefdk_${VERSION}-1_amd64.deb\"" + rm "chefdk_${VERSION}-1_amd64.deb" +fi + +if [ -n "${DARWIN}" ]; then + + if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 + fi + + echo_info "curl \"https://packages.chef.io/files/stable/chefdk/${VERSION}/mac_os_x/${DARWIN}/chefdk-${VERSION}-1.dmg\" --output \"chefdk-${VERSION}-1.dmg\"" + curl "https://packages.chef.io/files/stable/chefdk/${VERSION}/mac_os_x/${DARWIN}/chefdk-${VERSION}-1.dmg" --output "chefdk-${VERSION}-1.dmg" + + echo_info "sudo dpkg -i \"chefdk_${VERSION}-1.dmg\"" + sudo dpkg -i "chefdk_${VERSION}-1.dmg" + + echo_info "rm \"chefdk_${VERSION}-1.dmg\"" + rm "chefdk_${VERSION}-1.dmg" +fi diff --git a/devops/install_docker-community.sh b/devops/install_docker-community.sh new file mode 100755 index 0000000..48548c9 --- /dev/null +++ b/devops/install_docker-community.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install the latest version of docker engine - community and containerd +# * container environments +# * +# * @category devops +# * @note NOT RECOMMENDED: install docker.io instead +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +if [ ! -x "$(command -v gpg)" ]; then + echo_error "\"$(basename "${0}")\" requires gnupg, try: 'sudo apt-get install -y gnupg'" + exit 1 +fi + +if [ ! -x "$(command -v lsb_release)" ]; then + echo_error "\"$(basename "${0}")\" requires lsb-release, try: 'sudo apt-get install -y lsb-release'" + exit 1 +fi + +echo_info 'sudo apt-get install --assume-yes ca-certificates' +sudo apt-get install --assume-yes ca-certificates + +# add docker's official gpg key +echo_info 'sudo mkdir -p /etc/apt/keyrings' +sudo mkdir -p /etc/apt/keyrings + +echo_info 'curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg' +curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg + +# set up stable repository +echo_info "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null" +echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + +# update the apt package index +echo_info 'sudo apt-get update' +sudo apt-get update + +# install the latest version of docker engine - community and containerd +echo_info 'sudo apt-get install --assume-yes docker-ce' +sudo apt-get install --assume-yes docker-ce + +echo_info 'sudo apt-get install --assume-yes docker-ce-cli' +sudo apt-get install --assume-yes docker-ce-cli + +echo_info 'sudo apt-get install --assume-yes containerd.io' +sudo apt-get install --assume-yes containerd.io + +echo_info 'sudo apt-get install --assume-yes docker-compose-plugin' +sudo apt-get install --assume-yes docker-compose-plugin + +# add current user to docker group +echo_info "sudo usermod -a -G docker \"${USER}\"" +sudo usermod -a -G docker "${USER}" + +echo_warning 'You will need to log out and log back in current user to use docker' diff --git a/devops/install_docker-compose.sh b/devops/install_docker-compose.sh new file mode 100755 index 0000000..d86b1da --- /dev/null +++ b/devops/install_docker-compose.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * docker-compose +# * +# * @link https://github.com/docker/compose +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +REPOSITORY=docker/compose + +VERSION=$(get_latest_release ${REPOSITORY}) +if [ -z "${VERSION}" ]; then + VERSION=2.27.1 +fi + +alert_primary "Install docker-compose v${VERSION}" + +# download latest version from github +echo_info "sudo curl -L \"https://github.com/docker/compose/releases/download/v${VERSION}/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/bin/docker-compose" +sudo curl -L "https://github.com/docker/compose/releases/download/v${VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose + +# set executable permissions +echo_info 'sudo chmod uga+x /usr/bin/docker-compose' +sudo chmod uga+x /usr/bin/docker-compose + +# create `cli-plugins` folder in `~/.docker` directory +echo_info 'mkdir -p ~/.docker/cli-plugins/' +mkdir -p ~/.docker/cli-plugins/ + +# create binary symlink into `~/.docker/cli-plugins` +echo_info 'ln -s /usr/bin/docker-compose ~/.docker/cli-plugins/docker-compose' +ln -s /usr/bin/docker-compose ~/.docker/cli-plugins/docker-compose + +# update system +echo_info 'sync' +sync + +# check command is properly installed +echo_info 'docker compose version' +docker compose version + diff --git a/devops/install_docker.io.sh b/devops/install_docker.io.sh new file mode 100755 index 0000000..20d8fc8 --- /dev/null +++ b/devops/install_docker.io.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install docker.io +# * container environments +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install docker.io' + +echo_info 'sudo apt-get install --assume-yes docker.io' +sudo apt-get install --assume-yes docker.io + +# add current user to docker group +echo_info "sudo usermod -a -G docker \"${USER}\"" +sudo usermod -a -G docker "${USER}" + +echo_warning 'You will need to log out and log back in current user to use docker' diff --git a/devops/install_docker_kali.sh b/devops/install_docker_kali.sh new file mode 100755 index 0000000..9951c88 --- /dev/null +++ b/devops/install_docker_kali.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install the latest version of docker engine - community and containerd +# * container environments +# * +# * @category devops +# * @note this is the recommended version for debian / kali +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +# add docker's official gpg key +echo_info 'curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -' +curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - + +# set up stable repository +echo_info "sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/debian buster stable\"" +sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" + +# echo 'deb [arch=amd64] https://download.docker.com/linux/debian buster stable' | sudo tee /etc/apt/sources.list.d/docker.list + +# update the apt package index +echo_info 'sudo apt-get update' +sudo apt-get update + +# install the latest version of docker engine - community and containerd +echo_info 'sudo apt-get install --assume-yes docker-ce' +sudo apt-get install --assume-yes docker-ce + +# add current user to docker group +echo_info "sudo usermod -a -G docker \"${USER}\"" +sudo usermod -a -G docker "${USER}" + +echo_warning 'You will need to log out and log back in current user to use docker' diff --git a/devops/install_google-cloud-sdk.sh b/devops/install_google-cloud-sdk.sh new file mode 100755 index 0000000..b53a4ed --- /dev/null +++ b/devops/install_google-cloud-sdk.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install google-cloud-sdk +# * +# * @category devops +# * @link https://docs.gcloud.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install google-cloud-sdk' + +if [ ! -f /etc/apt/sources.list.d/google-cloud-sdk.list ]; then + # Install repository + echo_info 'echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list' + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list +fi + +if [ ! -f /usr/share/keyrings/cloud.google.gpg ]; then + # Install key + echo_info 'curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -' + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - +fi + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes apt-transport-https' +sudo apt-get install --assume-yes apt-transport-https + +echo_info 'sudo apt-get install --assume-yes ca-certificates gnupg' +sudo apt-get install --assume-yes ca-certificates gnupg + +echo_info 'sudo apt-get install --assume-yes google-cloud-sdk' +sudo apt-get install --assume-yes google-cloud-sdk + +#-------------------------------------------------- +# optional +#-------------------------------------------------- + +echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-gke-gcloud-auth-plugin' +sudo apt-get install --assume-yes google-cloud-sdk-gke-gcloud-auth-plugin + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-app-engine-python' +# sudo apt-get install --assume-yes google-cloud-sdk-app-engine-python + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-app-engine-python-extras' +# sudo apt-get install --assume-yes google-cloud-sdk-app-engine-python-extras + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-app-engine-java' +# sudo apt-get install --assume-yes google-cloud-sdk-app-engine-java + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-app-engine-go' +# sudo apt-get install --assume-yes google-cloud-sdk-app-engine-go + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-bigtable-emulator' +# sudo apt-get install --assume-yes google-cloud-sdk-bigtable-emulator + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-cbt' +# sudo apt-get install --assume-yes google-cloud-sdk-cbt + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-cloud-build-local' +# sudo apt-get install --assume-yes google-cloud-sdk-cloud-build-local + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-datalab' +# sudo apt-get install --assume-yes google-cloud-sdk-datalab + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-datastore-emulator' +# sudo apt-get install --assume-yes google-cloud-sdk-datastore-emulator + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-firestore-emulator' +# sudo apt-get install --assume-yes google-cloud-sdk-firestore-emulator + +# echo_info 'sudo apt-get install --assume-yes google-cloud-sdk-pubsub-emulator' +# sudo apt-get install --assume-yes google-cloud-sdk-pubsub-emulator + +# echo_info 'sudo apt-get install --assume-yes kubectl' +# sudo apt-get install --assume-yes kubectl diff --git a/devops/install_k9s.sh b/devops/install_k9s.sh new file mode 100755 index 0000000..9dad5c0 --- /dev/null +++ b/devops/install_k9s.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * k9s +# * +# * @category devops +# * @link https://github.com/derailed/k9s +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +alert_primary 'Install k9s' + +echo_info 'curl -sS https://webinstall.dev/k9s | sh' +curl -sS https://webinstall.dev/k9s | sh + +# create symlink into `/usr/bin/`` +echo_info 'sudo ln -s ~/.local/bin/k9s /usr/bin/k9s' +sudo ln -s ~/.local/bin/k9s /usr/bin/k9s + +echo_info 'sync' +sync diff --git a/devops/install_kubectl.sh b/devops/install_kubectl.sh new file mode 100755 index 0000000..eb53905 --- /dev/null +++ b/devops/install_kubectl.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * kubectl +# * +# * /!\ IMPORTANT ! Install k9s first +# * +# * @category devops +# * @link https://cloud.google.com/sdk/docs/install +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +if [ ! -x "$(command -v curl)" ]; then + echo_error "\"$(basename "${0}")\" requires curl, try: 'sudo apt-get install -y curl'" + exit 1 +fi + +alert_primary 'Install Kubectl' + +echo_info 'sudo apt-get install --assume-yes apt-transport-https' +sudo apt-get install --assume-yes apt-transport-https + +echo_info 'sudo apt-get install --assume-yes ca-certificates gnupg' +sudo apt-get install --assume-yes ca-certificates gnupg + +if [ ! -f /etc/apt/sources.list.d/google-cloud-sdk.list ]; then + # Install repository + echo_info 'echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list' + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list + + echo_info 'sudo apt-get update' + sudo apt-get update +fi + +if [ ! -f /usr/share/keyrings/cloud.google.gpg ]; then + # Install key + echo_info 'curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -' + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - +fi + +echo_info 'sudo apt-get install --assume-yes kubectl' +sudo apt-get install --assume-yes kubectl + diff --git a/devops/install_lazydocker.sh b/devops/install_lazydocker.sh new file mode 100755 index 0000000..5fc0e04 --- /dev/null +++ b/devops/install_lazydocker.sh @@ -0,0 +1,133 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * lazydocker +# * +# * @link https://github.com/jesseduffield/lazydocker +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v tar)" ]; then + echo_error "\"$(basename "${0}")\" requires tar, try: 'sudo apt-get install -y tar'" + exit 1 +fi + +if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'" + exit 1 +fi + +# -------------------------------------------------- + +PROJECT=lazydocker +AUTHOR=jesseduffield +REPOSITORY=${AUTHOR}/${PROJECT} +# MAIN_BRANCH=main +BINARY="${PROJECT}" + +# -------------------------------------------------- + +DEFAULT_VERSION=0.23.3 +# VERSION="${DEFAULT_VERSION}" +VERSION=$(get_latest_release ${REPOSITORY}) +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi + +# -------------------------------------------------- + +# REMOTE_FILE="${MAIN_BRANCH}.tar.gz" +# REMOTE_FILE="${MAIN_BRANCH}.zip" +REMOTE_FILE="${PROJECT}_${VERSION}_$(uname -s)_$(uname -m).tar.gz" +# REMOTE_FILE="${VERSION}.tar.gz" +# REMOTE_FILE="${VERSION}.zip" +ARCHIVE="$(mktemp -d)/${REMOTE_FILE}" +DESTINATION=/usr/bin + +# -------------------------------------------------- + +# # Download source +# URL=https://github.com/${REPOSITORY}/archive/refs/heads/${REMOTE_FILE} +# URL=https://github.com/${REPOSITORY}/archive/refs/tags/${REMOTE_FILE} + +# Download release +URL="https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${REMOTE_FILE}" + +# -------------------------------------------------- + +alert_primary "Install ${PROJECT} v${VERSION}" + +# -------------------------------------------------- + +if [ -x "$(command -v curl)" ]; then + # download latest version from github with curl + echo_info "curl -L \"${URL}\" -o \"${ARCHIVE}\"" + curl -L "${URL}" -o "${ARCHIVE}" + +elif [ -x "$(command -v wget)" ]; then + # download latest version from github with wget + echo_info "wget -nv \"${URL}\" -O \"${ARCHIVE}\"" + wget -nv "${URL}" -O "${ARCHIVE}" +fi + +# -------------------------------------------------- + +# create destination folder +if [ ! -d "${DESTINATION}" ]; then + echo_info "mkdir \"${DESTINATION}\"" + mkdir "${DESTINATION}" +fi + +# -------------------------------------------------- + +# ${ARCHIVE##*.} : This is a parameter expansion expression +# ${ARCHIVE##*.} : This is a parameter expansion expression +# ## : Removes the shortest pattern that matches the entire string from the end of the value +# * : Matches zero or more characters +# . : Matches a literal dot (.) +if [ "${ARCHIVE##*.}" = 'gz' ]; then + # extract binary from archive to destination + echo_info "sudo tar -C ${DESTINATION} -xvzf \"${ARCHIVE}\" \"${BINARY}\"" + sudo tar -C ${DESTINATION} -xvzf "${ARCHIVE}" "${BINARY}" + +elif [ "${ARCHIVE##*.}" = 'zip' ]; then + # extract binary from archive to ${DESTINATION} + echo_info "unzip \"${ARCHIVE}\" -d \"${TEMP}\"" + unzip "${ARCHIVE}" -d "${TEMP}" + + EXTRACTION_FOLDER="${TEMP}/${PROJECT}-${MAIN_BRANCH}" + + echo_info "sudo cp -f \"${EXTRACTION_FOLDER}/${BINARY}\" \"${DESTINATION}\"" + sudo cp -f "${EXTRACTION_FOLDER}/${BINARY}" "${DESTINATION}" +fi + +# -------------------------------------------------- + +# set executable permissions +echo_info "sudo chmod uga+x \"${DESTINATION}/${BINARY}\"" +sudo chmod uga+x "${DESTINATION}/${BINARY}" + +# update system +echo_info 'sync' +sync + diff --git a/devops/install_lxd-client.sh b/devops/install_lxd-client.sh new file mode 100755 index 0000000..d0c3623 --- /dev/null +++ b/devops/install_lxd-client.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * lxd-client +# * manage LXC (linux container) +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes lxd lxd-client' +sudo apt-get install --assume-yes lxd lxd-client diff --git a/devops/install_packer.sh b/devops/install_packer.sh new file mode 100755 index 0000000..34362d5 --- /dev/null +++ b/devops/install_packer.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * packer +# * +# * Create identical machine images for multiple platforms from a single source configuration. +# * +# * @category devops +# * @link https://www.packer.io/downloads +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -' +curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - + +echo_info "sudo apt-add-repository \"deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main\"" +sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" + +echo_info 'sudo apt-get install --asssume-yes packer' +sudo apt-get install --asssume-yes packer diff --git a/devops/install_stakkr.sh b/devops/install_stakkr.sh new file mode 100755 index 0000000..f746e4c --- /dev/null +++ b/devops/install_stakkr.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * stakkr +# * +# * @category devops +# * @link https://stakkr.readthedocs.io +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes python3-pip' +sudo apt-get install --assume-yes python3-pip + +echo_info 'sudo apt-get install --assume-yes python3-setuptools' +sudo apt-get install --assume-yes python3-setuptools + +echo_info 'sudo apt-get install --assume-yes python3-virtualenv' +sudo apt-get install --assume-yes python3-virtualenv + +echo_info 'sudo apt-get install --assume-yes python3-wheel' +sudo apt-get install --assume-yes python3-wheel + +echo_info 'sudo python3 -m pip --no-cache-dir install stakkr' +sudo python3 -m pip --no-cache-dir install stakkr diff --git a/devops/install_systemd-container.sh b/devops/install_systemd-container.sh new file mode 100755 index 0000000..52698ee --- /dev/null +++ b/devops/install_systemd-container.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * systemd-container +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes libpam-systemd systemd-container' +sudo apt-get install --assume-yes libpam-systemd systemd-container diff --git a/devops/install_vagrant.sh b/devops/install_vagrant.sh new file mode 100755 index 0000000..73c9d1d --- /dev/null +++ b/devops/install_vagrant.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Install Vagrant +# * +# * Vagrant 2.1.2 is compatible with VirtualBox versions 4.0, 4.1, 4.2, 4.3, 5.0, 5.1 and 5.2 +# * Vagrant 2.2.6 is compatible with above VirtualBox versions and version 6.0 +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +VERSION=2.2.10 + +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install vagrant' + echo_label 12 'usage'; echo_primary "${0} -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +# check valid version +for VALID_VERSION in 2.1.2 2.2.6 2.2.10; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done + +if [ "${INSTALL}" != true ]; then + echo_error "Cannot install \"vagrant${VERSION}\", invalid version" + exit 1 +fi + +if [ ! -x "$(command -v vagrant)" ]; then + echo_info "wget \"https://releases.hashicorp.com/vagrant/${VERSION}/vagrant_${VERSION}_x86_64.deb\"" + wget "https://releases.hashicorp.com/vagrant/${VERSION}/vagrant_${VERSION}_x86_64.deb" + + echo_info "sudo dpkg -i \"vagrant_${VERSION}_x86_64.deb\"" + sudo dpkg -i "vagrant_${VERSION}_x86_64.deb" + + echo_info "rm \"vagrant_${VERSION}_x86_64.deb\"" + rm "vagrant_${VERSION}_x86_64.deb" +else + echo_warning 'vagrant already installed' +fi diff --git a/devops/install_vagrant_plugins.sh b/devops/install_vagrant_plugins.sh new file mode 100755 index 0000000..1a8b018 --- /dev/null +++ b/devops/install_vagrant_plugins.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Install Vagrant plugins +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Vagrant Plugins' + +# install vagrant-disksize +echo_info 'vagrant plugin install vagrant-disksize' +vagrant plugin install vagrant-disksize + +# install virtualbox guest additions +# https://www.vagrantup.com/docs/virtualbox/boxes.html +echo_info 'vagrant plugin install vagrant-vbguest' +vagrant plugin install vagrant-vbguest + +# install docker-compose plugin +echo_info 'vagrant plugin install vagrant-docker-compose' +vagrant plugin install vagrant-docker-compose + +#echo_info 'vagrant plugin install vagrant-berkshelf' +#vagrant plugin install vagrant-berkshelf + +# # does not work for some reason +# echo_info 'vagrant plugin install vagrant-hostmanager' +# vagrant plugin install vagrant-hostmanager diff --git a/devops/install_virtualbox.sh b/devops/install_virtualbox.sh new file mode 100755 index 0000000..0ded106 --- /dev/null +++ b/devops/install_virtualbox.sh @@ -0,0 +1,108 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * VirtualBox +# * virtual machine +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VALID_VERSIONS=(5.2 6.0 6.1 'latest') +VERSION=latest + +if [ "$#" -gt 1 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install php' + echo_label 12 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +for VALID_VERSION in "${VALID_VERSIONS[@]}"; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done +if [ "${INSTALL}" != true ]; then + echo_error "\"$(basename "${0}")\" invalid version \"${VERSION}\"" + exit 1 +fi + +alert_primary "Install VirtualBox ${VERSION}" + +echo_info "sudo add-apt-repository \"deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib\"" +sudo add-apt-repository "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" + +# key for older distributions. +echo_info 'wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -' +wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - + +# add key for Debian 8 ("Jessie") / Ubuntu 16.04 ("Xenial") and later +echo_info 'wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -' +wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - + +echo_info 'sudo apt-get -y update' +sudo apt-get -y update + +if [ "${VERSION}" = '6.1' ] || [ "${VERSION}" = 'latest' ]; then + echo_info "sudo apt-get install --assume-yes virtualbox" + sudo apt-get install --assume-yes virtualbox +fi + +if [ "${VERSION}" = '5.2' ] || [ "${VERSION}" = '6.0' ]; then + echo_info "sudo apt-get install --assume-yes \"virtualbox-${VERSION}\"" + sudo apt-get install --assume-yes "virtualbox-${VERSION}" + + # if kernel error + echo_info 'sudo /sbin/vboxconfig' + sudo /sbin/vboxconfig + + echo_info "sudo apt-get install --assume-yes \"linux-headers-$(uname -r)\"" + sudo apt-get install --assume-yes "linux-headers-$(uname -r)" + + echo_info 'sudo apt-get install --assume-yes build-essential' + sudo apt-get install --assume-yes build-essential + + # remove secure boot + echo_info 'sudo mokutil --disable-validation' + sudo mokutil --disable-validation + + # https://askubuntu.com/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur + # https://flavioprimo.xyz/os/how-to-install-virtualbox-on-ubuntu-having-uefi-secure-boot-enabled/ +fi + +# install extension pack +echo_info 'sudo apt-get install --assume-yes virtualbox-ext-pack' +sudo apt-get install --assume-yes virtualbox-ext-pack + +# install virtualbox driver +echo_info 'sudo modprobe vboxdrv' +sudo modprobe vboxdrv + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/virtualbox.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/virtualbox.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/devops/install_virtualenv.sh b/devops/install_virtualenv.sh new file mode 100755 index 0000000..5d4191a --- /dev/null +++ b/devops/install_virtualenv.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * virtualenv +# * python virtual env +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v pip)" ]; then + echo_error 'virtualenv requires python-pip to install' + exit 1 +fi + +# The -H (HOME) option requests that the security policy set the HOME environment variable to +# the home directory of the target user (root by default) as specified by the password +# database. Depending on the policy, this may be the default behavior. +echo_info 'sudo -H pip3 install virtualenv' +sudo -H pip3 install virtualenv + diff --git a/devops/remove_all_vagrant_dependencies.sh b/devops/remove_all_vagrant_dependencies.sh new file mode 100755 index 0000000..5f9f20c --- /dev/null +++ b/devops/remove_all_vagrant_dependencies.sh @@ -0,0 +1,144 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove all vagrant dependencies +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_danger 'Remove all vagrant dependencies' + +if vagrant status 2>/dev/null | grep -q 'running'; then + { + echo_warning 'Vagrant running, attempting to stop' + echo_info 'vagrant halt' + vagrant halt + } || { + echo_error 'Stopping Vagrant failed' + } +fi + +if vagrant status 2>/dev/null | grep -q 'running'; then + # uninstall virtualbox + echo_warning 'uninstall virtualbox' + + echo_info 'sudo apt-get remove --assume-yes virtualbox-5.2' + sudo apt-get remove --assume-yes virtualbox-5.2 + + echo_info 'sudo groupdel vboxusers' + sudo groupdel vboxusers +fi + +# uninstall vagrant +echo_warning 'uninstall vagrant' + +echo_info 'sudo rm -rf /opt/vagrant' +sudo rm -rf /opt/vagrant + +echo_info 'sudo rm -f /usr/bin/vagrant' +sudo rm -f /usr/bin/vagrant + +echo_info 'sudo rm -rf ~/.vagrant.d' +sudo rm -rf ~/.vagrant.d + +echo_info 'sudo apt-get remove --assume-yes --autoremove vagrant' +sudo apt-get remove --assume-yes --autoremove vagrant + +echo_info 'sudo dpkg -r vagrant' +sudo dpkg -r vagrant + +# uninstall ruby +echo_warning 'uninstall ruby' + +echo_info 'rvm remove ruby' +rvm remove ruby + +echo_info 'sudo apt-get autoremove -y --autoremove ruby' +sudo apt-get autoremove -y --autoremove ruby + +# uninstall rvm +echo_warning 'uninstall rvm' + +# This will remove the rvm/ directory and all the rubies built within it. +echo_info 'rvm implode' +rvm implode + +# In order to remove the final trace of rvm, you need to remove the rvm gem, too: +echo_info 'gem uninstall rvm' +gem uninstall rvm + +# uninstall python +echo_warning 'uninstall python' + +echo_info 'sudo apt-get remove --assume-yes --autoremove python-pip python-dev' +sudo apt-get remove --assume-yes --autoremove python-pip python-dev + +# uninstall chefdk +echo_warning 'uninstall chefdk' + +echo_info 'sudo dpkg -P chefdk' +sudo dpkg --purge chefdk + +# uninstall chef-solo +echo_warning 'uninstall chef-solo' + +echo_info 'sudo dpkg -P chef-solo' +sudo dpkg --purge chef + +# berks and chef doesn't uninstall properly +echo_info 'rm -rf /opt/chef' +rm -rf /opt/chef + +echo_info 'rm -rf ~/.berkshelf' +rm -rf ~/.berkshelf + +# stopping nfs-kernel-server +echo_info 'sudo service nfs-kernel-server stop' +sudo service nfs-kernel-server stop + +# uninstall essentials +echo_warning 'uninstall essentials' + +echo_info 'sudo apt-get remove --assume-yes --autoremove autoconf' +sudo apt-get remove --assume-yes --autoremove autoconf + +echo_info 'sudo apt-get remove --assume-yes --autoremove build-essential' +sudo apt-get remove --assume-yes --autoremove build-essential + +echo_info 'sudo apt-get remove --assume-yes --autoremove libssl-dev' +sudo apt-get remove --assume-yes --autoremove libssl-dev + +echo_info 'sudo apt-get remove --assume-yes --autoremove libxml2-dev' +sudo apt-get remove --assume-yes --autoremove libxml2-dev + +echo_info 'sudo apt-get remove --assume-yes --autoremove libxslt-dev' +sudo apt-get remove --assume-yes --autoremove libxslt-dev + +echo_info 'sudo apt-get remove --assume-yes --autoremove ruby-dev' +sudo apt-get remove --assume-yes --autoremove ruby-dev + +# uninstall nfs server +echo_warning 'uninstall nfs' + +echo_info 'sudo dpkg --purge nfs-kernel-server' +sudo dpkg --purge nfs-kernel-server + +echo_info 'sudo dpkg --purge nfs-common' +sudo dpkg --purge nfs-common + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/devops/remove_chefdk.sh b/devops/remove_chefdk.sh new file mode 100755 index 0000000..43975fd --- /dev/null +++ b/devops/remove_chefdk.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove chef +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_danger 'Remove chefdk' + +echo_info 'sudo apt-get purge --assume-yes chef' +sudo apt-get purge --assume-yes chef + +# uninstall chefdk +echo_warning 'uninstall chefdk' + +echo_info 'sudo dpkg --purge chefdk' +sudo dpkg --purge chefdk + +# uninstall chef-solo +echo_warning 'uninstall chef-solo' + +echo_info 'sudo dpkg --purge chef-solo' +sudo dpkg --purge chef + +# berks and chef doesn't uninstall properly +echo_info 'rm -rf /opt/chef' +rm -rf /opt/chef + +echo_info 'rm -rf ~/.berkshelf' +rm -rf ~/.berkshelf + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/devops/remove_docker-compose.sh b/devops/remove_docker-compose.sh new file mode 100755 index 0000000..6a15748 --- /dev/null +++ b/devops/remove_docker-compose.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove docker-compose +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_danger 'Remove docker-compose' + +echo_info 'sudo rm -f /usr/bin/docker-compose' +sudo rm -f /usr/bin/docker-compose + +echo_info 'sudo rm -f ~/.docker/cli-plugins/docker-compose' +sudo rm -f ~/.docker/cli-plugins/docker-compose + diff --git a/devops/remove_docker.sh b/devops/remove_docker.sh new file mode 100755 index 0000000..a15d1e6 --- /dev/null +++ b/devops/remove_docker.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove docker +# * +# * @category devops +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_danger 'Remove docker' + +echo_info 'sudo apt-get remove --assume-yes docker' +sudo apt-get remove --assume-yes docker + +echo_info 'sudo apt-get remove --assume-yes docker-engine' +sudo apt-get remove --assume-yes docker-engine + +echo_info 'sudo apt-get remove --assume-yes docker.io' +sudo apt-get remove --assume-yes docker.io + +echo_info 'sudo apt-get remove --assume-yes docker-ce' +sudo apt-get remove --assume-yes docker-ce + +echo_info 'sudo apt-get remove --assume-yes docker-ce-cli' +sudo apt-get remove --assume-yes docker-ce-cli + +echo_info 'sudo apt-get remove --assume-yes containerd.io' +sudo apt-get remove --assume-yes containerd.io + +echo_info 'sudo apt-get remove --assume-yes docker-compose-plugin' +sudo apt-get remove --assume-yes docker-compose-plugin + +echo_info "rm -r \"${HOME}/.docker/desktop\"" +rm -r "${HOME}/.docker/desktop" + +echo_info 'sudo rm /usr/local/bin/com.docker.cli' +sudo rm /usr/local/bin/com.docker.cli + +echo_info 'sudo rm -rf /var/lib/docker' +sudo rm -rf /var/lib/docker + +echo_info 'sudo rm -rf /var/lib/containerd' +sudo rm -rf /var/lib/containerd + +echo_info 'sudo apt purge docker-desktop' +sudo apt purge docker-desktop + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/drivers/README.md b/drivers/README.md new file mode 100644 index 0000000..44ca31c --- /dev/null +++ b/drivers/README.md @@ -0,0 +1,64 @@ +Prime-select intel is not powering off the nvidia card +====================================================== + +https://github.com/stockmind/dell-xps-9560-ubuntu-respin/issues/8#issuecomment-389292575 + +Running sudo powertop gave me a power usages of about 15W in idle, indicating that the GPU was still on, even after prime-select intel. + +I kept powertop running and in another terminal ran: + +```bash +$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/control +# resulted in "on", which is not good +``` + +I then executed (see bug report): + +```bash +sudo sh -c 'echo auto > /sys/bus/pci/devices/0000\:01\:00.0/power/control' +``` + +Powertop dropped to about 6W ! )) +So then it was simple, created this startup script to make the change permanent: + +```bash +$ sudo nano /lib/systemd/system/gpuoff.service +``` + +And pasted contents: + +``` +[Unit] +Description=Power-off gpu + +[Service] +Type=oneshot +ExecStart=/bin/bash -c "if [[ `prime-select query` == 'intel' ]]; then echo auto > /sys/bus/pci/devices/0000\:01\:00.0/power/control; fi" + +[Install] +WantedBy=default.target +``` + +To test the script you can run +```bash +$ sudo systemctl start gpuoff +``` + +If ok, run +```bash +$ sudo systemctl enable gpuoff +``` +to enable the script to start on powerup. + +To confirm that it works +```bash +$ cat /sys/bus/pci/devices/0000\:01\:00.0/power/control +``` +should return: "auto" after reboot. + +PS For what it is worth, my /etc/default/grub line is: + +``` +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.modeset=1 nouveau.modeset=0" +``` + diff --git a/drivers/config_disable_wayland.sh b/drivers/config_disable_wayland.sh new file mode 100755 index 0000000..92025ca --- /dev/null +++ b/drivers/config_disable_wayland.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Disable Wayland to allow screen sharing +# * +# * @license MIT +# * @author "Matthias Morin" +# * @category drivers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +OPTIND=0 +while getopts :h OPTION; do + case "${OPTION}" in + h) echo_label 12 'description'; echo_primary "$(basename "${0}"): Disable Wayland to allow screen sharing" + echo_label 12 'usage'; echo_primary "$(basename "${0}") -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +alert_primary 'Disable Wayland' + +if [ "${XDG_SESSION_TYPE}" = 'wayland' ]; then + # force the login screen to use Xorg + echo_info "sudo sed -i -E 's/^#?WaylandEnable=.+/WaylandEnable=false/' /etc/gdm3/custom.conf" + sudo sed -i -E 's/^#?WaylandEnable=.+/WaylandEnable=false/' /etc/gdm3/custom.conf + echo_success 'Your system is set to use x11' + echo_warning 'You need to reboot your system for the change to take effect' + + exit 0 +fi + +echo_error "Wayland is already disabled : Your session type is \"${XDG_SESSION_TYPE}\"" + diff --git a/drivers/config_fix_bluetooth_idle_timeout.sh b/drivers/config_fix_bluetooth_idle_timeout.sh new file mode 100755 index 0000000..e1275bb --- /dev/null +++ b/drivers/config_fix_bluetooth_idle_timeout.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config fix bluetooth idle timeout +# * +# * @deprecated +# * @license MIT +# * @author "Matthias Morin" +# * @category drivers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info "sudo sed -i 's/#IdleTimeout=30/IdleTimeout=0/g' /etc/bluetooth/input.conf" +sudo sed -i 's/#IdleTimeout=30/IdleTimeout=0/g' /etc/bluetooth/input.conf + diff --git a/drivers/config_fix_freezing_on_boot.sh b/drivers/config_fix_freezing_on_boot.sh new file mode 100755 index 0000000..0c88b3d --- /dev/null +++ b/drivers/config_fix_freezing_on_boot.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * video driver fix freezing on boot (ubuntu 16) +# * +# * @deprecated +# * @license MIT +# * @author "Matthias Morin" +# * @category drivers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +OPTIND=0 +while getopts :h OPTION; do + case "${OPTION}" in + h) echo_label 12 'description'; echo_primary "$(basename "${0}"): disable grub splash screen to avoid freeze on boot" + echo_label 12 'usage'; echo_primary "$(basename "${0}") -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +# NOTE: sed -E allows to use the `\w` tag in newer linux versions +echo_info "sudo sed -i -E s/'^GRUB_CMDLINE_LINUX_DEFAULT\s?=\s?\"?\w+\"?$'/'GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"'/g /etc/default/grub" +sudo sed -i -E s/'^GRUB_CMDLINE_LINUX_DEFAULT\s?=\s?"?\w+"?$'/'GRUB_CMDLINE_LINUX_DEFAULT="quiet"'/g /etc/default/grub + +echo_info 'sudo update-grub' +sudo update-grub + diff --git a/drivers/config_fix_intel_video_tearing.sh b/drivers/config_fix_intel_video_tearing.sh new file mode 100755 index 0000000..fa12d02 --- /dev/null +++ b/drivers/config_fix_intel_video_tearing.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * intel fix video tearing +# * +# * @deprecated +# * @category drivers +# * @license MIT +# * @author "Matthias Morin" +# * @link https://askubuntu.com/questions/1066722/intel-screen-tearing-ubuntu-18-04 +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +OPTIND=0 +while getopts :h OPTION; do + case "${OPTION}" in + h) echo_label 12 'description'; echo_primary "$(basename "${0}")" + echo_label 12 'usage'; echo_primary "$(basename "${0}") -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +echo_info 'sudo mkdir -p /etc/X11/xorg.conf.d' +sudo mkdir -p /etc/X11/xorg.conf.d + +cat > /etc/X11/xorg.conf.d/20-intel.conf < +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * blueman +# * +# * system bluetooth manager +# * +# * @category driver +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install BlueMan' + +echo_info 'sudo apt-get install --assume-yes blueman' +sudo apt-get install --assume-yes blueman diff --git a/drivers/install_cheese.sh b/drivers/install_cheese.sh new file mode 100755 index 0000000..af99cf4 --- /dev/null +++ b/drivers/install_cheese.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * cheese +# * +# * Take photos with usb webcam +# * +# * @category driver +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Cheese' + +echo_info 'sudo apt-get install --assume-yes cheese' +sudo apt-get install --assume-yes cheese diff --git a/drivers/install_cuda.sh b/drivers/install_cuda.sh new file mode 100755 index 0000000..3cc75f6 --- /dev/null +++ b/drivers/install_cuda.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install_cuda +# * +# * nvidia driver +# * +# * @category drivers +# * @link https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install cuda' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin' +wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin + +echo_info 'sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600' +sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 + +echo_info 'sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub' +sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub + +echo_info 'sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"' +sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get -y install cuda' +sudo apt-get -y install cuda + diff --git a/drivers/install_fingerprint.sh b/drivers/install_fingerprint.sh new file mode 100755 index 0000000..5cf5adb --- /dev/null +++ b/drivers/install_fingerprint.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * fingerprint reader +# * +# * @category drivers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info "sudo sh -c \"cat > /etc/apt/sources.list.d/$(lsb_release -cs 2>/dev/null)-dell.list << EOF\"" +sudo sh -c "cat > /etc/apt/sources.list.d/$(lsb_release -cs 2>/dev/null)-dell.list << EOF +deb http://dell.archive.canonical.com/updates/ $(lsb_release -cs 2>/dev/null)-dell public +deb http://dell.archive.canonical.com/updates/ $(lsb_release -cs 2>/dev/null)-oem public +deb http://dell.archive.canonical.com/updates/ $(lsb_release -cs 2>/dev/null)-somerville public +deb http://dell.archive.canonical.com/updates/ $(lsb_release -cs 2>/dev/null)-somerville-melisa public +EOF" + +echo_info 'sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9FDA6BED73CDC22' +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9FDA6BED73CDC22 + +echo_info 'sudo apt update -qq' +sudo apt update -qq + +echo_info 'sudo apt install -y oem-somerville-melisa-meta' +sudo apt install -y oem-somerville-melisa-meta + +echo_info 'sudo apt install -y libfprint-2-tod1-goodix' +sudo apt install -y libfprint-2-tod1-goodix + +echo_info 'sudo apt install -y oem-somerville-meta' +sudo apt install -y oem-somerville-meta + +#-------------------------------------------------- + +echo_info 'sudo apt install -y tlp-config' +sudo apt install -y tlp-config + +#-------------------------------------------------- + +echo_info 'sudo add-apt-repository ppa:boltgolt/howdy -y' +sudo add-apt-repository ppa:boltgolt/howdy -y + +echo_info 'sudo apt update -qq' +sudo apt update -qq + +echo_info 'sudo apt install howdy -y' +sudo apt install howdy -y diff --git a/drivers/install_gnome-sound-recorder.sh b/drivers/install_gnome-sound-recorder.sh new file mode 100755 index 0000000..52371ed --- /dev/null +++ b/drivers/install_gnome-sound-recorder.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * gnome-sound-recorder +# * +# * @category drivers +# * @ note `gstreamer-properties` +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes gnome-sound-recorder' +sudo apt-get install --assume-yes gnome-sound-recorder diff --git a/drivers/install_jmtpfs.sh b/drivers/install_jmtpfs.sh new file mode 100755 index 0000000..c285262 --- /dev/null +++ b/drivers/install_jmtpfs.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * jmtpfs +# * +# * Allows to mount android file system over usb +# * +# * @category drivers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes jmtpfs' +sudo apt-get install --assume-yes jmtpfs + diff --git a/drivers/install_nvidia.sh b/drivers/install_nvidia.sh new file mode 100755 index 0000000..b7776c7 --- /dev/null +++ b/drivers/install_nvidia.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * nvidia +# * https://www.nvidia.com/object/unix.html +# * +# * @category drivers +# * @link https://github.com/stockmind/dell-xps-9560-ubuntu-respin/issues/8#issuecomment-389292575 +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# add the nvidia graphic card ppa +echo_info 'sudo add-apt-repository ppa:graphics-drivers' +sudo add-apt-repository ppa:graphics-drivers + +echo_info 'sudo apt-get update' +sudo apt-get update + +# clean system of previous nvidia drivers +echo_info 'sudo apt-get purge nvidia*' +sudo apt-get purge nvidia* + +# echo_info 'sudo apt-get install --assume-yes nvidia-435' +# sudo apt-get install --assume-yes nvidia-435 + +# echo_info 'sudo apt-get install --assume-yes nvidia-430' +# sudo apt-get install --assume-yes nvidia-430 + +echo_info 'sudo apt-get install --assume-yes nvidia-390' +sudo apt-get install --assume-yes nvidia-390 + +# check installation +echo_info 'lsmod | grep nvidia' +lsmod | grep nvidia diff --git a/drivers/install_tlp.sh b/drivers/install_tlp.sh new file mode 100755 index 0000000..48e4fec --- /dev/null +++ b/drivers/install_tlp.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install tlp +# * +# * Enable power saving features +# * Edit settings here: /etc/default/tlp +# * Then reboot or `sudo tlp start` +# * You may also want the packages *"thermald"*, *"lm-sensors"* and *"psensor"* +# * https://doc.ubuntu-fr.org/tlp +# * +# * @category drivers +# * @link https://erdnaxe.github.io/dell-g3-17-ubuntu +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes tlp' +sudo apt-get install --assume-yes tlp + +echo_info 'sudo apt-get install --assume-yes tlp-rdw' +sudo apt-get install --assume-yes tlp-rdw + +echo_info 'sudo systemctl enable tlp' +sudo systemctl enable tlp + +echo_info 'sudo systemctl enable tlp-sleep' +sudo systemctl enable tlp-sleep + +echo_info 'sudo tlp start' +sudo tlp start diff --git a/drivers/remove-nouveau.sh b/drivers/remove-nouveau.sh new file mode 100755 index 0000000..eb27af0 --- /dev/null +++ b/drivers/remove-nouveau.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove-nouveau +# * +# * @category drivers +# * @license MIT +# * @link https://docs.kali.org/general-use/install-nvidia-drivers-on-kali-linux +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# disable nouveau +echo_info 'echo -e "blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off" > /etc/modprobe.d/blacklist-nouveau.conf' +echo -e "blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off" > /etc/modprobe.d/blacklist-nouveau.conf + +# update-initramfs +echo_info 'update-initramfs -u' +update-initramfs -u + +# check nouveau is disabled +echo_info 'lsmod | grep -i nouveau' +lsmod | grep -i nouveau diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..ebffadd --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,194 @@ +#!/bin/bash +set -e + +#/* +# * This file is part of TangoMan Entrypoint package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan CI Manager +# * +# * Run Continuous Integration +# * +# * @license MIT +# * @author "Matthias Morin" +# * @version 2.4.1-light +# * @link https://github.com/TangoMan75/entrypoint +# */ + +## Install git hooks +hooks() { + echo_info 'rm -fr .git/hooks\n' + rm -fr .git/hooks + + echo_info 'cp -r .githooks .git/hooks\n' + cp -r .githooks .git/hooks + + echo_info 'chmod +x .git/hooks/*\n' + chmod +x .git/hooks/* +} + +## Sniff errors with linter +lint() { + if [ ! -x "$(command -v shellcheck)" ]; then + echo_error "\"$(basename "${0}")\" requires shellcheck, try: 'sudo apt-get install -y shellcheck'\n" + return 1 + fi + + find . -maxdepth 3 -type f -name '*.sh' | sort -t '\0' -n | while read -r FILE + do + echo_info "shellcheck \"${FILE}\"\n" + shellcheck "${FILE}" + done +} + +## Initialise git submodules +submodules() { + if [ -z "$1" ]; then + set -- "$(dirname "$(realpath "$0")")" + else + set -- "$(dirname "$(realpath "$1")")" + fi + + if [ ! -d "$1" ]; then + echo_error "\"$1\" is not a valid directory." + return 1 + fi + + if [ ! -f "$1/.gitmodules" ]; then + echo_error '".gitmodules" not found' + return 1 + fi + + if [ ! -x "$(command -v git)" ] || [ ! -d "$1/.git" ]; then + if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'\n" + return 1 + fi + + if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'\n" + return 1 + fi + + # parse .gitmodules + grep -Eo 'https://.+' "$1/.gitmodules" | while read -r url; do + server=$(echo "${url}" | sed -E 's/https:\/\///' | sed -E 's/\.git$//' | tr ':' '/' | cut -d/ -f1) + # this script handles github repositories only + if [ "${server}" != 'github.com' ]; then + continue + fi + + repository=$(echo "${url}" | sed -E 's/https:\/\///' | sed -E 's/\.git$//' | tr ':' '/' | cut -d/ -f3) + # do not update existing submodule + if [ -n "$(ls -A "${repository}" 2>/dev/null)" ]; then + continue + fi + + echo_info "wget -q \"${url}/archive/refs/heads/master.zip\"\n" + wget -q "${url}/archive/refs/heads/master.zip" + + echo_info "unzip -qq \"$1/master.zip\"" + unzip -qq "$1/master.zip" + + echo_info "rm \"$1/master.zip\"" + rm "$1/master.zip" + + echo_info "mv \"$1/${repository}-\"* \"$1/${repository}\"\n" + mv "$1/${repository}-"* "$1/${repository}" + done + + return 0 + fi + + echo_info 'git submodule update --init --recursive\n' + git submodule update --init --recursive +} + +#-------------------------------------------------- +# copy/paste here TangoMan helper functions +# (like a nice set of semantic colors) +#-------------------------------------------------- + +# version v7.0.0-c +echo_info() { printf '%b%b\033[0m' '\033[95m' "${*}"; } +echo_error() { printf '%berror:\t%b\033[0m' '\033[31m' "${*}"; } + +#-------------------------------------------------- +# You do not need to worry about anything that's +# placed after this line. ;-) +#-------------------------------------------------- + +## Print this help (default) +help() { + printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;104;97m' '' '\033[1;104;97m' 'TangoMan CI Manager' '\033[1;104;97m' ''; + + printf '\033[33mInfos:\n' + printf '\033[32m author \033[97m"Matthias Morin" \n' + printf '\033[32m license \033[97mMIT \n' + printf '\033[32m version \033[97m2.4.1-light \n' + printf '\033[32m link \033[97mhttps://github.com/TangoMan75/shoe \n\n' + + printf '\033[33mDescription:\n' + printf '\033[97m Run Continuous Integration \n\n' + + printf '\033[33mUsage:\n' + printf '\033[95m sh entrypoint.sh [\033[32mcommand\033[95m] \n\n' + printf '\033[33mCommands:\n' + printf '\033[32m hooks \033[97mInstall git hooks\n' + printf '\033[32m lint \033[97mSniff errors with linter\n' + printf '\033[32m submodules \033[97mSniff errors with linter\n' + printf '\033[32m help \033[97mPrint this help (default)\n' +} + +#-------------------------------------------------- + +_get_functions() { + # this regular expression matches functions with either bash or sh syntax + awk '/^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); # remove leading "function ", round brackets and extra spaces + FUNCTION = substr($0, 1, index($0, "{")); # truncate string after opening curly brace + sub("{$", "", FUNCTION); # remove trailing curly brace + if (substr(PREV, 1, 3) == "## " && substr($0, 1, 1) != "_") print FUNCTION + } { PREV = $0 }' "$0" +} + +#-------------------------------------------------- + +_main() { + if [ $# -lt 1 ]; then + help + exit 0 + fi + + _execute='' + for _argument in "$@"; do + _is_valid=false + for _function in $(_get_functions); do + # get shorthand character + _shorthand="$(echo "${_function}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "${_function}" ] || [ "${_argument}" = "${_shorthand}" ]; then + # append argument to the execute stack + _execute="${_execute} ${_function}" + _is_valid=true + break + fi + done + if [ "${_is_valid}" = false ]; then + printf '\033[1;31merror:\t\033[0;91m"%s" is not a valid command\033[0m\n' "${_argument}" + help + exit 1 + fi + done + + for _function in ${_execute}; do + eval "${_function}" + done +} + +_main "$@" diff --git a/fonts/install_fonts-powerline-git.sh b/fonts/install_fonts-powerline-git.sh new file mode 100755 index 0000000..039f5b1 --- /dev/null +++ b/fonts/install_fonts-powerline-git.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install fonts-powerline +# * +# * @category fonts +# * @license MIT +# * @link https://github.com/powerline/fonts +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# This doesn't work: +# echo_info 'sudo apt-get install --assume-yes fonts-powerline' +# sudo apt-get install --assume-yes fonts-powerline + +echo_info 'mkdir ~/.fonts-powerline' +mkdir ~/.fonts-powerline + +echo_info 'git clone https://github.com/powerline/fonts --depth=1 ~/.fonts-powerline' +git clone https://github.com/powerline/fonts --depth=1 ~/.fonts-powerline + +echo_info 'bash ~/.fonts-powerline/install.sh' +bash ~/.fonts-powerline/install.sh + +echo_info 'rm -rf ~/.fonts-powerline' +rm -rf ~/.fonts-powerline + +# Fonts are downloaded here: +# .local/share/fonts diff --git a/fonts/install_fonts-powerline.sh b/fonts/install_fonts-powerline.sh new file mode 100755 index 0000000..9688e56 --- /dev/null +++ b/fonts/install_fonts-powerline.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install fonts-powerline +# * +# * @category fonts +# * @license MIT +# * @link https://github.com/powerline/fonts +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes fonts-powerline' +sudo apt-get install --assume-yes fonts-powerline + diff --git a/fonts/install_nerd-fonts.sh b/fonts/install_nerd-fonts.sh new file mode 100755 index 0000000..ab06eeb --- /dev/null +++ b/fonts/install_nerd-fonts.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install nerd-fonts +# * +# * Clicking the "install" button on ".ttf" file copies it to "~/.local/share/fonts/" folder. +# * +# * @category fonts +# * @license MIT +# * @link https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/MesloLGS NF Regular.ttf +# * @link https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Meslo/S/Regular/MesloLGSNerdFontMono-Regular.ttf +# * @link https://github.com/ryanoasis/nerd-fonts +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +SOURCE="${CURDIR}/nerd-fonts" +DESTINATION=${HOME}/.local/share/fonts/ + +echo_info "mkdir \"${DESTINATION}\"" +mkdir "${DESTINATION}" + +echo_info "cp \"${SOURCE}/MesloLGSNerdFont-BoldItalic.ttf\" \"${DESTINATION}/MesloLGSNerdFont-BoldItalic.ttf\"" +cp "${SOURCE}/MesloLGSNerdFont-BoldItalic.ttf" "${DESTINATION}/MesloLGSNerdFont-BoldItalic.ttf" + +echo_info "cp \"${SOURCE}/MesloLGSNerdFont-Bold.ttf\" \"${DESTINATION}/MesloLGSNerdFont-Bold.ttf\"" +cp "${SOURCE}/MesloLGSNerdFont-Bold.ttf" "${DESTINATION}/MesloLGSNerdFont-Bold.ttf" + +echo_info "cp \"${SOURCE}/MesloLGSNerdFont-Italic.ttf\" \"${DESTINATION}/MesloLGSNerdFont-Italic.ttf\"" +cp "${SOURCE}/MesloLGSNerdFont-Italic.ttf" "${DESTINATION}/MesloLGSNerdFont-Italic.ttf" + +echo_info "cp \"${SOURCE}/MesloLGSNerdFont-Regular.ttf\" \"${DESTINATION}/MesloLGSNerdFont-Regular.ttf\"" +cp "${SOURCE}/MesloLGSNerdFont-Regular.ttf" "${DESTINATION}/MesloLGSNerdFont-Regular.ttf" + +echo_info "cp \"${SOURCE}/MesloLGSNerdFontMono-Regular.ttf\" \"${DESTINATION}/MesloLGSNerdFontMono-Regular.ttf\"" +cp "${SOURCE}/MesloLGSNerdFontMono-Regular.ttf" "${DESTINATION}/MesloLGSNerdFontMono-Regular.ttf" + +echo_info 'fc-cache -vf' +fc-cache -vf + diff --git a/fonts/nerd-fonts/MesloLGSNerdFont-Bold.ttf b/fonts/nerd-fonts/MesloLGSNerdFont-Bold.ttf new file mode 100644 index 0000000..6e89a8f Binary files /dev/null and b/fonts/nerd-fonts/MesloLGSNerdFont-Bold.ttf differ diff --git a/fonts/nerd-fonts/MesloLGSNerdFont-BoldItalic.ttf b/fonts/nerd-fonts/MesloLGSNerdFont-BoldItalic.ttf new file mode 100644 index 0000000..d971400 Binary files /dev/null and b/fonts/nerd-fonts/MesloLGSNerdFont-BoldItalic.ttf differ diff --git a/fonts/nerd-fonts/MesloLGSNerdFont-Italic.ttf b/fonts/nerd-fonts/MesloLGSNerdFont-Italic.ttf new file mode 100644 index 0000000..eea184a Binary files /dev/null and b/fonts/nerd-fonts/MesloLGSNerdFont-Italic.ttf differ diff --git a/fonts/nerd-fonts/MesloLGSNerdFont-Regular.ttf b/fonts/nerd-fonts/MesloLGSNerdFont-Regular.ttf new file mode 100644 index 0000000..58ed11a Binary files /dev/null and b/fonts/nerd-fonts/MesloLGSNerdFont-Regular.ttf differ diff --git a/fonts/nerd-fonts/MesloLGSNerdFontMono-Regular.ttf b/fonts/nerd-fonts/MesloLGSNerdFontMono-Regular.ttf new file mode 100644 index 0000000..e43bc3c Binary files /dev/null and b/fonts/nerd-fonts/MesloLGSNerdFontMono-Regular.ttf differ diff --git a/fonts/remove_fonts-powerline.sh b/fonts/remove_fonts-powerline.sh new file mode 100755 index 0000000..9a53979 --- /dev/null +++ b/fonts/remove_fonts-powerline.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove fonts-powerline +# * +# * @category fonts +# * @license MIT +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Remove powerline fonts cache' + +echo_info 'apt-cache policy fonts-powerline' +apt-cache policy fonts-powerline + +echo_info 'sudo apt purge -y fonts-powerline' +sudo apt purge -y fonts-powerline + +echo_info 'rm ~/.local/share/fonts/PowerlineSymbols.otf' +rm ~/.local/share/fonts/PowerlineSymbols.otf + +echo_info 'fc-cache -vf' +fc-cache -vf + diff --git a/fonts/remove_nerd-fonts.sh b/fonts/remove_nerd-fonts.sh new file mode 100755 index 0000000..cee5bd9 --- /dev/null +++ b/fonts/remove_nerd-fonts.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove nerd-fonts +# * +# * @category fonts +# * @license MIT +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Remove nerd fonts' + +FONTS_FOLDER=${HOME}/.local/share/fonts/ + +#-------------------------------------------------- + +echo_info "rm -f \"${FONTS_FOLDER}/MesloLGSNerdFonts-Bold.ttf\"" +rm -f "${FONTS_FOLDER}/MesloLGSNerdFonts-Bold.ttf" + +echo_info "rm -f \"${FONTS_FOLDER}/MesloLGSNerdFonts-BoldItalic.ttf\"" +rm -f "${FONTS_FOLDER}/MesloLGSNerdFonts-BoldItalic.ttf" + +echo_info "rm -f \"${FONTS_FOLDER}/MesloLGSNerdFonts-Italic.ttf\"" +rm -f "${FONTS_FOLDER}/MesloLGSNerdFonts-Italic.ttf" + +echo_info "rm -f \"${FONTS_FOLDER}/MesloLGSNerdFonts-Regular.ttf\"" +rm -f "${FONTS_FOLDER}/MesloLGSNerdFonts-Regular.ttf" + +echo_info "rm -f \"${FONTS_FOLDER}/MesloLGSNerdFontMono-Regular.ttf\"" +rm -f "${FONTS_FOLDER}/MesloLGSNerdFontMono-Regular.ttf" + +#-------------------------------------------------- + +echo_info 'fc-cache -vf' +fc-cache -vf + diff --git a/games/README.md b/games/README.md new file mode 100644 index 0000000..e01fa48 --- /dev/null +++ b/games/README.md @@ -0,0 +1,138 @@ +EMULATORS +========= + +Last Update : 23:14 27/02/2023 + +Emulators +--------- + +- [mame](https://www.mamedev.org) +- [winkawaks](http://www.winkawaks.org) +- [pcsx2](https://pcsx2.net) + +PS4 Controllers +--------------- + +Pair playstation 4 controller: +share+playstation (hold 3 secs) + +Turn on playstation 4 controller: +playstation + +Turn off playstation 4 controller: +share+playstation (hold 8 secs) + +Reset the DUALSHOCK®4 to Pair with PS4™ +--------------------------------------- + +### Step 1 +Turn off and unplug your PS4™ from the wall or power strip. +### Step 2 +Unplug the power to your router or modem. +### Step 3 +Locate the small reset button on the back of the DS4 near the L2 shoulder button + +![Image highlighting location of the dualshock 4 reset button](how_to_reset_details.png) + +### Step 4 +Use a small, unfolded paper-clip or something similar to push the button inside the tiny hole. Hold the button down for roughly 3-5 seconds and release. +### Step 5 +Attempt to re-pair the DS4 with the PS4™ by connecting the USB cable from the controller to the console. +### Step 6 +Turn on the PS4™, then press the PS button to log into your profile. +### Step 7 +The light bar will turn blue indicating the DS4 has paired. + +PCSX2 +===== + +Burnout 3: Takedown +------------------- + +- [pcsx2 issues](https://github.com/PCSX2/pcsx2/issues/1415) +- [burnout 3 bug](https://imgur.com/a/gi6Rb) +- [burnout 3 wiki](https://wiki.pcsx2.net/index.php/Burnout_3:_Takedown) + +### Black Sky / Shattered Car Window Effect is Missing +Workaround: Switch to software mode (F9 button), load an event, and then switch back to hardware mode (F9 button again). + +ROM FAQ +======= + +ROM archives +------------ + +- [coolrom.com](http://coolrom.com) +- [download](http://coolrom.com/dlpop.php?id=41380) + +- [emurom.net](https://www.emurom.net) +- [planetemu.net](http://www.planetemu.net) + +- [arcadehits.net](http://www.arcadehits.net) +- [emuparadise.me](https://www.emuparadise.me) + +Standard Codes +-------------- + +| code | value | +|--------|--------------------| +| [a] | Alternate | +| [b] | Bad Dump | +| [BF] | Bug Fix | +| [c] | Cracked | +| [f] | Other Fix | +| [h] | Hack | +| [o] | Overdump | +| [p] | Pirate | +| [t] | Trained | +| [T] | Translation | +| (Unl) | Unlicensed | +| [x] | Bad Checksum | +| ZZZ_ | Unclassified | +| [!] | Verified Good Dump | +| (???k) | ROM Size | + +Special Codes +------------- + +| code | value | +|--------|--------------------------------| +| [C] | Color GameBoy | +| [S] | Super GameBoy | +| (M#) | Multilanguage (# of Languages) | +| [M] | Mono Only (NeoGeo Pocket) | +| (PC10) | PlayChoice 10 (NES) | +| (1) | Japan (Genesis) | +| (4) | USA (Genesis) | +| (5) | NTSC Only (Genesis) | +| (8) | PAL Only (Genesis) | +| (BS) | BS ROMS (SNES) | +| (ST) | Sufami Turbo (SNES) | +| (NP) | Nintendo Power (SNES) | +| (Adam) | ADAM Version (Coleco) | +| (PAL) | PAL Video | + +Country Codes +------------- + +| code | value | +|-------|-----------------| +| (A) | Australian | +| (C) | Chinese | +| (E) | Europe | +| (F) | French | +| (FN) | Finland | +| (G) | German | +| (GR) | Greece | +| (HK) | Hong Kong | +| (I) | Italian | +| (J) | Japan | +| (K) | Korean | +| (NL) | Dutch | +| (PD) | Public Domain | +| (S) | Spanish | +| (SW) | Sweden | +| (U) | USA | +| (UK) | England | +| (Unk) | Unknown Country | +| (-) | Unknown Country | diff --git a/games/config_mame.sh b/games/config_mame.sh new file mode 100755 index 0000000..5aa50c9 --- /dev/null +++ b/games/config_mame.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config mame +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +CONFIG_DIR="${CURDIR}/../config" + +echo_info "sudo cp -Rfv \"${CONFIG_DIR}/home/.mame\" ~" +sudo cp -Rfv "${CONFIG_DIR}/home/.mame" ~ diff --git a/games/config_steam.png b/games/config_steam.png new file mode 100644 index 0000000..48c7183 Binary files /dev/null and b/games/config_steam.png differ diff --git a/games/how_to_reset_details.png b/games/how_to_reset_details.png new file mode 100644 index 0000000..3c8763c Binary files /dev/null and b/games/how_to_reset_details.png differ diff --git a/games/install_assassin_s_creed_unity.sh b/games/install_assassin_s_creed_unity.sh new file mode 100755 index 0000000..65e36b6 --- /dev/null +++ b/games/install_assassin_s_creed_unity.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Assassin's Creed Unity +# * +# * @category games +# * @link https://ubisoftconnect.com +# * @link https://lutris.net/games/assassins-creed-unity/ +# * @link https://lutris.net/games/ubisoft-connect/ +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary "Install Assassin's Creed Unity" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v wine)" ]; then + echo_error "\"$(basename "${0}")\" requires wine, try: 'sudo apt-get install -y wine'" + exit 1 +fi + +if [ ! -x "$(command -v lutris)" ]; then + echo_error "\"$(basename "${0}")\" requires lutris, try: 'sudo apt-get install -y lutris'" + exit 1 +fi + +echo_info "Download Assassin's Creed Unity Lutris config" + +echo_info 'wget -O /tmp/assassins-creed-unity-uplay.json https://lutris.net/api/installers/assassins-creed-unity-uplay?format=json' +wget -O /tmp/assassins-creed-unity-uplay.json https://lutris.net/api/installers/assassins-creed-unity-uplay?format=json + +echo_info "Installing Assassin's Creed from Lutris config" +echo_warning 'If installation fails try to config wine with "winecfg"' + +echo_info 'lutris -i /tmp/assassins-creed-unity-uplay.json' +lutris -i /tmp/assassins-creed-unity-uplay.json + +# alert_danger "Cannot install Assassin's Creed Unity" diff --git a/games/install_blizzard_battle_net.sh b/games/install_blizzard_battle_net.sh new file mode 100755 index 0000000..783214d --- /dev/null +++ b/games/install_blizzard_battle_net.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Blizzard Battle.net +# * +# * @category games +# * @link https://www.blizzard.com/en-us/download +# * @link https://github.com/lutris/docs/blob/master/Battle.Net.md +# * @link https://lutris.net/games/battlenet/ +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary "Install Blizzard Battle.net" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v wine)" ]; then + echo_error "\"$(basename "${0}")\" requires wine, try: 'sudo apt-get install -y wine'" + exit 1 +fi + +if [ ! -x "$(command -v lutris)" ]; then + echo_error "\"$(basename "${0}")\" requires lutris, try: 'sudo apt-get install -y lutris'" + exit 1 +fi + +echo_info 'Download Blizzard Battle.net Lutris config' + +echo_info 'wget -O /tmp/blizzard-battlenet-standard.json https://lutris.net/api/installers/blizzard-battlenet-standard?format=json' +wget -O /tmp/blizzard-battlenet-standard.json https://lutris.net/api/installers/blizzard-battlenet-standard?format=json + +echo_info 'Installing Blizzard Battle.net from Lutris config' +echo_warning 'If installation fails try to config wine with "winecfg"' + +echo_info 'lutris -i /tmp/blizzard-battlenet-standard.json' +lutris -i /tmp/blizzard-battlenet-standard.json diff --git a/games/install_cmatrix.sh b/games/install_cmatrix.sh new file mode 100755 index 0000000..65f484e --- /dev/null +++ b/games/install_cmatrix.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * cmatrix +# * matrix command line fun +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install cmatrix' + +echo_info 'sudo apt-get install --assume-yes cmatrix' +sudo apt-get install --assume-yes cmatrix diff --git a/games/install_cowsay.sh b/games/install_cowsay.sh new file mode 100755 index 0000000..028b7c3 --- /dev/null +++ b/games/install_cowsay.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * cowsay +# * cowsay command line fun +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install cowsay' + +echo_info 'sudo apt-get install --assume-yes cowsay' +sudo apt-get install --assume-yes cowsay diff --git a/games/install_epsxe_libs.sh b/games/install_epsxe_libs.sh new file mode 100755 index 0000000..4209dff --- /dev/null +++ b/games/install_epsxe_libs.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * epsxe-libs +# * required libraries for epsxe playstation emulator +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes libsdl1.2debian' +sudo apt-get install --assume-yes libsdl1.2debian + +echo_info 'sudo apt-get install --assume-yes libsdl-ttf2.0-0' +sudo apt-get install --assume-yes libsdl-ttf2.0-0 + +echo_info 'sudo apt-get install --assume-yes libcurl3' +sudo apt-get install --assume-yes libcurl3 + +echo_info 'sudo apt-get install --assume-yes libncurses5' +sudo apt-get install --assume-yes libncurses5 + +echo_info 'sudo apt-get install --assume-yes libgtk-3-0' +sudo apt-get install --assume-yes libgtk-3-0 diff --git a/games/install_fortnite.sh b/games/install_fortnite.sh new file mode 100755 index 0000000..f41255d --- /dev/null +++ b/games/install_fortnite.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Fortnite +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Fortnite' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v wine)" ]; then + echo_error "\"$(basename "${0}")\" requires wine, try: 'sudo apt-get install -y wine'" + exit 1 +fi + +if [ ! -x "$(command -v lutris)" ]; then + echo_error "\"$(basename "${0}")\" requires lutris, try: 'sudo apt-get install -y lutris'" + exit 1 +fi + +echo_info 'Download Fortnite Lutris config' + +alert_danger 'Cannot install Fortnite' diff --git a/games/install_fortune.sh b/games/install_fortune.sh new file mode 100755 index 0000000..87f8bc6 --- /dev/null +++ b/games/install_fortune.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * fortune +# * fortune cookie command line fun +# * +# * @category games +# * @link https://doc.ubuntu-fr.org/fortune +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install fortune' + +echo_info 'sudo apt-get install --assume-yes fortune' +sudo apt-get install --assume-yes fortune + diff --git a/games/install_grand_theft_auto_5.sh b/games/install_grand_theft_auto_5.sh new file mode 100755 index 0000000..eab1841 --- /dev/null +++ b/games/install_grand_theft_auto_5.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Grand Theft Auto V +# * +# * @category games +# * @link https://lutris.net/games/grand-theft-auto-v/ +# * @link https://www.rockstargames.com/gta-v +# * @link https://socialclub.rockstargames.com/games/gtav +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Grand Theft Auto V' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v wine)" ]; then + echo_error "\"$(basename "${0}")\" requires wine, try: 'sudo apt-get install -y wine'" + exit 1 +fi + +if [ ! -x "$(command -v lutris)" ]; then + echo_error "\"$(basename "${0}")\" requires lutris, try: 'sudo apt-get install -y lutris'" + exit 1 +fi + +echo_info 'Download Grand Theft Auto V Lutris config' + +echo_info 'wget -O /tmp/grand-theft-auto-v-rockstar-games-launc.json https://lutris.net/api/installers/grand-theft-auto-v-rockstar-games-launc?format=json' +wget -O /tmp/grand-theft-auto-v-rockstar-games-launc.json https://lutris.net/api/installers/grand-theft-auto-v-rockstar-games-launc?format=json + +echo_info 'Installing Grand Theft Auto V from Lutris config' +echo_warning 'If installation fails try to config wine with "winecfg"' + +echo_info 'lutris -i /tmp/grand-theft-auto-v-rockstar-games-launc.json' +lutris -i /tmp/grand-theft-auto-v-rockstar-games-launc.json diff --git a/games/install_lutris.sh b/games/install_lutris.sh new file mode 100755 index 0000000..6398e48 --- /dev/null +++ b/games/install_lutris.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * lutris +# * +# * @category games +# * @link https://lutris.net +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Lutris' + +echo_info 'sudo add-apt-repository ppa:lutris-team/lutris' +sudo add-apt-repository ppa:lutris-team/lutris + +echo_info 'sudo apt-get install --assume-yes lutris' +sudo apt-get install --assume-yes lutris + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/net.lutris.Lutris.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/net.lutris.Lutris.desktop "$(xdg-user-dir DESKTOP)" diff --git a/games/install_mame.sh b/games/install_mame.sh new file mode 100755 index 0000000..8558c7a --- /dev/null +++ b/games/install_mame.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mame +# * multiple arcade game emulator +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install mame' + +echo_info 'sudo add-apt-repository ppa:c.falco/mame' +sudo add-apt-repository ppa:c.falco/mame + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get -y install mame' +sudo apt-get -y install mame + diff --git a/games/install_mednafen.sh b/games/install_mednafen.sh new file mode 100755 index 0000000..0a41e6d --- /dev/null +++ b/games/install_mednafen.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mednafen +# * multiple console game emulator +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes mednafen' +sudo apt-get install --assume-yes mednafen diff --git a/games/install_pcsx2.sh b/games/install_pcsx2.sh new file mode 100755 index 0000000..36f60f9 --- /dev/null +++ b/games/install_pcsx2.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * pcsx2 +# * playstation 2 emulator +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install PCSX2' + +# echo_info 'sudo apt-get install --assume-yes libcg:i386' +# sudo apt-get install --assume-yes libcg:i386 + +# echo_info 'sudo apt-get install --assume-yes libwxgtk2:i386' +# sudo apt-get install --assume-yes libwxgtk2:i386 + +echo_info 'sudo add-apt-repository --yes ppa:gregory-hainaut/pcsx2.official.ppa' +sudo add-apt-repository --yes ppa:gregory-hainaut/pcsx2.official.ppa + +echo_info 'sudo apt-get update' +sudo apt-get update + +# install pcsx2 +echo_info 'sudo apt-get install --assume-yes pcsx2:i386' +sudo apt-get install --assume-yes pcsx2:i386 + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/PCSX2.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/PCSX2.desktop "$(xdg-user-dir DESKTOP)" diff --git a/games/install_ppsspp.sh b/games/install_ppsspp.sh new file mode 100755 index 0000000..c34bd07 --- /dev/null +++ b/games/install_ppsspp.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ppsspp +# * playstation portable emulator +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install PPSSPP' + +# Old repository +# echo_info 'sudo add-apt-repository --yes ppa:ppsspp/stable' +# sudo add-apt-repository --yes ppa:ppsspp/stable +# sudo add-apt-repository --yes --remove ppa:ppsspp/stable + +# Unofficial repository +echo_info 'sudo add-apt-repository --yes ppa:xuzhen666/ppsspp' +sudo add-apt-repository --yes ppa:xuzhen666/ppsspp + +echo_info 'sudo apt-get update' +sudo apt-get update + +# install ppsspp +echo_info 'sudo apt-get install --assume-yes ppsspp' +sudo apt-get install --assume-yes ppsspp + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/ppsspp.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/ppsspp.desktop "$(xdg-user-dir DESKTOP)" diff --git a/games/install_proton.sh b/games/install_proton.sh new file mode 100755 index 0000000..f6a7e27 --- /dev/null +++ b/games/install_proton.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * proton +# * +# * @category games +# * @link https://www.protondb.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install proton' + +echo_info 'sudo add-apt-repository ppa:proton-team/proton' +sudo add-apt-repository ppa:proton-team/proton + +echo_info 'sudo apt-get install --assume-yes proton' +sudo apt-get install --assume-yes proton diff --git a/games/install_retroarch.sh b/games/install_retroarch.sh new file mode 100755 index 0000000..a611f81 --- /dev/null +++ b/games/install_retroarch.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * retroarch +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'sudo add-apt-repository --yes ppa:libretro/stable' +sudo add-apt-repository --yes ppa:libretro/stable + +echo_info 'sudo apt-get install --assume-yes retroarch' +sudo apt-get install --assume-yes retroarch + +echo_info "wget https://buildbot.libretro.com/stable/1.15.0/linux/x86_64/RetroArch_cores.7z" +wget https://buildbot.libretro.com/stable/1.15.0/linux/x86_64/RetroArch_cores.7z + +echo_info "7z e RetroArch_cores.7z -o\"${HOME}/.config/retroarch/cores/\"" +7z e RetroArch_cores.7z -o"${HOME}/.config/retroarch/cores/" + +echo_info 'rm RetroArch_cores.7z' +rm RetroArch_cores.7z + +echo_info 'find ~/.config/retroarch/cores/* -type d -delete' +find ~/.config/retroarch/cores/* -type d -delete + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/retroarch.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/retroarch.desktop "$(xdg-user-dir DESKTOP)" diff --git a/games/install_rockstar_game_launcher.sh b/games/install_rockstar_game_launcher.sh new file mode 100755 index 0000000..9ea3edd --- /dev/null +++ b/games/install_rockstar_game_launcher.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Rockstar Game Launcher +# * +# * @category games +# * @link https://socialclub.rockstargames.com/rockstar-games-launcher +# * @link https://lutris.net/games/rockstar-games-launcher/ +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary "Install Rockstar Game Launcher" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v wine)" ]; then + echo_error "\"$(basename "${0}")\" requires wine, try: 'sudo apt-get install -y wine'" + exit 1 +fi + +if [ ! -x "$(command -v lutris)" ]; then + echo_error "\"$(basename "${0}")\" requires lutris, try: 'sudo apt-get install -y lutris'" + exit 1 +fi + +echo_info 'Download Rockstar Game Launcher Lutris config' + +echo_info 'wget -O /tmp/rockstar-games-launcher-standalone-1036344.json https://lutris.net/api/installers/rockstar-games-launcher-standalone-1036344?format=json' +wget -O /tmp/rockstar-games-launcher-standalone-1036344.json https://lutris.net/api/installers/rockstar-games-launcher-standalone-1036344?format=json + +echo_info 'Installing Rockstar Game Launcher from Lutris config' +echo_warning 'If installation fails try to config wine with "winecfg"' + +echo_info 'lutris -i /tmp/rockstar-games-launcher-standalone-1036344.json' +lutris -i /tmp/rockstar-games-launcher-standalone-1036344.json diff --git a/games/install_sl.sh b/games/install_sl.sh new file mode 100755 index 0000000..300980f --- /dev/null +++ b/games/install_sl.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * sl +# * display animations aimed to correct users who accidentally enter sl instead of ls. +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install sl' + +echo_info 'sudo apt-get install --assume-yes sl' +sudo apt-get install --assume-yes sl diff --git a/games/install_startcraft_2.sh b/games/install_startcraft_2.sh new file mode 100755 index 0000000..d3e2666 --- /dev/null +++ b/games/install_startcraft_2.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Starcraft II +# * +# * @category games +# * @link https://lutris.net/games/starcraft-ii +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Starcraft II' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v wine)" ]; then + echo_error "\"$(basename "${0}")\" requires wine, try: 'sudo apt-get install -y wine'" + exit 1 +fi + +if [ ! -x "$(command -v lutris)" ]; then + echo_error "\"$(basename "${0}")\" requires lutris, try: 'sudo apt-get install -y lutris'" + exit 1 +fi + +echo_info 'Installing Lutris Battle.net prerequisintes' + +echo_info 'sudo apt-get install --assume-yes libgnutls30:i386' +sudo apt-get install --assume-yes libgnutls30:i386 + +echo_info 'sudo apt-get install --assume-yes libldap-2.4-2:i386' +sudo apt-get install --assume-yes libldap-2.4-2:i386 + +echo_info 'sudo apt-get install --assume-yes libgpg-error0:i386' +sudo apt-get install --assume-yes libgpg-error0:i386 + +echo_info 'sudo apt-get install --assume-yes libsqlite3-0:i386' +sudo apt-get install --assume-yes libsqlite3-0:i386 + +echo_info 'Download Startcraft II Lutris config' + +echo_info 'wget -O /tmp/starcraft2-lutris.json https://lutris.net/api/installers/starcraft-ii-battlenet?format=json' +wget -O /tmp/starcraft2-lutris.json https://lutris.net/api/installers/starcraft-ii-battlenet?format=json + +echo_info 'Installing Startcraft II from Lutris config' +echo_warning 'If installation fails try to config wine with "winecfg"' + +echo_info 'lutris -i /tmp/starcraft2-lutris.json' +lutris -i /tmp/starcraft2-lutris.json + diff --git a/games/install_steam.sh b/games/install_steam.sh new file mode 100755 index 0000000..1ab3db6 --- /dev/null +++ b/games/install_steam.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * steam +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Steam' + +echo_info 'sudo apt-get install --assume-yes steam' +sudo apt-get install --assume-yes steam + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/steam.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/steam.desktop "$(xdg-user-dir DESKTOP)" diff --git a/games/install_ubisoft_uplay.sh b/games/install_ubisoft_uplay.sh new file mode 100755 index 0000000..791824b --- /dev/null +++ b/games/install_ubisoft_uplay.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Ubisoft Uplay +# * +# * @category games +# * @link https://ubisoftconnect.com +# * @link https://lutris.net/games/ubisoft-connect/ +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary "Install Ubisoft Uplay" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v wine)" ]; then + echo_error "\"$(basename "${0}")\" requires wine, try: 'sudo apt-get install -y wine'" + exit 1 +fi + +if [ ! -x "$(command -v lutris)" ]; then + echo_error "\"$(basename "${0}")\" requires lutris, try: 'sudo apt-get install -y lutris'" + exit 1 +fi + +echo_info 'Download Ubisoft Uplay Lutris config' + +echo_info 'wget -O /tmp/ubisoft-connect-latest.json https://lutris.net/api/installers/ubisoft-connect-latest?format=json' +wget -O /tmp/ubisoft-connect-latest.json https://lutris.net/api/installers/ubisoft-connect-latest?format=json + +echo_info 'Installing Ubisoft Uplay from Lutris config' +echo_warning 'If installation fails try to config wine with "winecfg"' + +echo_info 'lutris -i /tmp/ubisoft-connect-latest.json' +lutris -i /tmp/ubisoft-connect-latest.json diff --git a/games/install_winamax.sh b/games/install_winamax.sh new file mode 100755 index 0000000..f61973e --- /dev/null +++ b/games/install_winamax.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * winmax +# * french online poker game +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/system/is_installed.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v wine)" ]; then + echo_error "\"$(basename "${0}")\" requires wine, try: 'sudo apt-get install -y wine'" + exit 1 +fi + +echo_primary 'please check wine version is >= 1.6.2' +echo_info 'wine --version' +wine --version + +echo_primary 'please check wine is Windows 10 mode (optional)' +echo_info 'winecfg' +winecfg + +echo_info 'wget https://dl.winamax.fr/client/windows/installer/wamInstall.exe' +wget https://dl.winamax.fr/client/windows/installer/wamInstall.exe + +echo_info 'wine wamInstall.exe' +wine wamInstall.exe + +echo_info 'rm -f wamInstall.exe' +rm -f wamInstall.exe + diff --git a/games/remove_bloat_games.sh b/games/remove_bloat_games.sh new file mode 100755 index 0000000..4c14bbd --- /dev/null +++ b/games/remove_bloat_games.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove bloat game +# * +# * @category games +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes aisleriot' +sudo apt-get purge --assume-yes aisleriot + +echo_info 'sudo apt-get purge --assume-yes gnome-mahjongg' +sudo apt-get purge --assume-yes gnome-mahjongg + +echo_info 'sudo apt-get purge --assume-yes gnome-mines' +sudo apt-get purge --assume-yes gnome-mines + +echo_info 'sudo apt-get purge --assume-yes gnome-sudoku' +sudo apt-get purge --assume-yes gnome-sudoku + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/graphics/install_digikam.sh b/graphics/install_digikam.sh new file mode 100755 index 0000000..6bf0921 --- /dev/null +++ b/graphics/install_digikam.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * digikam +# * photo manager +# * +# * @category graphics +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install digikam' + +echo_info 'sudo apt-get install --assume-yes digikam' +sudo apt-get install --assume-yes digikam + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/org.kde.digikam.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/org.kde.digikam.desktop "$(xdg-user-dir DESKTOP)" diff --git a/graphics/install_exiftool.sh b/graphics/install_exiftool.sh new file mode 100755 index 0000000..6afe19f --- /dev/null +++ b/graphics/install_exiftool.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * exiftool +# * exif tag editor +# * +# * @category graphics +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install exiftool' + +echo_info 'sudo apt-get install --assume-yes exiftool' +sudo apt-get install --assume-yes exiftool diff --git a/graphics/install_flameshot.sh b/graphics/install_flameshot.sh new file mode 100755 index 0000000..d666e04 --- /dev/null +++ b/graphics/install_flameshot.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * flameshot +# * +# * Powerful yet simple to use screenshot software +# * +# * @category graphics +# * @link https://github.com/flameshot-org/flameshot +# * @note create a keyboard shortcut to `/usr/bin/flameshot gui` +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Flameshot' + +echo_info 'sudo apt-get install --assume-yes flameshot' +sudo apt-get install --assume-yes flameshot + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/org.flameshot.Flameshot.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/org.flameshot.Flameshot.desktop "$(xdg-user-dir DESKTOP)" + +# Config flameshot as default +# gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']" +# gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'flameshot' +# gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command '/usr/bin/flameshot gui' +# gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding 'Print' diff --git a/graphics/install_gimp.sh b/graphics/install_gimp.sh new file mode 100755 index 0000000..a865abc --- /dev/null +++ b/graphics/install_gimp.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install gimp +# * gnu image manipulation program +# * +# * @category graphics +# * @link https://www.gimp.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Gimp' + +echo_info 'sudo apt-get install --assume-yes gimp' +sudo apt-get install --assume-yes gimp + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/gimp.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/gimp.desktop "$(xdg-user-dir DESKTOP)" diff --git a/graphics/install_imagemagick.sh b/graphics/install_imagemagick.sh new file mode 100755 index 0000000..620995d --- /dev/null +++ b/graphics/install_imagemagick.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * imagemagick +# * +# * convert images, +# * extract exif info from image file +# * +# * ```bash +# * $ convert -resize 50% myfigure.png myfigure.jpg +# * ``` +# * +# * @category graphics +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install imagemagick' + +echo_info 'sudo apt-get install --assume-yes imagemagick' +sudo apt-get install --assume-yes imagemagick diff --git a/graphics/install_inkscape.sh b/graphics/install_inkscape.sh new file mode 100755 index 0000000..063ad3f --- /dev/null +++ b/graphics/install_inkscape.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * inkscape +# * vector graphics +# * +# * @category graphics +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Inkscape' + +echo_info 'sudo add-apt-repository --yes ppa:inkscape.dev/stable1' +sudo add-apt-repository --yes ppa:inkscape.dev/stable1 + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes inkscape' +sudo apt-get install --assume-yes inkscape + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/inkscape.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/inkscape.desktop "$(xdg-user-dir DESKTOP)" diff --git a/graphics/install_jhead.sh b/graphics/install_jhead.sh new file mode 100755 index 0000000..b902e81 --- /dev/null +++ b/graphics/install_jhead.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * jhead +# * exif jpeg header manipulation tool +# * +# * @category graphics +# * @link http://www.sentex.net/~mwandel/jhead +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install jhead' + +echo_info 'sudo apt-get install --assume-yes jhead' +sudo apt-get install --assume-yes jhead diff --git a/graphics/install_jpegoptim.sh b/graphics/install_jpegoptim.sh new file mode 100755 index 0000000..72e21db --- /dev/null +++ b/graphics/install_jpegoptim.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * jpegoptim +# * +# * cli image optimizer +# * +# * ```bash +# * $ jpegoptim --strip-exif --all-progressive .jpg +# * ``` +# * +# * @category graphics +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install jpegoptim' + +echo_info 'sudo apt-get install --assume-yes jpegoptim' +sudo apt-get install --assume-yes jpegoptim diff --git a/graphics/install_optipng.sh b/graphics/install_optipng.sh new file mode 100755 index 0000000..089edda --- /dev/null +++ b/graphics/install_optipng.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * optipng +# * +# * cli image optimizer +# * +# * ```bash +# * $ optipng .png +# * ``` +# * +# * @category graphics +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install optipng' + +echo_info 'sudo apt-get install --assume-yes optipng' +sudo apt-get install --assume-yes optipng diff --git a/graphics/install_pinta.sh b/graphics/install_pinta.sh new file mode 100755 index 0000000..ce5d790 --- /dev/null +++ b/graphics/install_pinta.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install pinta +# * simple picture editor +# * +# * @category graphics +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install pinta' + +echo_info 'sudo apt-get install --assume-yes pinta' +sudo apt-get install --assume-yes pinta + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/pinta.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/pinta.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/graphics/install_shotwell.sh b/graphics/install_shotwell.sh new file mode 100755 index 0000000..8fb5059 --- /dev/null +++ b/graphics/install_shotwell.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * shotwell +# * photo manager +# * +# * @category graphics +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install shotwell' + +echo_info 'sudo apt-get install --assume-yes shotwell' +sudo apt-get install --assume-yes shotwell diff --git a/ide/CONFIG_VISUALSTUDIOCODE.md b/ide/CONFIG_VISUALSTUDIOCODE.md new file mode 100644 index 0000000..95ef402 --- /dev/null +++ b/ide/CONFIG_VISUALSTUDIOCODE.md @@ -0,0 +1,109 @@ +CONFIG_VISUALSTUDIOCODE +=== + +## Monokaï theme + +Click +``` +File > Preferences > Theme +``` + +Or (Ctrl+k Ctrl+t) + +## Enable code outline on secondary side bar + +Click +``` +View > Appearance > Secondary Side Bar +``` + +Click on the activity bar +> Explorer (Ctrl+Shift+E) + +Move `OUTLINE` menu to `Secondary Side Bar`. + +## XDebug Config + +`launch.json` file must be set on a project basic. + +Click on the activity bar +> Run and Debug (Ctrl+Shift+D) + +Click +> To customize Run and Debug `create a launch.json file`. + +Copy / Paste following configuration. + +Click `RUN AND DEBUG` dropdown menu +Select +> Listen for XDebug on Docker App + +`.vscode/launch.json` + +```json +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for XDebug on Docker App", + "type": "php", + "request": "launch", + "hostname": "0.0.0.0", + "port": 9003, + "pathMappings": { + "/usr/src/app": "${workspaceFolder}" + }, + "xdebugSettings": { + "max_data": 65535, + "show_hidden": 1, + "max_children": 100, + "max_depth": 5 + } + }, + { + "name": "Listen for local XDebug", + "type": "php", + "request": "launch", + "port": 9003 + }, + { + "name": "Launch currently open script", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 0, + "runtimeArgs": [ + "-dxdebug.start_with_request=yes" + ], + "env": { + "XDEBUG_MODE": "debug,develop", + "XDEBUG_CONFIG": "client_port=${port}" + } + }, + { + "name": "Launch Built-in web server", + "type": "php", + "request": "launch", + "runtimeArgs": [ + "-dxdebug.mode=debug", + "-dxdebug.start_with_request=yes", + "-S", + "localhost:0" + ], + "program": "", + "cwd": "${workspaceRoot}", + "port": 9003, + "serverReadyAction": { + "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", + "uriFormat": "http://localhost:%s", + "action": "openExternally" + } + } + ] +} +``` + diff --git a/ide/config_jetbrains_gitignore.sh b/ide/config_jetbrains_gitignore.sh new file mode 100755 index 0000000..7fb6410 --- /dev/null +++ b/ide/config_jetbrains_gitignore.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config jetbrains gitignore +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_secondary 'Config Jetbrain global gitignore' + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +# create gitignore file +echo_info 'echo "/.idea/" > ~/.gitignore_global' +echo "/.idea/" > ~/.gitignore_global + +# exclude some temp files +echo_info 'echo "/.attach_pid*" >> ~/.gitignore_global' +echo "/.attach_pid*" >> ~/.gitignore_global + +# config global gitignore +echo_info 'git config --global core.excludesfile ~/.gitignore_global' +git config --global core.excludesfile ~/.gitignore_global + diff --git a/ide/config_phpstorm.sh b/ide/config_phpstorm.sh new file mode 100755 index 0000000..22055a5 --- /dev/null +++ b/ide/config_phpstorm.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config phpstorm +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +CONFIG_DIR="${CURDIR}/../config" + +#-------------------------------------------------- + +DEFAULT_VERSION=2024.1 +VALID_VERSIONS=(2016.3 2017.3 2018.3 2019.3 2020.3 2021.3 2022.3 2023.3 2024.1) + +#-------------------------------------------------- + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install php' + echo_label 12 'usage'; echo_primary "${0} -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi +# check valid version +INSTALL=false +for VALID_VERSION in "${VALID_VERSIONS[@]}"; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done +if [ "${INSTALL}" != true ]; then + echo_error "\"$(basename "${0}")\" invalid version \"${VERSION}\"" + exit 1 +fi + +#-------------------------------------------------- + +alert_secondary "Config PHPStorm${VERSION}" + +echo_info 'mkdir ~/.config/JetBrains' +mkdir ~/.config/JetBrains + +# remove previous config +echo_info "rm -rf ~/.config/JetBrains/PhpStorm*" +rm -rf ~/.config/JetBrains/PhpStorm* + +# config phpstorm +echo_info "cp -Rfv \"${CONFIG_DIR}/home/.config/JetBrains/PhpStorm/\" \"${HOME}/.config/JetBrains/PhpStorm${VERSION}\"" +cp -Rfv "${CONFIG_DIR}/home/.config/JetBrains/PhpStorm/" "${HOME}/.config/JetBrains/PhpStorm${VERSION}" + +#-------------------------------------------------- + +# config phpstorm +# https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit" +echo_info "sudo bash -c 'echo \"fs.inotify.max_user_watches = 524288\" > /etc/sysctl.d/idea.conf'" +sudo bash -c 'echo "fs.inotify.max_user_watches = 524288" > /etc/sysctl.d/idea.conf' + +echo_info 'sudo sysctl -p --system' +sudo sysctl -p --system + +#-------------------------------------------------- + diff --git a/ide/config_pycharm-community.sh b/ide/config_pycharm-community.sh new file mode 100755 index 0000000..c0543b3 --- /dev/null +++ b/ide/config_pycharm-community.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config pycharm +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +CONFIG_DIR="${CURDIR}/../config" + +DEFAULT_VERSION=2023.3 + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -d (development) -p (production) -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Config PyCharmCE' + echo_label 12 'usage'; echo_primary "${0} -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi + +alert_secondary "Config PyCharmCE${VERSION}" + +echo_info 'mkdir ~/.config/JetBrains' +mkdir ~/.config/JetBrains + +# remove previous config +echo_info "rm -rf ~/.config/JetBrains/PyCharmCE*" +rm -rf ~/.config/JetBrains/PyCharmCE* + +# config pycharm +echo_info "cp -Rfv \"${CONFIG_DIR}/home/.config/JetBrains/PyCharmCE/\" \"${HOME}/.config/JetBrains/PyCharmCE${VERSION}\"" +cp -Rfv "${CONFIG_DIR}/home/.config/JetBrains/PyCharmCE/" "${HOME}/.config/JetBrains/PyCharmCE${VERSION}" diff --git a/ide/config_sublime-text.sh b/ide/config_sublime-text.sh new file mode 100755 index 0000000..16b4c5e --- /dev/null +++ b/ide/config_sublime-text.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config sublime text +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +CONFIG_DIR="${CURDIR}/../config" + +alert_secondary 'Config Sublime Text' + +# remove previous config +echo_info 'rm -rf ~/.config/sublime-text' +rm -rf ~/.config/sublime-text + +# config sublime text +echo_info "cp -Rfv \"${CONFIG_DIR}/home/.config/sublime-text\" ~/.config" +cp -Rfv "${CONFIG_DIR}/home/.config/sublime-text" ~/.config + diff --git a/ide/config_visualstudiocode.sh b/ide/config_visualstudiocode.sh new file mode 100755 index 0000000..6a62377 --- /dev/null +++ b/ide/config_visualstudiocode.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config visual studio code +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +CONFIG_DIR="${CURDIR}/../config" + +alert_secondary 'Config Visual Studio Code' + +# remove previous config +echo_info 'rm -rf ~/.config/Code' +rm -rf ~/.config/Code + +# config visual studio code +echo_info "cp -Rfv \"${CONFIG_DIR}/home/.config/Code\" ~/.config" +cp -Rfv "${CONFIG_DIR}/home/.config/Code" ~/.config + diff --git a/ide/install_atom.sh b/ide/install_atom.sh new file mode 100755 index 0000000..16b8506 --- /dev/null +++ b/ide/install_atom.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Atom +# * A hackable text editor for the 21st Century. +# * +# * @category ide +# * @link https://atom.io +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install atom' + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +echo_info 'sudo snap install atom --classic' +sudo snap install atom --classic + +# create desktop shortcut +echo_info "ln -s /var/lib/snapd/desktop/applications/atom_atom.desktop \"$(xdg-user-dir DESKTOP)\"" +ln -s /var/lib/snapd/desktop/applications/atom_atom.desktop "$(xdg-user-dir DESKTOP)" diff --git a/ide/install_emacs.sh b/ide/install_emacs.sh new file mode 100755 index 0000000..73bb4af --- /dev/null +++ b/ide/install_emacs.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * emacs +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install emacs' + +echo_info 'sudo apt-get install --assume-yes emacs' +sudo apt-get install --assume-yes emacs diff --git a/ide/install_ghex.sh b/ide/install_ghex.sh new file mode 100755 index 0000000..15ccd43 --- /dev/null +++ b/ide/install_ghex.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ghex +# * +# * ghex - A GNOME Hex Editor +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes ghex' +sudo apt-get install --assume-yes ghex diff --git a/ide/install_ide-url-handler.sh b/ide/install_ide-url-handler.sh new file mode 100755 index 0000000..498bc4c --- /dev/null +++ b/ide/install_ide-url-handler.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ide-url-handler +# * +# * @link https://github.com/TangoMan75/ide-url-handler +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install TangoMan75 ide-url-handler' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "sudo sh -c \"\$(wget -q https://raw.githubusercontent.com/TangoMan75/ide-url-handler/master/install.sh -O -) install\"" +sudo sh -c "$(wget -q https://raw.githubusercontent.com/TangoMan75/ide-url-handler/master/install.sh -O -) install" diff --git a/ide/install_jetbrains-toolbox.sh b/ide/install_jetbrains-toolbox.sh new file mode 100755 index 0000000..7984c43 --- /dev/null +++ b/ide/install_jetbrains-toolbox.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * jetbrains-toolbox +# * +# * @category ide +# * @link https://www.jetbrains.com/toolbox-app +# * @link https://www.jetbrains.com/help/phpstorm/installation-guide.html +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +APP_NAME=jetbrains-toolbox +VERSION=1.27.3.14493 +FILENAME=${APP_NAME}-${VERSION} +URL=https://download-cdn.jetbrains.com/toolbox/${FILENAME}.tar.gz + +alert_primary "Install ${APP_NAME} v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'sudo apt-get update --assume-yes' +sudo apt-get update --assume-yes + +echo_info 'sudo apt-get install --assume-yes libfuse2' +sudo apt-get install --assume-yes libfuse2 + +echo_info "wget \"${URL}\"" +wget "${URL}" + +# extract archive +echo_info "tar xvzf ${FILENAME}.tar.gz" +tar xvzf ${FILENAME}.tar.gz + +# install binary globally +echo_info "sudo mv -fv ${FILENAME}/${APP_NAME} /usr/local/bin/${APP_NAME}" +sudo mv -fv ${FILENAME}/${APP_NAME} /usr/local/bin/${APP_NAME} + +echo_info "rm -rf \"${FILENAME}\"" +rm -rf "${FILENAME}" + +echo_info "rm -f \"${FILENAME}.tar.gz\"" +rm -f "${FILENAME}.tar.gz" + +# # create desktop shortcut +# echo_info 'ln -s ~/.local/share/applications/jetbrains-toolbox.desktop "$(xdg-user-dir DESKTOP)"/' +# ln -s ~/.local/share/applications/jetbrains-toolbox.desktop "$(xdg-user-dir DESKTOP)"/ + +# # create desktop shortcut +# cat > "$(xdg-user-dir DESKTOP)"/jetbrains-toolbox.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * phpstorm +# * PHP IDE +# * +# * @category ide +# * @link https://sales.jetbrains.com/hc/en-gb/articles/207240845-What-is-a-perpetual-fallback-license +# * @link https://www.jetbrains.com/phpstorm/download/other.html +# * @note You will need php installed on local machine in order to use debugger +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +#-------------------------------------------------- + +DEFAULT_VERSION=2024.1.3 +VALID_VERSIONS=(2016.3.4 2017.3.7 2018.3.6 2019.3.4 2020.3.3 2021.3.3 2022.3.3 2023.1.6 2023.2.6 2023.3.7 2024.1.3) + +#-------------------------------------------------- + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install PHPStorm' + echo_label 12 'usage'; echo_primary "${0} -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi +# check valid version +INSTALL=false +for VALID_VERSION in "${VALID_VERSIONS[@]}"; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done +if [ "${INSTALL}" != true ]; then + echo_error "\"$(basename "${0}")\" invalid version \"${VERSION}\"" + exit 1 +fi + +#-------------------------------------------------- + +FILENAME="PhpStorm-${VERSION}.tar.gz" +URL="https://download.jetbrains.com/webide/${FILENAME}" + +#-------------------------------------------------- + +alert_primary "Install PHPStorm v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"${URL}\"" +wget "${URL}" + +# extract archive +echo_info "tar xvzf \"${FILENAME}\"" +tar xvzf "${FILENAME}" + +# Get folder name eg: PhpStorm-213.7172.28 +FOLDER_NAME="$(basename "$(find . -maxdepth 1 -type d -name 'PhpStorm-*')")" + +if [ -z "${FOLDER_NAME}" ]; then + echo_error "folder not found"; + exit 1 +fi + +# Get install directory eg: ~/.local/share/JetBrains/Toolbox/apps/PhpStorm/ch-0/213.7172.28/ +INSTALL_DIRECTORY=~/.local/share/JetBrains/Toolbox/apps/PhpStorm/ch-0/$(echo "${FOLDER_NAME}" | cut -d '-' -f2) + +# create parent folder +echo_info "mkdir -p \"$(dirname "${INSTALL_DIRECTORY}")\"" +mkdir -p "$(dirname "${INSTALL_DIRECTORY}")" + +# move folder +echo_info "mv -fv \"${FOLDER_NAME}\" \"${INSTALL_DIRECTORY}\"" +mv -fv "${FOLDER_NAME}" "${INSTALL_DIRECTORY}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +#-------------------------------------------------- + +# create desktop shortcut +cat > "$(xdg-user-dir DESKTOP)"/phpstorm_phpstorm.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * phpstorm +# * PHP IDE +# * +# * @category ide +# * @link https://www.jetbrains.com/fr-fr/phpstorm/nextversion/ +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +#-------------------------------------------------- + +DEFAULT_VERSION=233.11799.55 +VALID_VERSIONS=(233.11799.55 233.11799.172) + +#-------------------------------------------------- + +if [ "$#" -gt 2 ]; then + echo_error "too many arguments (${#})" + echo_label 3 'usage'; echo_primary "$(basename "${0}") -v [version] -h (help)" + exit 1 +fi +OPTIND=0 +while getopts :v:h OPTION; do + case "${OPTION}" in + v) VERSION="${OPTARG}";; + h) echo_label 12 'description'; echo_primary 'Install PHPStorm EAP' + echo_label 12 'usage'; echo_primary "${0} -v [version] -h (help)" + exit 0;; + :) echo_error "\"${OPTARG}\" requires value" + exit 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +if [ -z "${VERSION}" ]; then + VERSION="${DEFAULT_VERSION}" +fi +# check valid version +INSTALL=false +for VALID_VERSION in "${VALID_VERSIONS[@]}"; do + if [ "${VERSION}" = "${VALID_VERSION}" ]; then + INSTALL=true + fi +done +if [ "${INSTALL}" != true ]; then + echo_error "\"$(basename "${0}")\" invalid version \"${VERSION}\"" + exit 1 +fi + +#-------------------------------------------------- + +FILENAME="PhpStorm-${VERSION}.tar.gz" +URL="https://download-cdn.jetbrains.com/webide/PhpStorm-${VERSION}.tar.gz" + +#-------------------------------------------------- + +alert_primary "Install PHPStorm EAP v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"${URL}\"" +wget "${URL}" + +# extract archive +echo_info "tar xvzf \"${FILENAME}\"" +tar xvzf "${FILENAME}" + +# Get folder name eg: PhpStorm-213.7172.28 +FOLDER_NAME="$(basename "$(find . -maxdepth 1 -type d -name 'PhpStorm-*')")" + +if [ -z "${FOLDER_NAME}" ]; then + echo_error "folder not found"; + exit 1 +fi + +# Get install directory eg: ~/.local/share/JetBrains/Toolbox/apps/PhpStorm/ch-0/213.7172.28/ +INSTALL_DIRECTORY=~/.local/share/JetBrains/Toolbox/apps/PhpStorm/ch-0/$(echo "${FOLDER_NAME}" | cut -d '-' -f2) + +# create parent folder +echo_info "mkdir -p \"$(dirname "${INSTALL_DIRECTORY}")\"" +mkdir -p "$(dirname "${INSTALL_DIRECTORY}")" + +# move folder +echo_info "mv -fv \"${FOLDER_NAME}\" \"${INSTALL_DIRECTORY}\"" +mv -fv "${FOLDER_NAME}" "${INSTALL_DIRECTORY}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +#-------------------------------------------------- + +# create desktop shortcut +cat > "$(xdg-user-dir DESKTOP)"/phpstorm_phpstorm.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * phpstorm +# * PHP IDE +# * +# * @category ide +# * @link https://www.jetbrains.com/phpstorm/features +# * @note You will need php installed on local machine in order to use debugger +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install PHPStorm' + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +echo_info 'sudo snap install phpstorm --classic' +sudo snap install phpstorm --classic + +# if snap showing "snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks" +# sudo snap refresh core --beta + +# create desktop shortcut +echo_info "ln -s /var/lib/snapd/desktop/applications/phpstorm_phpstorm.desktop \"$(xdg-user-dir DESKTOP)\"" +ln -s /var/lib/snapd/desktop/applications/phpstorm_phpstorm.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/ide/install_pycharm-community.sh b/ide/install_pycharm-community.sh new file mode 100755 index 0000000..b4e8537 --- /dev/null +++ b/ide/install_pycharm-community.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * pycharm-community +# * Python IDE +# * +# * @category ide +# * @link https://www.jetbrains.com/pycharm/features +# * @link https://www.jetbrains.com/fr-fr/edu-products/download/other-PCE.html +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install pycharm-community' + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +echo_info 'sudo snap install pycharm-community --classic' +sudo snap install pycharm-community --classic + +# create desktop shortcut +echo_info "ln -s /var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop \"$(xdg-user-dir DESKTOP)\"" +ln -s /var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop "$(xdg-user-dir DESKTOP)" diff --git a/ide/install_sublime-text.sh b/ide/install_sublime-text.sh new file mode 100755 index 0000000..7437e3e --- /dev/null +++ b/ide/install_sublime-text.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * sublime-text +# * +# * text editor +# * +# * Find current scope in console: +# * ```python +# * view.scope_name(view.sel()[0].begin()) +# * ``` +# * +# * @link https://gist.github.com/J2TeaM/a54bafb082f90c0f20c9 +# * @link https://www.sublimetext.com/docs/scope_naming.html +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Sublime Text' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +# install the gpg key +# TODO: Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). +echo_info 'wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -' +wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - + +# ensure apt is set up to work with https sources: +echo_info 'sudo apt-get install apt-transport-https' +sudo apt-get install apt-transport-https + +# stable channel +# sudo add-apt-repository --yes -u 'https://download.sublimetext.com/ apt/stable' +echo_info 'echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list' +echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list + +# update apt sources +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes apt-transport-https' +sudo apt-get install --assume-yes apt-transport-https + +echo_info 'sudo apt-get install --assume-yes sublime-text' +sudo apt-get install --assume-yes sublime-text + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/sublime_text.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/sublime_text.desktop "$(xdg-user-dir DESKTOP)" diff --git a/ide/install_vim.sh b/ide/install_vim.sh new file mode 100755 index 0000000..9d52a06 --- /dev/null +++ b/ide/install_vim.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * vim +# * terminal text editor +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install vim' + +echo_info 'sudo apt-get install --assume-yes vim' +sudo apt-get install --assume-yes vim diff --git a/ide/install_visualstudiocode.sh b/ide/install_visualstudiocode.sh new file mode 100755 index 0000000..079ec84 --- /dev/null +++ b/ide/install_visualstudiocode.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Visual Studio Code +# * JavaScript IDE +# * +# * outline > secondary side bar +# * +# * @category ide +# * @link https://code.visualstudio.com/download +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Visual Studio Code' + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +echo_info 'sudo snap install code --classic' +sudo snap install code --classic + +echo_info "ln -s /var/lib/snapd/desktop/applications/code_code.desktop \"$(xdg-user-dir DESKTOP)\"" +ln -s /var/lib/snapd/desktop/applications/code_code.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/ide/install_visualstudiocode_extensions.sh b/ide/install_visualstudiocode_extensions.sh new file mode 100755 index 0000000..00284f7 --- /dev/null +++ b/ide/install_visualstudiocode_extensions.sh @@ -0,0 +1,116 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Visual Studio Code Extensions +# * +# * @category ide +# * @link https://code.visualstudio.com/download +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Visual Studio Code Extensions' + +if [ ! -x "$(command -v code)" ]; then + echo_error "\"$(basename "${0}")\" requires vscode to install, try: 'sudo snap install code --classic'" + exit 1 +fi + +echo_info 'code --install-extension bmewburn.vscode-intelephense-client' +code --install-extension bmewburn.vscode-intelephense-client + +# echo_info 'code --install-extension christian-kohler.path-intellisense' +# code --install-extension christian-kohler.path-intellisense + +echo_info 'code --install-extension eamodio.gitlens' +code --install-extension eamodio.gitlens + +# echo_info 'code --install-extension esbenp.prettier-vscode' +# code --install-extension esbenp.prettier-vscode + +# echo_info 'code --install-extension fbclol.volt-phalcon-language' +# code --install-extension fbclol.volt-phalcon-language + +# echo_info 'code --install-extension formulahendry.code-runner' +# code --install-extension formulahendry.code-runner + +# echo_info 'code --install-extension junstyle.php-cs-fixer' +# code --install-extension junstyle.php-cs-fixer + +# echo_info 'code --install-extension kokororin.vscode-phpfmt' +# code --install-extension kokororin.vscode-phpfmt + +echo_info 'code --install-extension lea21st.vscode-sql-formatter' +code --install-extension lea21st.vscode-sql-formatter + +echo_info 'code --install-extension marabesi.php-import-checker' +code --install-extension marabesi.php-import-checker + +echo_info 'code --install-extension MehediDracula.php-constructor' +code --install-extension MehediDracula.php-constructor + +echo_info 'code --install-extension MehediDracula.php-namespace-resolver' +code --install-extension MehediDracula.php-namespace-resolver + +# echo_info 'code --install-extension ms-azuretools.vscode-docker' +# code --install-extension ms-azuretools.vscode-docker + +echo_info 'code --install-extension ms-ossdata.vscode-postgresql' +code --install-extension ms-ossdata.vscode-postgresql + +# echo_info 'code --install-extension ms-vscode-remote.remote-containers' +# code --install-extension ms-vscode-remote.remote-containers + +echo_info 'code --install-extension ms-vscode.makefile-tools' +code --install-extension ms-vscode.makefile-tools + +# echo_info 'code --install-extension ms-vsliveshare.vsliveshare' +# code --install-extension ms-vsliveshare.vsliveshare + +echo_info 'code --install-extension muath-ye.composer-Intelephense' +code --install-extension muath-ye.composer-Intelephense + +echo_info 'code --install-extension neilbrayfield.php-docblocker' +code --install-extension neilbrayfield.php-docblocker + +# echo_info 'code --install-extension nivin-studio.phalcon-goto-view' +# code --install-extension nivin-studio.phalcon-goto-view + +# echo_info 'code --install-extension rifi2k.format-html-in-php' +# code --install-extension rifi2k.format-html-in-php + +echo_info 'code --install-extension sourcegraph.cody-ai' +code --install-extension sourcegraph.cody-ai + +echo_info 'code --install-extension streetsidesoftware.code-spell-checker' +code --install-extension streetsidesoftware.code-spell-checker + +# echo_info 'code --install-extension streetsidesoftware.code-spell-checker-french' +# code --install-extension streetsidesoftware.code-spell-checker-french + +# echo_info 'code --install-extension valeryanm.vscode-phpsab' +# code --install-extension valeryanm.vscode-phpsab + +echo_info 'code --install-extension waderyan.gitblame' +code --install-extension waderyan.gitblame + +echo_info 'code --install-extension xdebug.php-debug' +code --install-extension xdebug.php-debug + +echo_info 'code --install-extension xdebug.php-pack' +code --install-extension xdebug.php-pack + +# echo_info 'code --install-extension zobo.php-intellisense' +# code --install-extension zobo.php-intellisense + diff --git a/ide/install_webstorm.sh b/ide/install_webstorm.sh new file mode 100755 index 0000000..2d0bab3 --- /dev/null +++ b/ide/install_webstorm.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * webstorm +# * Python IDE +# * +# * @category ide +# * @link https://www.jetbrains.com/webstorm/features +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +echo_info 'sudo snap install webstorm --classic' +sudo snap install webstorm --classic + +# create desktop shortcut +echo_info "ln -s /var/lib/snapd/desktop/applications/webstorm_webstorm.desktop \"$(xdg-user-dir DESKTOP)\"" +ln -s /var/lib/snapd/desktop/applications/webstorm_webstorm.desktop "$(xdg-user-dir DESKTOP)" diff --git a/ide/remove_jetbrains_toolbox.sh b/ide/remove_jetbrains_toolbox.sh new file mode 100755 index 0000000..de77d21 --- /dev/null +++ b/ide/remove_jetbrains_toolbox.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove jetbrains-toolbox +# * +# * @category ide +# * @link https://www.jetbrains.com/toolbox-app +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Remove JetBrains Toolbox' + +# remove desktop link +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/jetbrains-toolbox.desktop" +rm "$(xdg-user-dir DESKTOP)"/jetbrains-toolbox.desktop + +# remove binary +echo_info 'sudo rm -rf /usr/local/bin/jetbrains-toolbox' +sudo rm -rf /usr/local/bin/jetbrains-toolbox + +echo_info 'sudo rm -rf ~/.local/share/JetBrains/Toolbox' +sudo rm -rf ~/.local/share/JetBrains/Toolbox + diff --git a/ide/remove_phpstorm.sh b/ide/remove_phpstorm.sh new file mode 100755 index 0000000..fd679e0 --- /dev/null +++ b/ide/remove_phpstorm.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove phpstorm +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary "Remove PHPStorm" + +# remove desktop link +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/phpstorm_phpstorm.desktop" +rm "$(xdg-user-dir DESKTOP)"/phpstorm_phpstorm.desktop + +# remove phpstorm config +echo_info "rm -rf ~/.config/JetBrains/PhpStorm*" +rm -rf ~/.config/JetBrains/PhpStorm* + +echo_info 'rm -rf ~/.local/share/JetBrains/Toolbox/apps/PhpStorm' +rm -rf ~/.local/share/JetBrains/Toolbox/apps/PhpStorm + +echo_info 'sudo rm -f /etc/sysctl.d/idea.conf' +sudo rm -f /etc/sysctl.d/idea.conf + +# remove user id +echo_info 'rm ~/.java/.userPrefs/prefs.xml' +rm ~/.java/.userPrefs/prefs.xml + +# remove java prefs +echo_info 'rm -rf ~/.java/.userPrefs/jetbrains' +rm -rf ~/.java/.userPrefs/jetbrains + +# remove .profile configuration if any +echo_info "sed -i \"/^PATH=.*PhpStorm.*/d\" ~/.profile" +sed -i "/^PATH=.*PhpStorm.*/d" ~/.profile + +# remove global install if any +echo_info 'sudo rm -f /usr/bin/phpstorm' +sudo rm -f /usr/bin/phpstorm diff --git a/ide/remove_phpstorm_snap.sh b/ide/remove_phpstorm_snap.sh new file mode 100755 index 0000000..1731544 --- /dev/null +++ b/ide/remove_phpstorm_snap.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove phpstorm +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +alert_primary 'Remove PHPStorm with snap' + +# remove phpstorm with snap +echo_info 'sudo snap remove phpstorm' +sudo snap remove phpstorm + +# clear snap cache +echo_info 'sudo rm -f /var/lib/snapd/cache/*' +sudo rm -f /var/lib/snapd/cache/* + +# remove phpstorm from profiles +echo_info 'sudo rm -f /var/lib/snapd/apparmor/profiles/*.phpstorm' +sudo rm -f /var/lib/snapd/apparmor/profiles/*.phpstorm + +# remove phpstorm from applications +echo_info 'sudo rm -f /var/lib/snapd/desktop/applications/phpstorm*' +sudo rm -f /var/lib/snapd/desktop/applications/phpstorm* + +# remove phpstorm from snap +echo_info 'sudo rm -f /var/lib/snapd/sequence/phpstorm*' +sudo rm -f /var/lib/snapd/sequence/phpstorm* + +# remove phpstorm from snap +echo_info 'sudo rm -f /var/lib/snapd/snap/phpstorm*' +sudo rm -f /var/lib/snapd/snap/phpstorm* + +# remove all accounts from snap +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/* + +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/* + +# remove snapshots +echo_info 'sudo rm -f /var/lib/snapd/snapshots/*' +sudo rm -f /var/lib/snapd/snapshots/* + +# remove old snaps +LANG=C snap list --all | awk '/disabled/{print $1, $3}' | +while read -r SNAPNAME revision; do + snap remove "${SNAPNAME}" --revision="${revision}" +done + +# list upgradable snaps +echo_info 'sudo snap refresh --list' +sudo snap refresh --list + diff --git a/ide/remove_pycharm.sh b/ide/remove_pycharm.sh new file mode 100755 index 0000000..a87210a --- /dev/null +++ b/ide/remove_pycharm.sh @@ -0,0 +1,89 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove pycharm-community +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +alert_primary 'Uninstall pycharm-community' + +# remove pycharm-community with snap +echo_info 'sudo snap remove pycharm-community' +sudo snap remove pycharm-community + +# remove pycharm config +echo_info "rm -rf ~/.config/JetBrains/PyCharm*" +rm -rf ~/.config/JetBrains/PyCharm* + +echo_info 'rm -rf ~/.local/share/JetBrains/Toolbox/apps/PyCharm' +rm -rf ~/.local/share/JetBrains/Toolbox/apps/PyCharm + +echo_info 'sudo rm -f /etc/sysctl.d/idea.conf' +sudo rm -f /etc/sysctl.d/idea.conf + +#-------------------------------------------------- + +# remove desktop link +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/pycharm-community_pycharm-community.desktop" +rm "$(xdg-user-dir DESKTOP)"/pycharm-community_pycharm-community.desktop + +# clear snap cache +echo_info 'sudo rm -f /var/lib/snapd/cache/*' +sudo rm -f /var/lib/snapd/cache/* + +# remove pycharm from profiles +echo_info 'sudo rm -f /var/lib/snapd/apparmor/profiles/*.pycharm' +sudo rm -f /var/lib/snapd/apparmor/profiles/*.pycharm + +# remove pycharm from applications +echo_info 'sudo rm -f /var/lib/snapd/desktop/applications/pycharm*' +sudo rm -f /var/lib/snapd/desktop/applications/pycharm* + +# remove pycharm from snap +echo_info 'sudo rm -f /var/lib/snapd/sequence/pycharm*' +sudo rm -f /var/lib/snapd/sequence/pycharm* + +# remove pycharm from snap +echo_info 'sudo rm -f /var/lib/snapd/snap/pycharm*' +sudo rm -f /var/lib/snapd/snap/pycharm* + +# remove all accounts from snap +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/* + +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/* + +# remove snapshots +echo_info 'sudo rm -f /var/lib/snapd/snapshots/*' +sudo rm -f /var/lib/snapd/snapshots/* + +# remove old snaps +LANG=C snap list --all | awk '/disabled/{print $1, $3}' | +while read -r SNAPNAME revision; do + snap remove "${SNAPNAME}" --revision="${revision}" +done + +# list upgradable snaps +echo_info 'sudo snap refresh --list' +sudo snap refresh --list + diff --git a/ide/remove_sublime-text.sh b/ide/remove_sublime-text.sh new file mode 100755 index 0000000..e2a17a8 --- /dev/null +++ b/ide/remove_sublime-text.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove sublime-text +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# remove sublime-text +echo_info 'sudo apt-get remove --assume-yes sublime-text' +sudo apt-get remove --assume-yes sublime-text + +# remove config +echo_info 'rm -rf ~/.config/sublime-text-3' +rm -rf ~/.config/sublime-text-3 + +# remove desktop shortcut +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/sublime_text.desktop" +rm "$(xdg-user-dir DESKTOP)"/sublime_text.desktop + diff --git a/ide/remove_visualstudiocode.sh b/ide/remove_visualstudiocode.sh new file mode 100755 index 0000000..99c8e82 --- /dev/null +++ b/ide/remove_visualstudiocode.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove visual studio code +# * +# * @category ide +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +# remove code with snap +echo_info 'sudo snap remove code' +sudo snap remove code + +# remove desktop link +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/code_code.desktop" +rm "$(xdg-user-dir DESKTOP)"/code_code.desktop + +# remove config +echo_info 'sudo rm -rf ~/.config/Code' +sudo rm -rf ~/.config/Code + +# remove extensions +echo_info 'sudo rm -rf ~/.vscode' +sudo rm -rf ~/.vscode + +# remove old snaps +LANG=C snap list --all | awk '/disabled/{print $1, $3}' | +while read -r SNAPNAME revision; do + snap remove "${SNAPNAME}" --revision="${revision}" +done + +# list upgradable snaps +echo_info 'sudo snap refresh --list' +sudo snap refresh --list diff --git a/init_submodules.sh b/init_submodules.sh new file mode 100755 index 0000000..d87e9cd --- /dev/null +++ b/init_submodules.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * init submodules +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +echo_info() { printf '%b%b\033[0m' '\033[95m' "${*}"; } +echo_error() { printf '%berror:\t%b\033[0m' '\033[31m' "${*}"; } + +## Initialise git submodules +submodules() { + # get full parent folder name + if [ -z "$1" ]; then + set -- "$(dirname "$(realpath "$0")")" + else + set -- "$(dirname "$(realpath "$1")")" + fi + + if [ ! -d "$1" ]; then + echo_error "\"$1\" is not a valid directory.\n" + return 1 + fi + + if [ ! -f "$1/.gitmodules" ]; then + echo_error '".gitmodules" not found\n' + return 1 + fi + + if [ ! -x "$(command -v git)" ] || [ ! -d "$1/.git" ]; then + # wget should be available by default on Ubuntu + if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'\n" + return 1 + fi + + # unzip should be available by default on Ubuntu + if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'\n" + return 1 + fi + + # parse .gitmodules + grep -Eo 'https://.+' "$1/.gitmodules" | while read -r url; do + repository=$(echo "${url}" | sed -E 's/https:\/\///' | sed -E 's/\.git$//' | tr ':' '/' | cut -d/ -f3) + # do not update existing submodule + if [ -n "$(ls -A "${repository}" 2>/dev/null)" ]; then + continue + fi + + server=$(echo "${url}" | sed -E 's/https:\/\///' | sed -E 's/\.git$//' | tr ':' '/' | cut -d/ -f1) + case "${server}" in + github.com) + echo_info "wget -q \"${url}/archive/refs/heads/master.zip\"\n" + wget -q "${url}/archive/refs/heads/master.zip" + ;; + gitlab.com) + echo_info "wget -q \"${url}/-/archive/master/master.zip\"\n" + wget -q "${url}/-/archive/master/master.zip" + ;; + bitbucket.org) + echo_info "wget -q \"${url}/get/master.zip\"\n" + wget -q "${url}/get/master.zip" + ;; + *) return 1;; + esac + + echo_info "unzip -qq \"$1/master.zip\"\n" + unzip -qq "$1/master.zip" + + echo_info "rm \"$1/master.zip\"\n" + rm "$1/master.zip" + + echo_info "mv \"$1/${repository}-\"* \"$1/${repository}\"\n" + mv "$1/${repository}-"* "$1/${repository}" + done + + return 0 + fi + + echo_info 'git submodule update --init --recursive\n' + git submodule update --init --recursive +} + +submodules diff --git a/install_template.sh b/install_template.sh new file mode 100755 index 0000000..410fc37 --- /dev/null +++ b/install_template.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * template +# * +# * @category category +# * @link https://github.com/TangoMan75/template +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +BASENAME=template +FILENAME=${BASENAME}_${VERSION}_$(uname -s)_$(uname -m).tar.gz +REPOSITORY=TangoMan75/template +VERSION=$(get_latest_release ${REPOSITORY}) +if [ -z "${VERSION}" ]; then + VERSION=0.25.18 +fi + +alert_primary "Install ${REPOSITORY} v${VERSION}" + +# download latest version from github with wget +echo_info "wget \"https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}\"" +wget "https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}" + +# download latest version from github with curl +echo_info "curl -L \"https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}\" -o \"${BASENAME}.tar.gz\"" +curl -L "https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}" -o "${BASENAME}.tar.gz" + +# extract archive to /usr/bin +echo_info "sudo tar -C /usr/bin -xvzf \"${BASENAME}\".tar.gz \"${BASENAME}\"" +sudo tar -C /usr/bin -xvzf ${BASENAME}.tar.gz "${BASENAME}" + +# set executable permissions +echo_info "sudo chmod uga+x /usr/bin/${BASENAME}" +sudo chmod uga+x /usr/bin/${BASENAME} + +# clean +echo_info "rm -f ${BASENAME}.tar.gz" +rm -f ${BASENAME}.tar.gz + +# update system +echo_info 'sync' +sync + diff --git a/kali/config_apt_sources_list.sh b/kali/config_apt_sources_list.sh new file mode 100755 index 0000000..5e93400 --- /dev/null +++ b/kali/config_apt_sources_list.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config apt repositories +# * +# * @category kali +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ "$(lsb_release -is 2>/dev/null)" = 'Kali' ]; then + echo_info "sudo sh -c \"echo 'deb http://http.kali.org/kali kali-rolling main non-free contrib'>>/etc/apt/sources.list\"" + sudo sh -c "echo 'deb http://http.kali.org/kali kali-rolling main non-free contrib'>>/etc/apt/sources.list" + + echo_info 'sudo apt-get update' + sudo apt-get update +else + echo_error 'wrong system' +fi diff --git a/kali/config_gnome_dconf.sh b/kali/config_gnome_dconf.sh new file mode 100755 index 0000000..0d04df5 --- /dev/null +++ b/kali/config_gnome_dconf.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config org_gnome +# * +# * @category kali +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_secondary 'Config dconf' + +if [ ! -x "$(command -v dconf)" ]; then + echo_error "\"$(basename "${0}")\" requires dconf, try: 'sudo apt-get install -y dconf-editor'" + exit 1 +fi + +CONFIG_DIR="${CURDIR}/../config" + +if [ "$(lsb_release -is 2>/dev/null)" = 'Kali' ]; then + echo_info "dconf load /org/gnome/ < \"${CONFIG_DIR}/kali/dconf/org_gnome.conf\"" + dconf load /org/gnome/ < "${CONFIG_DIR}/kali/dconf/org_gnome.conf" +else + echo_error 'wrong system version' +fi diff --git a/kali/init_kali.sh b/kali/init_kali.sh new file mode 100755 index 0000000..4fecb16 --- /dev/null +++ b/kali/init_kali.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * check malware +# * +# * @category kali +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo /usr/sbin/chkrootkit' +sudo /usr/sbin/chkrootkit + +echo_info 'sudo rkhunter -c' +sudo rkhunter -c + +# update Metasploit +echo_info 'sudo apt-get install --assume-yes metasploit-framework' +sudo apt-get install --assume-yes metasploit-framework diff --git a/multimedia/install_amberol.sh b/multimedia/install_amberol.sh new file mode 100755 index 0000000..fde2ef6 --- /dev/null +++ b/multimedia/install_amberol.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * amberol +# * multimedia player +# * +# * @category multimedia +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Amberol' + +echo_info 'sudo apt-get install --assume-yes amberol' +sudo apt-get install --assume-yes amberol + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/io.bassi.Amberol.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/io.bassi.Amberol.desktop "$(xdg-user-dir DESKTOP)" diff --git a/multimedia/install_audacity.sh b/multimedia/install_audacity.sh new file mode 100755 index 0000000..4ad05d4 --- /dev/null +++ b/multimedia/install_audacity.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * audacity +# * +# * @category multimedia +# * @note Shift + play button to loop selection +# * @note Stop following cursor : Edit > Preferences > Tracks > Auto-scroll if head unpinned (uncheck) +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install audacity' + +echo_info 'sudo apt-get install --assume-yes audacity' +sudo apt-get install --assume-yes audacity + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/audacity.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/audacity.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/multimedia/install_ffmpeg.sh b/multimedia/install_ffmpeg.sh new file mode 100755 index 0000000..5a354c9 --- /dev/null +++ b/multimedia/install_ffmpeg.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ffmpeg +# * +# * ``` +# * # Extract audio from video file +# * ffmpeg -i input_video.avi -vn -acodec copy output_audio.aac +# * ``` +# * ``` +# * # Get audio info +# * ffprobe -v quiet -print_format json -show_streams -select_streams a input_video.avi +# * ``` +# * +# * @category multimedia +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install ffmpeg' + +echo_info 'sudo apt-get install --assume-yes ffmpeg' +sudo apt-get install --assume-yes ffmpeg diff --git a/multimedia/install_freetube.sh b/multimedia/install_freetube.sh new file mode 100755 index 0000000..885e284 --- /dev/null +++ b/multimedia/install_freetube.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * freetube +# * +# * @category multimedia +# * @link https://freetubeapp.io/#download +# * @link https://github.com/FreeTubeApp/FreeTube/releases +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +BASENAME=freetube +REPOSITORY=FreeTubeApp/FreeTube +VERSION=0.20.0 +FILENAME=${BASENAME}_${VERSION}_amd64.deb + +alert_primary "Install ${BASENAME} ${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"https://github.com/${REPOSITORY}/releases/download/v${VERSION}-beta/${FILENAME}\"" +wget "https://github.com/${REPOSITORY}/releases/download/v${VERSION}-beta/${FILENAME}" + +echo_info "sudo dpkg -i \"${FILENAME}\"" +sudo dpkg -i "${FILENAME}" + +echo_info "rm \"${FILENAME}\"" +rm "${FILENAME}" + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/freetube.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/freetube.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/multimedia/install_id3tool.sh b/multimedia/install_id3tool.sh new file mode 100755 index 0000000..18d6237 --- /dev/null +++ b/multimedia/install_id3tool.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * id3tool +# * command line mp3 tags editor +# * +# * @category multimedia +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install id3tool' + +echo_info 'sudo apt-get install --assume-yes id3tool' +sudo apt-get install --assume-yes id3tool diff --git a/multimedia/install_kdenlive.sh b/multimedia/install_kdenlive.sh new file mode 100755 index 0000000..9baa554 --- /dev/null +++ b/multimedia/install_kdenlive.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * kdenlive +# * Video editor +# * +# * @category multimedia +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install kdenlive' + +echo_info 'sudo apt-get install --assume-yes kdenlive' +sudo apt-get install --assume-yes kdenlive diff --git a/multimedia/install_obs-studio.sh b/multimedia/install_obs-studio.sh new file mode 100755 index 0000000..7b51eb8 --- /dev/null +++ b/multimedia/install_obs-studio.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * obs studio +# * Free and open source software for video recording and live streaming +# * +# * @category multimedia +# * @link https://obsproject.com/wiki/install-instructions#linux +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install OBS Studio' + +echo_info 'sudo add-apt-repository --yes ppa:obsproject/obs-studio' +sudo add-apt-repository --yes ppa:obsproject/obs-studio + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes ffmpeg' +sudo apt-get install --assume-yes ffmpeg + +echo_info 'sudo apt-get install --assume-yes obs-studio' +sudo apt-get install --assume-yes obs-studio + +echo_info 'cp round-image-mask.png ~/Pictures' +cp round-image-mask.png ~/Pictures + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/com.obsproject.Studio.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/com.obsproject.Studio.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/multimedia/install_picard.sh b/multimedia/install_picard.sh new file mode 100755 index 0000000..fbd57f8 --- /dev/null +++ b/multimedia/install_picard.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * picard +# * +# * MusicBrainz Picard mp3 tag +# * +# * @category multimedia +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install picard' + +echo_info 'sudo add-apt-repository --yes ppa:musicbrainz-developers/stable' +sudo add-apt-repository --yes ppa:musicbrainz-developers/stable + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes picard' +sudo apt-get install --assume-yes picard diff --git a/multimedia/install_pulseaudio-equalizer.sh b/multimedia/install_pulseaudio-equalizer.sh new file mode 100755 index 0000000..32182e2 --- /dev/null +++ b/multimedia/install_pulseaudio-equalizer.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * pulseaudio-equalizer +# * +# * Start qpaeq equilizer +# * ``` +# * qpaeq +# * ``` +# * +# * @link https://livingthelinuxlifestyle.wordpress.com/2018/08/13/how-to-install-pulseaudio-equalizer-in-ubuntu-and-linux-mint/ +# * @link https://askubuntu.com/questions/980876/how-do-i-start-pulseaudio-equalizer +# * @category multimedia +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes pulseaudio-equalizer' +sudo apt-get install --assume-yes pulseaudio-equalizer + +# append configuration to /etc/pulse/default.pa +echo_info 'echo -en "load-module module-equalizer-sink\nload-module module-dbus-protocol" | sudo tee -a /etc/pulse/default.pa' +echo -en "load-module module-equalizer-sink\nload-module module-dbus-protocol" | sudo tee -a /etc/pulse/default.pa + +# restart Pulse Audio +echo_info 'pulseaudio --kill && pulseaudio --start' +pulseaudio --kill && pulseaudio --start + diff --git a/multimedia/install_vlc-delete.sh b/multimedia/install_vlc-delete.sh new file mode 100755 index 0000000..139be62 --- /dev/null +++ b/multimedia/install_vlc-delete.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * vlc-delete +# * lua addon to remove current playing file +# * +# * @category multimedia +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +# echo_info 'wget -q https://gist.githubusercontent.com/PAEz/d3a9be2471dbd39084136d974cdb9dd3/raw/0d580db34725b00b778a3078b890c6a7184e035e/vlc-delete.lua' +# wget -q https://gist.githubusercontent.com/PAEz/d3a9be2471dbd39084136d974cdb9dd3/raw/0d580db34725b00b778a3078b890c6a7184e035e/vlc-delete.lua + +echo_info 'wget -q https://raw.githubusercontent.com/surrim/vlc-delete/master/vlc-delete.lua' +wget -q https://raw.githubusercontent.com/surrim/vlc-delete/master/vlc-delete.lua + +echo_info 'mv ./vlc-delete.lua ~/.local/share/vlc/lua/extensions' +mv ./vlc-delete.lua ~/.local/share/vlc/lua/extensions + diff --git a/multimedia/install_vlc.sh b/multimedia/install_vlc.sh new file mode 100755 index 0000000..501a3c3 --- /dev/null +++ b/multimedia/install_vlc.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * vlc +# * multimedia player +# * +# * Expand all folders in playlist +# * Tools -> Preferences -> All -> Playlist -> Subdirectory Behavior -> Expand +# * +# * @category multimedia +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install VLC' + +echo_info 'sudo apt-get install --assume-yes vlc' +sudo apt-get install --assume-yes vlc + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/vlc.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/vlc.desktop "$(xdg-user-dir DESKTOP)" diff --git a/multimedia/install_youtube-dl.sh b/multimedia/install_youtube-dl.sh new file mode 100755 index 0000000..42d2aad --- /dev/null +++ b/multimedia/install_youtube-dl.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * youtube-dl +# * +# * NOTE: Install ffmpeg for conversion +# * +# * ``` +# * # Download a mp3 file +# * youtube-dl --extract-audio --audio-format mp3 --no-playlist https://www.youtube.com/watch?v=1lsnTQyGI78&list=PLArAJlC1y559y95RSJDGaZ2Azra1-Pro6 +# * +# * # Download a playlist +# * youtube-dl --extract-audio --audio-format mp3 \ +# * --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3753.1 Safari/537.36" \ +# * https://www.youtube.com/watch?v=1lsnTQyGI78&list=PLArAJlC1y559y95RSJDGaZ2Azra1-Pro6 +# * +# * # Download thumbnails +# * youtube-dl --write-all-thumbnails --skip-download --no-playlist \ +# * https://www.youtube.com/watch?v=1lsnTQyGI78&list=PLArAJlC1y559y95RSJDGaZ2Azra1-Pro6 +# * +# * # Download highset resolution thumbnail +# * youtube-dl --write-thumbnail --skip-download --no-playlist \ +# * https://www.youtube.com/watch?v=1lsnTQyGI78&list=PLArAJlC1y559y95RSJDGaZ2Azra1-Pro6 +# * ``` +# * +# * @category multimedia +# * @link http://ytdl-org.github.io/youtube-dl/download.html +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v pip)" ]; then + echo_error "\"$(basename "${0}")\" requires pip, try: 'sudo apt-get install -y pip'" + exit 1 +fi + +echo_info 'sudo pip install --upgrade youtube_dl' +sudo pip install --upgrade youtube_dl diff --git a/multimedia/remove_freetube.sh b/multimedia/remove_freetube.sh new file mode 100755 index 0000000..c21c3c9 --- /dev/null +++ b/multimedia/remove_freetube.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * freetube +# * +# * @category multimedia +# * @link https://freetubeapp.io/#download +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +APP_NAME=freetube + +alert_primary "Remove ${APP_NAME}" + +echo_info "sudo dpkg --purge \"${APP_NAME}\"" +sudo dpkg --purge "${APP_NAME}" + +# remove desktop shortcut +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/\"${APP_NAME}\".desktop" +rm "$(xdg-user-dir DESKTOP)"/"${APP_NAME}".desktop + diff --git a/multimedia/round-image-mask.png b/multimedia/round-image-mask.png new file mode 100644 index 0000000..0ff3aba Binary files /dev/null and b/multimedia/round-image-mask.png differ diff --git a/nautilus/config_nautilus.sh b/nautilus/config_nautilus.sh new file mode 100755 index 0000000..d3cede4 --- /dev/null +++ b/nautilus/config_nautilus.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config nautilus +# * +# * @category nautilus +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# check system uses gnome +GNOME=false +RELEASE="$(lsb_release -cs)" +for CODENAME in bionic cosmic disco eoan focal kali +do + if [ "${RELEASE}" = "${CODENAME}" ]; then + GNOME=true + fi +done + +if [ "${GNOME}" = true ]; then + echo_info "gsettings set org.gnome.nautilus.preferences default-sort-order 'type'" + gsettings set org.gnome.nautilus.preferences default-sort-order 'type' +else + echo_error 'wrong system' +fi diff --git a/nautilus/install_compizconfig-settings-manager.sh b/nautilus/install_compizconfig-settings-manager.sh new file mode 100755 index 0000000..04c729a --- /dev/null +++ b/nautilus/install_compizconfig-settings-manager.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install compizconfig +# * +# * @category nautilus +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# check system uses gnome +GNOME=false +RELEASE="$(lsb_release -cs)" +for CODENAME in bionic cosmic disco eoan focal kali +do + if [ "${RELEASE}" = "${CODENAME}" ]; then + GNOME=true + fi +done + +if [ "${GNOME}" = false ]; then + echo_info 'sudo apt-get install -f' + sudo apt-get install -f + + # compiz + # compiz-core + # compiz-plugins + # compiz-plugins-extra + # compizconfig-setttings-manager + + echo_info 'sudo apt-get install --assume-yes compizconfig-settings-manager' + sudo apt-get install --assume-yes compizconfig-settings-manager + + echo_info 'sudo apt-get install compiz-plugins' + sudo apt-get install compiz-plugins + + # temporary setup + compiz --replace +else + echo_error 'wrong system' +fi diff --git a/nautilus/install_nautilus-actions.sh b/nautilus/install_nautilus-actions.sh new file mode 100755 index 0000000..ddeb976 --- /dev/null +++ b/nautilus/install_nautilus-actions.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * nautilus-actions +# * add custom actions to file manager context menus +# * +# * @category nautilus +# * @link http://www.nautilus-actions.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# check system uses gnome +GNOME=false +RELEASE="$(lsb_release -cs)" +for CODENAME in bionic cosmic disco eoan focal kali +do + if [ "${RELEASE}" = "${CODENAME}" ]; then + GNOME=true + fi +done + +if [ "${GNOME}" = true ]; then + echo_info 'sudo apt-get install --assume-yes nautilus-actions' + sudo apt-get install --assume-yes nautilus-actions +else + echo_error 'wrong system' +fi diff --git a/network/config_disable_ipv6.sh b/network/config_disable_ipv6.sh new file mode 100755 index 0000000..94d52e1 --- /dev/null +++ b/network/config_disable_ipv6.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * disable ipv6 +# * +# * @category network +# * @link https://itsfoss.com/disable-ipv6-ubuntu-linux/ +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1' +sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 + +echo_info 'sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1' +sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 + +echo_info 'sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1' +sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 + +# make permanent +sudo bash -c 'cat >> /etc/sysctl.conf <> /etc/rc.local < +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ +# /etc/rc.local + +/etc/sysctl.d +/etc/init.d/procps restart + +exit 0 +EOF' + +# make rc.local executable +echo_info 'sudo chmod 755 /etc/rc.local' +sudo chmod 755 /etc/rc.local diff --git a/network/config_known_ssh_hosts.sh b/network/config_known_ssh_hosts.sh new file mode 100755 index 0000000..e00d005 --- /dev/null +++ b/network/config_known_ssh_hosts.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config known ssh hosts +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_secondary 'Config known ssh hosts' + +# create ~/.ssh/known_hosts if not exists +echo_info 'touch ~/.ssh/known_hosts' +touch ~/.ssh/known_hosts + +# add github.com, gitlab.com and bitbucket.org keys to known_hosts +echo_info 'ssh-keyscan -H github.com >> ~/.ssh/known_hosts' +ssh-keyscan -H github.com >> ~/.ssh/known_hosts + +echo_info 'ssh-keyscan -H gist.github.com >> ~/.ssh/known_hosts' +ssh-keyscan -H gist.github.com >> ~/.ssh/known_hosts + +echo_info 'ssh-keyscan -H bitbucket.org >> ~/.ssh/known_hosts' +ssh-keyscan -H bitbucket.org >> ~/.ssh/known_hosts + +echo_info 'ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts' +ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts + +echo_info 'chmod 644 ~/.ssh/known_hosts' +chmod 644 ~/.ssh/known_hosts + +echo_info "chown \"${USER}:${USER}\" ~/.ssh/known_hosts" +chown "${USER}:${USER}" ~/.ssh/known_hosts diff --git a/network/install_awscli.sh b/network/install_awscli.sh new file mode 100755 index 0000000..ecaf296 --- /dev/null +++ b/network/install_awscli.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * awscli +# * amazon s3 client +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install awscli' + +if [ ! -x "$(command -v pip3)" ]; then + echo_error "\"$(basename "${0}")\" requires python3-pip, try: 'sudo apt-get install -y python3-pip'" + exit 1 +fi + +echo_info 'pip3 install awscli' +pip3 install awscli diff --git a/network/install_bridge-utils.sh b/network/install_bridge-utils.sh new file mode 100755 index 0000000..74a727f --- /dev/null +++ b/network/install_bridge-utils.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * bridge-utils +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes bridge-utils' +sudo apt-get install --assume-yes bridge-utils diff --git a/network/install_crossftp.sh b/network/install_crossftp.sh new file mode 100755 index 0000000..6926810 --- /dev/null +++ b/network/install_crossftp.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * crossftp +# * +# * aws glacier client +# * +# * @category network +# * @link https://www.crossftp.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +VERSION=1.99.9 + +alert_primary "Install crossftp ${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v java)" ]; then + echo_error "\"$(basename "${0}")\" requires java, try: 'sudo apt-get install -y openjdk-11-jdk'" + exit 1 +fi + +echo_info "wget \"https://www.crossftp.com/crossftp_${VERSION}.deb\"" +wget "https://www.crossftp.com/crossftp_${VERSION}.deb" + +echo_info "sudo dpkg -i \"crossftp_${VERSION}.deb\"" +sudo dpkg -i "crossftp_${VERSION}.deb" + +echo_info "rm \"crossftp_${VERSION}.deb\"" +rm "crossftp_${VERSION}.deb" + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/crossftp.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/crossftp.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/network/install_curl.sh b/network/install_curl.sh new file mode 100755 index 0000000..f9ebed6 --- /dev/null +++ b/network/install_curl.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * curl +# * http client +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install curl' + +echo_info 'sudo apt-get install --assume-yes libcurl4 curl' +sudo apt-get install --assume-yes libcurl4 curl diff --git a/network/install_curlftpfs.sh b/network/install_curlftpfs.sh new file mode 100755 index 0000000..edf05f4 --- /dev/null +++ b/network/install_curlftpfs.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * curlftpfs +# * mount remote ftp on local file system +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes curlftpfs' +sudo apt-get install --assume-yes curlftpfs diff --git a/network/install_dbeaver-ce.png b/network/install_dbeaver-ce.png new file mode 100644 index 0000000..7fe5006 Binary files /dev/null and b/network/install_dbeaver-ce.png differ diff --git a/network/install_dbeaver-ce.sh b/network/install_dbeaver-ce.sh new file mode 100755 index 0000000..49e6a02 --- /dev/null +++ b/network/install_dbeaver-ce.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * dbeaver-ce +# * +# * universal client database manager +# * +# * @category network +# * @link https://dbeaver.io +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +FILENAME=dbeaver-ce_latest_amd64.deb + +alert_primary "Install DBeaver Community" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"https://dbeaver.io/files/${FILENAME}\"" +wget "https://dbeaver.io/files/${FILENAME}" + +echo_info "sudo dpkg -i \"${FILENAME}\"" +sudo dpkg -i "${FILENAME}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +# create desktop shortcut +echo_info "cp -p /usr/share/applications/dbeaver-ce.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/dbeaver-ce.desktop "$(xdg-user-dir DESKTOP)" diff --git a/network/install_filezilla.sh b/network/install_filezilla.sh new file mode 100755 index 0000000..016e68e --- /dev/null +++ b/network/install_filezilla.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * filezilla +# * +# * ftp client +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install filezilla' + +echo_info 'sudo apt-get install --assume-yes filezilla' +sudo apt-get install --assume-yes filezilla + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/filezilla.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/filezilla.desktop "$(xdg-user-dir DESKTOP)" diff --git a/network/install_graphiql.sh b/network/install_graphiql.sh new file mode 100755 index 0000000..348cde5 --- /dev/null +++ b/network/install_graphiql.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * graphiql +# * A GUI for editing and testing GraphQL queries and mutations +# * +# * @category network +# * @link https://electronjs.org/apps/graphiql +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +VERSION=$(get_latest_release skevy/graphiql-app) +if [ -z "${VERSION}" ]; then + VERSION=0.7.2 +fi + +alert_primary "Install graphiql v${VERSION}" + +echo_info "wget -qO \"graphiql-app-${VERSION}-x86_64.AppImage\" \"https://github.com/skevy/graphiql-app/releases/download/v${VERSION}/graphiql-app-${VERSION}-x86_64.AppImage\"" +wget -qO "graphiql-app-${VERSION}-x86_64.AppImage" "https://github.com/skevy/graphiql-app/releases/download/v${VERSION}/graphiql-app-${VERSION}-x86_64.AppImage" + +echo_info 'mkdir ~/.graphiql' +mkdir ~/.graphiql + +echo_info "mv -fv \"graphiql-app-${VERSION}-x86_64.AppImage\" ~/.graphiql" +mv -fv "graphiql-app-${VERSION}-x86_64.AppImage" ~/.graphiql + +echo_info "chmod a+x \"${HOME}/.graphiql/graphiql-app-${VERSION}-x86_64.AppImage\"" +chmod a+x "${HOME}/.graphiql/graphiql-app-${VERSION}-x86_64.AppImage" + +echo_info 'sync' +sync + diff --git a/network/install_gufw.sh b/network/install_gufw.sh new file mode 100755 index 0000000..146416d --- /dev/null +++ b/network/install_gufw.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * gufw +# * graphical interface for ufw (uncomplicated firewal) +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install gufw' + +echo_info 'sudo apt-get install --assume-yes gufw' +sudo apt-get install --assume-yes gufw diff --git a/network/install_httrack.sh b/network/install_httrack.sh new file mode 100755 index 0000000..4493c7f --- /dev/null +++ b/network/install_httrack.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * httrack +# * website downloader +# * +# * Change User Agent with: +# * httrack -F "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36" https://google.com +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes httrack' +sudo apt-get install --assume-yes httrack diff --git a/network/install_iftop.sh b/network/install_iftop.sh new file mode 100755 index 0000000..045e05f --- /dev/null +++ b/network/install_iftop.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * iftop +# * display bandwidth usage on an interface by host +# * +# * ``` +# * # list network devices +# * lshw -short -c network +# * +# * # print network traffic +# * sudo iftop -i wlp2s0 +# * ``` +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install iftop' + +echo_info 'sudo apt-get install --assume-yes iftop' +sudo apt-get install --assume-yes iftop diff --git a/network/install_insomnia.sh b/network/install_insomnia.sh new file mode 100755 index 0000000..c84546c --- /dev/null +++ b/network/install_insomnia.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * insomnia +# * +# * API Rest client alternative to postman +# * +# * @category network +# * @link https://insomnia.rest +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +REPOSITORY=kong/insomnia +RELEASE=core@2023.2.2 +VERSION=$(echo "${RELEASE}" | cut -d@ -f2) +FILENAME=Insomnia.Core-${VERSION}.deb + +alert_primary "Install Insomnia v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget -q \"https://github.com/${REPOSITORY}/releases/download/${RELEASE}/${FILENAME}\"" +wget -q "https://github.com/${REPOSITORY}/releases/download/${RELEASE}/${FILENAME}" + +echo_info "sudo dpkg -i \"${FILENAME}\"" +sudo dpkg -i "${FILENAME}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/insomnia.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/insomnia.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/network/install_mysql-workbench.sh b/network/install_mysql-workbench.sh new file mode 100755 index 0000000..711c2fa --- /dev/null +++ b/network/install_mysql-workbench.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mysql-workbench +# * mysql client database manager +# * +# * @category network +# * @link https://dev.mysql.com/doc/workbench/en +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes mysql-workbench' +sudo apt-get install --assume-yes mysql-workbench diff --git a/network/install_net-tools.sh b/network/install_net-tools.sh new file mode 100755 index 0000000..5687d5a --- /dev/null +++ b/network/install_net-tools.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * net-tools +# * +# * A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system. +# * +# * Includes: arp, hostname, ifconfig, netstat, rarp, route, plipconfig, slattach, mii-tool and iptunnel and ipmaddr. +# * +# * @category network +# * @link https://sourceforge.net/projects/net-tools +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes net-tools' +sudo apt-get install --assume-yes net-tools diff --git a/network/install_netfilterqueue.sh b/network/install_netfilterqueue.sh new file mode 100755 index 0000000..fa26049 --- /dev/null +++ b/network/install_netfilterqueue.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * netfilterqueue +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +if [ ! -x "$(command -v python3)" ]; then + echo_error "\"$(basename "${0}")\" requires python3, try: 'sudo apt-get install -y python3'" + exit 1 +fi + +echo_info 'sudo apt-get install --assume-yes build-essential python-dev libnetfilter-queue-dev' +sudo apt-get install --assume-yes build-essential python-dev libnetfilter-queue-dev + +echo_info 'mkdir ~/.netfilterqueue' +mkdir ~/.netfilterqueue + +echo_info 'git clone --depth 1 https://github.com/kti/python-netfilterqueue.git ~/.netfilterqueue' +git clone --depth 1 https://github.com/kti/python-netfilterqueue.git ~/.netfilterqueue + +( + echo_info 'cd ~/.netfilterqueue || exit 1' + cd ~/.netfilterqueue || exit 1 + + echo_info 'rm -rf .git' + rm -rf .git + + echo_info 'sudo python setup.py install' + sudo python setup.py install +) diff --git a/network/install_netutils-ping.sh b/network/install_netutils-ping.sh new file mode 100755 index 0000000..7df3f95 --- /dev/null +++ b/network/install_netutils-ping.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * netutils-ping +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install netutils-ping' + +echo_info 'sudo apt-get install --assume-yes netutils-ping' +sudo apt-get install --assume-yes netutils-ping diff --git a/network/install_nmap.sh b/network/install_nmap.sh new file mode 100755 index 0000000..29dcc91 --- /dev/null +++ b/network/install_nmap.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * nmap +# * network scanner +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install nmap' + +echo_info 'sudo apt-get install --assume-yes nmap' +sudo apt-get install --assume-yes nmap diff --git a/network/install_postman.sh b/network/install_postman.sh new file mode 100755 index 0000000..93d6137 --- /dev/null +++ b/network/install_postman.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * postman +# * +# * API Rest client +# * +# * @category network +# * @link https://www.getpostman.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +APP_NAME=postman + +alert_primary "Install \"${APP_NAME}\"" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +echo_info "sudo snap install ${APP_NAME}" +sudo snap install ${APP_NAME} + +# create shortcut on desktop +echo_info "cp -p /var/lib/snapd/desktop/applications/${APP_NAME}_${APP_NAME}.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /var/lib/snapd/desktop/applications/${APP_NAME}_${APP_NAME}.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/network/install_rclone.sh b/network/install_rclone.sh new file mode 100755 index 0000000..fbef2f2 --- /dev/null +++ b/network/install_rclone.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * rclone +# * +# * @category network +# * @link https://rclone.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes rclone' +sudo apt-get install --assume-yes rclone + diff --git a/network/install_remmina.sh b/network/install_remmina.sh new file mode 100755 index 0000000..638dfd3 --- /dev/null +++ b/network/install_remmina.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remmina +# * remote desktop client +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install remmina' + +echo_info 'sudo apt-get install --assume-yes remmina' +sudo apt-get install --assume-yes remmina + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/org.remmina.Remmina.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/org.remmina.Remmina.desktop "$(xdg-user-dir DESKTOP)" diff --git a/network/install_sqlitebrowser.sh b/network/install_sqlitebrowser.sh new file mode 100755 index 0000000..b2708f3 --- /dev/null +++ b/network/install_sqlitebrowser.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * sqlitebrowser +# * sqlite client database manager +# * +# * @category network +# * @link https://sqlitebrowser.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install sqlitebrowser' + +echo_info 'sudo apt-get install --assume-yes sqlitebrowser' +sudo apt-get install --assume-yes sqlitebrowser + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/sqlitebrowser.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/sqlitebrowser.desktop "$(xdg-user-dir DESKTOP)" diff --git a/network/install_tightvncserver.sh b/network/install_tightvncserver.sh new file mode 100755 index 0000000..979a5f9 --- /dev/null +++ b/network/install_tightvncserver.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * tightvncserver +# * remote desktop server +# * +# * check server started: +# * ``` +# * ps -edf | grep tightvnc +# * ``` +# * check listenig ports: +# * ``` +# * netstat -lptun | grep vnc +# * ``` +# * +# * @category network +# * @note NOT RECOMMENDED: install x11vnc instead +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes tightvncserver' +sudo apt-get install --assume-yes tightvncserver + +# script manager +sudo bash -c 'cat > /usr/local/bin/vncserver < +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ +DISPLAY="1" +DEPTH="24" +GEOMETRY="1280x1204" +OPTIONS="-depth \${DEPTH} -geometry \${GEOMETRY} :\${DISPLAY}" + +case "\$1" in + start) + /usr/bin/tightvncserver \${OPTIONS} + ;; + + stop) + /usr/bin/tightvncserver -kill :\${DISPLAY} + ;; + + restart) + \$0 stop + \$0 start + ;; + esac +exit 0 +EOF' + +sudo chmod uga+x /usr/local/bin/vncserver + +# systemctl service unit configuration +sudo bash -c "cat > /lib/systemd/system/vncserver.service < +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * traceroute +# * network analyser +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes traceroute' +sudo apt-get install --assume-yes traceroute diff --git a/network/install_whois.sh b/network/install_whois.sh new file mode 100755 index 0000000..a164523 --- /dev/null +++ b/network/install_whois.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * whois +# * whois client +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes whois' +sudo apt-get install --assume-yes whois diff --git a/network/install_x11vnc.sh b/network/install_x11vnc.sh new file mode 100755 index 0000000..8b94ae8 --- /dev/null +++ b/network/install_x11vnc.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * x11vnc +# * remote desktop server +# * +# * check server started: +# * ``` +# * ps -edf | grep x11vnc +# * ``` +# * check listenig ports (5901): +# * ``` +# * netstat -lptun | grep vnc +# * ``` +# * +# * @category network +# * @link http://doc.ubuntu-fr.org/x11vnc +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install x11vnc' + +echo_info 'sudo apt-get install --assume-yes x11vnc' +sudo apt-get install --assume-yes x11vnc + +echo_info 'x11vnc -storepasswd tangoman ~/.vnc/passwd' +x11vnc -storepasswd tangoman ~/.vnc/passwd + +echo_info 'x11vnc -usepw -bg -forever' +x11vnc -usepw -bg -forever + +# create autostart shortcut +cat > ~/.config/autostart/vnc-server.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * xtightvncviewer +# * remote desktop client +# * +# * @category network +# * @note NOT RECOMMENDED: install remmina instead +# * @note xtightvncviewer -fullscreen 192.168.0.3:1 +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes xtightvncviewer' +sudo apt-get install --assume-yes xtightvncviewer diff --git a/network/install_zenmap.sh b/network/install_zenmap.sh new file mode 100755 index 0000000..e9c5fb2 --- /dev/null +++ b/network/install_zenmap.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" > + +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * zenmap +# * nmap network scanner graphic interface +# * +# * @link https://nmap.org/download.html +# * @link http://archive.ubuntu.com/ubuntu/pool/universe/n/nmap/ +# * @link http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/ +# * @link http://archive.ubuntu.com/ubuntu/pool/universe/p/pycairo/ +# * @link http://archive.ubuntu.com/ubuntu/pool/universe/p/pygobject-2/ +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +PYTHON_GTK2=python-gtk2_2.24.0-5.1ubuntu2_amd64.deb +PYTHON_CAIRO=python-cairo_1.16.2-2ubuntu2_amd64.deb +PYTHON_GOBJECT=python-gobject-2_2.28.6-14ubuntu1_amd64.deb +ZENMAP=zenmap-7.93-1.noarch.rpm +ZENMAP_DEB=zenmap_7.93-2_all.deb + +alert_primary "Install $(basename "${ZENMAP}" .rpm)" + +if [ ! -x "$(command -v python2)" ]; then + echo_error "\"$(basename "${0}")\" requires python2, try: 'sudo apt-get install -y python2'" + exit 1 +fi + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v alien)" ]; then + echo_error "\"$(basename "${0}")\" requires alien, try: 'sudo apt-get install -y alien'" + exit 1 +fi + +if [ ! -x "$(command -v nmap)" ]; then + echo_error "\"$(basename "${0}")\" requires nmap, try: 'sudo apt-get install -y nmap'" + exit 1 +fi + +echo_info "wget \"https://nmap.org/dist/${ZENMAP}\"" +wget "https://nmap.org/dist/${ZENMAP}" + +echo_info "sudo alien \"${ZENMAP}\"" +sudo alien "${ZENMAP}" + +echo_info "sudo chmod +777 \"${ZENMAP_DEB}\"" +sudo chmod +777 "${ZENMAP_DEB}" + +echo_info "sudo dpkg -i \"${ZENMAP_DEB}\"" +sudo dpkg -i "${ZENMAP_DEB}" + +echo_info "wget \"http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/${PYTHON_GTK2}\"" +wget "http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/${PYTHON_GTK2}" + +echo_info "sudo dpkg -i \"${PYTHON_GTK2}\"" +sudo dpkg -i "${PYTHON_GTK2}" + +echo_info "wget \"http://archive.ubuntu.com/ubuntu/pool/universe/p/pycairo/${PYTHON_CAIRO}\"" +wget "http://archive.ubuntu.com/ubuntu/pool/universe/p/pycairo/${PYTHON_CAIRO}" + +echo_info "sudo dpkg -i \"${PYTHON_CAIRO}\"" +sudo dpkg -i "${PYTHON_CAIRO}" + +echo_info "wget \"http://archive.ubuntu.com/ubuntu/pool/universe/p/pygobject-2/${PYTHON_GOBJECT}\"" +wget "http://archive.ubuntu.com/ubuntu/pool/universe/p/pygobject-2/${PYTHON_GOBJECT}" + +echo_info "sudo dpkg -i \"${PYTHON_GOBJECT}\"" +sudo dpkg -i "${PYTHON_GOBJECT}" + +echo_info "rm -f \"${PYTHON_GTK2}\"" +rm -f "${PYTHON_GTK2}" + +echo_info "rm -f \"${PYTHON_CAIRO}\"" +rm -f "${PYTHON_CAIRO}" + +echo_info "rm -f \"${PYTHON_GOBJECT}\"" +rm -f "${PYTHON_GOBJECT}" + +echo_info "rm -f \"${ZENMAP}\"" +rm -f "${ZENMAP}" + +echo_info "rm -f \"${ZENMAP_DEB}\"" +rm -f "${ZENMAP_DEB}" + diff --git a/network/remove_dbeaver-ce.sh b/network/remove_dbeaver-ce.sh new file mode 100755 index 0000000..3e1a554 --- /dev/null +++ b/network/remove_dbeaver-ce.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * dbeaver-ce +# * +# * @category network +# * @link https://dbeaver.io +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +APP_NAME=dbeaver-ce + +alert_primary "Remove ${APP_NAME}" + +echo_info "sudo dpkg --purge \"${APP_NAME}\"" +sudo dpkg --purge "${APP_NAME}" + +# remove desktop shortcut +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/\"${APP_NAME}\".desktop" +rm "$(xdg-user-dir DESKTOP)"/"${APP_NAME}".desktop diff --git a/network/remove_postman.sh b/network/remove_postman.sh new file mode 100755 index 0000000..06ece6d --- /dev/null +++ b/network/remove_postman.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * postman +# * +# * @category network +# * @link https://dbeaver.io +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +APP_NAME=postman + +alert_primary "Remove ${APP_NAME}" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap to install, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +# remove with snap +echo_info "sudo snap remove \"${APP_NAME}\"" +sudo snap remove "${APP_NAME}" + +# remove desktop shortcut +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/\"${APP_NAME}\".desktop" +rm "$(xdg-user-dir DESKTOP)"/"${APP_NAME}".desktop diff --git a/network/remove_rclone.sh b/network/remove_rclone.sh new file mode 100755 index 0000000..dd8bc1f --- /dev/null +++ b/network/remove_rclone.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove rclone +# * +# * @category network +# * @link https://rclone.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +{ + echo_info 'sudo apt-get remove --assume-yes --autoremove rclone' + sudo apt-get remove --assume-yes --autoremove rclone +} || { + # binary + echo_info 'sudo rm -f /usr/bin/rclone' + sudo rm -f /usr/bin/rclone + + # manuals + echo_info 'sudo rm -f /usr/local/share/man/man1/rclone.1' + sudo rm -f /usr/local/share/man/man1/rclone.1 +} diff --git a/network/uninstall_zenmap.sh b/network/uninstall_zenmap.sh new file mode 100755 index 0000000..41eaa5d --- /dev/null +++ b/network/uninstall_zenmap.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" > + +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * zenmap +# * nmap network scanner graphic interface +# * +# * @category network +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary "Uninstall $(basename "${ZENMAP}" .rpm)" + +echo_info 'sudo apt-get remove -y python-gtk2' +sudo apt-get remove -y python-gtk2 + +echo_info 'sudo apt-get remove -y python-gobject-2' +sudo apt-get remove -y python-gobject-2 + +echo_info 'sudo apt-get remove -y python-cairo' +sudo apt-get remove -y python-cairo + +echo_info 'sudo apt-get remove -y python2' +sudo apt-get remove -y python2 + +echo_info 'sudo apt-get remove -y zenmap' +sudo apt-get remove -y zenmap + +echo_info 'sudo apt-get autoremove -y' +sudo apt-get autoremove -y diff --git a/office/install_apostrophe.sh b/office/install_apostrophe.sh new file mode 100644 index 0000000..6fe97a6 --- /dev/null +++ b/office/install_apostrophe.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * apostrophe +# * +# * markdown editor +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes apostrophe' +sudo apt-get install --assume-yes apostrophe + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/org.gnome.gitlab.somas.Apostrophe.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/org.gnome.gitlab.somas.Apostrophe.desktop "$(xdg-user-dir DESKTOP)" diff --git a/office/install_joplin.sh b/office/install_joplin.sh new file mode 100755 index 0000000..af9b0a2 --- /dev/null +++ b/office/install_joplin.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install joplin +# * Joplin - an open source note taking and to-do application with synchronisation capabilities +# * +# * @category office +# * @link https://joplinapp.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash' +wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash diff --git a/office/install_libreoffice-calc.sh b/office/install_libreoffice-calc.sh new file mode 100755 index 0000000..70b56b5 --- /dev/null +++ b/office/install_libreoffice-calc.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install libre office calc +# * +# * Remove spelling +# * Tools > Automatic Spell Checking Shift+F7 +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install libreoffice-calc' + +echo_info 'sudo apt-get install --assume-yes libreoffice-calc' +sudo apt-get install --assume-yes libreoffice-calc + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/libreoffice-calc.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/libreoffice-calc.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/office/install_libreoffice-draw.sh b/office/install_libreoffice-draw.sh new file mode 100755 index 0000000..78e799d --- /dev/null +++ b/office/install_libreoffice-draw.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install libre office draw +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install libreoffice-draw' + +echo_info 'sudo apt-get install --assume-yes libreoffice-draw' +sudo apt-get install --assume-yes libreoffice-draw + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/libreoffice-draw.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/libreoffice-draw.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/office/install_libreoffice-writer.sh b/office/install_libreoffice-writer.sh new file mode 100755 index 0000000..409d26d --- /dev/null +++ b/office/install_libreoffice-writer.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install libre office writer +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install libreoffice-writer' + +echo_info 'sudo apt-get install --assume-yes libreoffice-writer' +sudo apt-get install --assume-yes libreoffice-writer + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/libreoffice-writer.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/libreoffice-writer.desktop "$(xdg-user-dir DESKTOP)" diff --git a/office/install_libreoffice.sh b/office/install_libreoffice.sh new file mode 100755 index 0000000..e49c109 --- /dev/null +++ b/office/install_libreoffice.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install libre office +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install libreoffice' + +echo_info 'sudo snap install libreoffice' +sudo snap install libreoffice diff --git a/office/install_markdown.sh b/office/install_markdown.sh new file mode 100755 index 0000000..5134a8a --- /dev/null +++ b/office/install_markdown.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * markdown +# * +# * Not recommended try pandoc instead. +# * +# * ``` +# * markdown file.md > file.html +# * ``` +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes markdown' +sudo apt-get install --assume-yes markdown diff --git a/office/install_pandoc.sh b/office/install_pandoc.sh new file mode 100755 index 0000000..9060104 --- /dev/null +++ b/office/install_pandoc.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install pandoc +# * +# * convert html to pdf +# * +# * ``` +# * pandoc index.html --to pdf --output index.pdf +# * +# * # --standalone : Produce output with an appropriate header and footer +# * pandoc README.md --from gfm --to html --standalone --output index.html +# * +# * pandoc README.md --to pdf --output readme.pdf +# * ``` +# * +# * Some supported formats : +# * +# * - commonmark (CommonMark Markdown) +# * - commonmark_x (CommonMark Markdown with extensions) +# * - csv (CSV table) +# * - tsv (TSV table) +# * - docx (Word docx) +# * - gfm (GitHub-Flavored Markdown), or the deprecated and less accurate markdown_github; use markdown_github only if you need extensions not supported in gfm. +# * - html (HTML) +# * - ipynb (Jupyter notebook) +# * - jira (Jira/Confluence wiki markup) +# * - json (JSON version of native AST) +# * - latex (LaTeX) +# * - markdown_mmd (MultiMarkdown) +# * - markdown_phpextra (PHP Markdown Extra) +# * - markdown_strict (original unextended Markdown) +# * - odt (ODT) +# * - pdf (PDF) +# * - rtf (Rich Text Format) +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes pandoc' +sudo apt-get install --assume-yes pandoc + +echo_info 'sudo apt-get install --assume-yes texlive-latex-recommended' +sudo apt-get install --assume-yes texlive-latex-recommended + diff --git a/office/install_wkhtmltopdf.sh b/office/install_wkhtmltopdf.sh new file mode 100644 index 0000000..bb35808 --- /dev/null +++ b/office/install_wkhtmltopdf.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install wkhtmltopdf +# * +# * convert html to pdf +# * +# * Not recommended try pandoc instead. +# * +# * Convert `html` to `pdf` with `css` and `` +# * +# * ``` +# * wkhtmltopdf --enable-local-file-access example.html example.pdf +# * ``` +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes wkhtmltopdf' +sudo apt-get install --assume-yes wkhtmltopdf + diff --git a/office/remove_bloat_libre-office.sh b/office/remove_bloat_libre-office.sh new file mode 100755 index 0000000..a7ae134 --- /dev/null +++ b/office/remove_bloat_libre-office.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove bloat libre office +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes libreoffice-draw' +sudo apt-get purge --assume-yes libreoffice-draw + +echo_info 'sudo apt-get purge --assume-yes libreoffice-impress' +sudo apt-get purge --assume-yes libreoffice-impress + +echo_info 'sudo apt-get purge --assume-yes libreoffice-math' +sudo apt-get purge --assume-yes libreoffice-math + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/office/remove_joplin.sh b/office/remove_joplin.sh new file mode 100755 index 0000000..a851faf --- /dev/null +++ b/office/remove_joplin.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove joplin +# * +# * @category office +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# remove Joplin +echo_info 'rm -rf ~/.joplin' +rm -rf ~/.joplin + +# remove icon +echo_info 'rm -f ~/.local/share/icons/hicolor/512x512/apps/joplin.png' +rm -f ~/.local/share/icons/hicolor/512x512/apps/joplin.png + +echo_info 'rm -f ~/.local/share/applications/appimagekit-joplin.desktop' +rm -f ~/.local/share/applications/appimagekit-joplin.desktop diff --git a/productivity/install_cerebro.sh b/productivity/install_cerebro.sh new file mode 100755 index 0000000..3a3ca70 --- /dev/null +++ b/productivity/install_cerebro.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * cerebro +# * +# * App launcher +# * +# * @category productivity +# * @link https://cerebroapp.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +REPOSITORY=cerebroapp/cerebro +VERSION=0.11.0 +FILENAME=cerebro_${VERSION}_amd64.deb + +alert_primary "Install Cerebro v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget -q \"https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}\"" +wget -q "https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}" + +echo_info "sudo dpkg -i \"${FILENAME}\"" +sudo dpkg -i "${FILENAME}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +echo_info 'sudo apt-get install -f' +sudo apt-get install -f + +# create desktop shortcut +cat > "$(xdg-user-dir DESKTOP)"/cerebro.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * dropbox +# * personal cloud +# * +# * @category productivity +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Dropbox' + +#echo_info 'sudo apt-get install --assume-yes python-gpgme' +#sudo apt-get install --assume-yes python-gpgme + +# check system uses gnome +GNOME=false +RELEASE="$(lsb_release -cs)" +for CODENAME in bionic cosmic disco eoan focal kali +do + if [ "${RELEASE}" = "${CODENAME}" ]; then + GNOME=true + fi +done + +if [ "${GNOME}" = true ]; then + echo_info 'sudo apt-get install --assume-yes nautilus-dropbox' + sudo apt-get install --assume-yes nautilus-dropbox +else + echo_info 'sudo apt-get install --assume-yes thunar-dropbox-plugin' + sudo apt-get install --assume-yes thunar-dropbox-plugin +fi + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/dropbox.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/dropbox.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/productivity/install_gnome-clocks.sh b/productivity/install_gnome-clocks.sh new file mode 100755 index 0000000..e31c902 --- /dev/null +++ b/productivity/install_gnome-clocks.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * gnome-clocks +# * +# * @category productivity +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install gnome-clocks' + +echo_info 'sudo apt-get install --assume-yes gnome-clocks' +sudo apt-get install --assume-yes gnome-clocks diff --git a/productivity/install_gnome-weather.sh b/productivity/install_gnome-weather.sh new file mode 100755 index 0000000..91b4e12 --- /dev/null +++ b/productivity/install_gnome-weather.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * gnome-weather +# * +# * @category productivity +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install gnome-weather' + +echo_info 'sudo apt-get install --assume-yes gnome-weather' +sudo apt-get install --assume-yes gnome-weather + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/org.gnome.Weather.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/org.gnome.Weather.desktop "$(xdg-user-dir DESKTOP)" diff --git a/productivity/install_obsidian.sh b/productivity/install_obsidian.sh new file mode 100755 index 0000000..0ae9cc3 --- /dev/null +++ b/productivity/install_obsidian.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * obsidian +# * +# * A knowledge base that works on local Markdown files. +# * +# * @category productivity +# * @link https://obsidian.md +# * @link https://obsidian.md/plugins +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +VERSION=0.12.19 + +alert_primary "Install Obsidian v${VERSION}" + +echo_info 'mkdir ~/.obsidian' +mkdir ~/.obsidian + +echo_info "wget -qO ~/.obsidian/Obsidian.AppImage https://github.com/obsidianmd/obsidian-releases/releases/download/v${VERSION}/Obsidian-${VERSION}.AppImage" +wget -qO ~/.obsidian/Obsidian.AppImage https://github.com/obsidianmd/obsidian-releases/releases/download/v${VERSION}/Obsidian-${VERSION}.AppImage + +echo_info 'chmod a+x ~/.obsidian/Obsidian.AppImage' +chmod a+x ~/.obsidian/Obsidian.AppImage + +echo_info 'cp -fv obsidian.png ~/.obsidian' +cp -fv obsidian.png ~/.obsidian + +# create desktop shortcut +cat > "$(xdg-user-dir DESKTOP)"/Obsidian.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * cerebro +# * +# * @category productivity +# * @link https://cerebroapp.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'rm -rf ~/.cerebro' +rm -rf ~/.cerebro + +echo_info 'rm ~/.local/share/applications/appimagekit-cerebro.desktop' +rm ~/.local/share/applications/appimagekit-cerebro.desktop + diff --git a/recipe_dev_bash.sh b/recipe_dev_bash.sh new file mode 100755 index 0000000..28e63ce --- /dev/null +++ b/recipe_dev_bash.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * recipe dev bash +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to provision bash dev environement' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +# essentials +./dev/install_jq.sh +./dev/install_yq.sh + +# extra devtools +./dev/install_shellcheck.sh +./system/install_tree.sh +./system/install_xsel.sh + diff --git a/recipe_dev_essentials.sh b/recipe_dev_essentials.sh new file mode 100755 index 0000000..c920f80 --- /dev/null +++ b/recipe_dev_essentials.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * recipe dev essentials +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to provision essential dev environment' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +# git +./dev/install_git.sh +./dev/config_git.sh + +# github +./dev/install_github-cli.sh + +# ide +./ide/config_visualstudiocode.sh +./ide/install_visualstudiocode.sh +./ide/install_vim.sh + +# containers +./devops/install_docker-compose.sh +./devops/install_docker.io.sh + +# network +./network/config_known_ssh_hosts.sh +./network/install_filezilla.sh diff --git a/recipe_dev_extra.sh b/recipe_dev_extra.sh new file mode 100755 index 0000000..66abfd0 --- /dev/null +++ b/recipe_dev_extra.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * recipe dev extra +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to provision extra applications' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +# extra devtools +./dev/install_mkcert.sh +./devops/install_gcloud.sh + +# network +./network/install_awscli.sh +./network/install_nmap.sh +./network/install_remmina.sh +./network/install_sqlitebrowser.sh +./network/install_zenmap.sh diff --git a/recipe_dev_javascript.sh b/recipe_dev_javascript.sh new file mode 100755 index 0000000..720a3b8 --- /dev/null +++ b/recipe_dev_javascript.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# * + +#/** +# * recipe dev javascript +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to provision javascript dev environement' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +./dev/install_nodejs.sh + +# javascript esssentials +./dev/install_npm.sh +./dev/install_yarn.sh + +./dev/install_node-sass.sh +./dev/install_vue-cli.sh diff --git a/recipe_dev_php.sh b/recipe_dev_php.sh new file mode 100755 index 0000000..1833db0 --- /dev/null +++ b/recipe_dev_php.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * recipe dev php +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to provision javascript php environement' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +./dev/install_php.sh +./dev/config_php.sh + +./dev/install_php-modules.sh +./dev/config_php-xdebug.sh install + +# ide +./ide/config_phpstorm.sh +./ide/install_phpstorm.sh +./ide/config_jetbrains_gitignore.sh +./ide/install_ide-url-handler.sh + +# php / symfony +./dev/install_composer.sh +# ./dev/install_php-cs-fixer.sh +./dev/install_rector.sh +# ./dev/install_symfony-cli.sh + diff --git a/recipe_dev_python.sh b/recipe_dev_python.sh new file mode 100755 index 0000000..88a5597 --- /dev/null +++ b/recipe_dev_python.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. + +#/** +# * recipe dev python +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to provision javascript python environement' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +# ides +./ide/config_pycharm-community.sh +./ide/install_pycharm-community.sh diff --git a/recipe_essentials.sh b/recipe_essentials.sh new file mode 100755 index 0000000..c458626 --- /dev/null +++ b/recipe_essentials.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * recipe essentials +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/tools/src/colors/colors.sh" + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to provision essential applications' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +#/** +# * system essentials +# * these will most likely be required +# */ + +./dev/install_python3-pip.sh +./network/install_curl.sh +./system/install_make.sh + +#/** +# * system extra +# */ + +# gparted: partition manager +./system/install_gparted.sh + +#/** +# * office essentials +# */ + +# chrome: browser +./browser/install_chrome.sh +# text editor +./ide/config_sublime-text.sh +./ide/install_sublime-text.sh +# vlc: music/video player +./multimedia/install_vlc.sh +# libreoffice-calc: spread sheet editor +./office/install_libreoffice-calc.sh +# libreoffice-writer: rich text editor +./office/install_libreoffice-writer.sh +# gnome-clocks: alarm & world clock +./productivity/install_gnome-clocks.sh +# gnome-weather +./productivity/install_gnome-weather.sh + +#/** +# * config +# */ + +./system/config_grub.sh +./system/config_keyboard.sh + +# dconf-editor: gnome configuration manager +./system/install_dconf-editor.sh +./system/config_gnome_dconf.sh diff --git a/recipe_oh-my-zsh.sh b/recipe_oh-my-zsh.sh new file mode 100755 index 0000000..0cce785 --- /dev/null +++ b/recipe_oh-my-zsh.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +##/** +# * recipe essentials +# * +# * @author "Matthias Morin" +# * @license MIT +# * @link https://ohmyz.sh +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") + +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Install Oh-My-ZSH' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +#/** +# * Oh my zsh +# */ + +# 1. install_zsh +./system/install_zsh.sh +# 2. install_fonts +./fonts/install_fonts-powerline.sh +./fonts/install_nerd-fonts.sh +# 3. install_ohmyzsh +./themes/install_ohmyzsh.sh +# 4. install_tangoman-theme +./themes/install_tangoman-theme.sh +# 5. config_zsh NOTE: Script will stop here ! +./system/config_zsh.sh + diff --git a/recipe_server.sh b/recipe_server.sh new file mode 100755 index 0000000..f91b91f --- /dev/null +++ b/recipe_server.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * recipe server +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to provision server side environement' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +# config +./network/config_known_ssh_hosts.sh + +# ide +./ide/install_vim.sh + +# essential +./dev/install_git.sh +./network/install_curl.sh +./servers/install_apache2-utlis.sh +./system/install_make.sh + +# containers +./devops/install_docker.io.sh +./devops/install_docker-compose.sh + diff --git a/recipe_tangoman.sh b/recipe_tangoman.sh new file mode 100755 index 0000000..b5b9437 --- /dev/null +++ b/recipe_tangoman.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * recipe tangoman +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +./recipe_essentials.sh + +./recipe_dev_essentials.sh -n + +./recipe_dev_php.sh -n + +./recipe_dev_javascript.sh -n + +./recipe_dev_bash.sh -n + +#/** +# * Communication +# */ + +# ferdium: communication tool +./communication/install_ferdium.sh + +#/** +# * productivity +# */ + +./productivity/install_dropbox.sh + +#/** +# * config +# */ + +./themes/install_bootloader_theme.sh + +#/** +# * Oh my zsh +# */ + +./recipe_oh-my-zsh.sh -n + +./clean.sh diff --git a/remove_oh-my-zsh.sh b/remove_oh-my-zsh.sh new file mode 100755 index 0000000..1e7992c --- /dev/null +++ b/remove_oh-my-zsh.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove oh-my-zsh +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +UPDATE=true +OPTIND=0 +while getopts :nh OPTION; do + case "${OPTION}" in + n) UPDATE=false;; + h) echo_warning "$(basename "${0}")"; + echo_label 14 ' description:'; echo_primary 'Recipe to remove oh-my-zsh' + echo_label 14 ' usage:'; echo_primary "$(basename "${0}") -n (no-update) -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done +if [ "${UPDATE}" = true ]; then + ./update.sh + ./upgrade.sh +fi + +./themes/remove_ohmyzsh.sh + +./system/remove_zsh.sh + +./fonts/remove_fonts-powerline.sh + +./clean.sh diff --git a/security/install_aircrack-ng.sh b/security/install_aircrack-ng.sh new file mode 100755 index 0000000..1babe43 --- /dev/null +++ b/security/install_aircrack-ng.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * aircrack-ng +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install aircrack-ng' + +echo_info 'sudo apt-get install --assume-yes aircrack-ng' +sudo apt-get install --assume-yes aircrack-ng + diff --git a/security/install_beef.sh b/security/install_beef.sh new file mode 100755 index 0000000..dc37b00 --- /dev/null +++ b/security/install_beef.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * beef +# * +# * browser exploitation framework +# * +# * @category security +# * @link https://beefproject.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install beef' + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'apt-get install -y git'" + exit 1 +fi + +if [ ! -x "$(command -v ruby)" ]; then + echo_error "\"$(basename "${0}")\" requires ruby, try: 'apt-get install -y ruby'" + exit 1 +fi + +# clone project +echo_info 'git clone --depth 1 https://github.com/beefproject/beef ~/.beef' +git clone --depth 1 https://github.com/beefproject/beef ~/.beef + +# Install requirements from within the .beef folder +( + echo_info 'cd ~/.beef || exit 1' + cd ~/.beef || exit 1 + + # cleaning git cache + echo_info 'rm -rf .git' + rm -rf .git + + # install gems + if [ -w Gemfile.lock ]; then + rm -f Gemfile.lock + fi + + echo_info 'sudo ./install' + sudo ./install + + # change credentials + echo_info "sed -i -E '/^\s{8}user/ s/:\s*\"\w+\"/: \"root\"/' ./config.yaml" + sed -i -E '/^\s{8}user/ s/:\s*"\w+"/: "root"/' ./config.yaml + + echo_info "sed -i -E '/^\s{8}passwd/ s/:\s*\"\w+\"/: \"toor\"/' ./config.yaml" + sed -i -E '/^\s{8}passwd/ s/:\s*"\w+"/: "toor"/' ./config.yaml + + # use port 80 + echo_info "sed -i -E '/^\s{8}port/ s/:\s*\"[0-9]+\"/: \"80\"/' ./config.yaml" + sed -i -E '/^\s{8}port/ s/:\s*"[0-9]+"/: "80"/' ./config.yaml +) diff --git a/security/install_cerbot_apache.sh b/security/install_cerbot_apache.sh new file mode 100755 index 0000000..ec55e94 --- /dev/null +++ b/security/install_cerbot_apache.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * certbot let's encrypt +# * +# * @category security +# * @link https://certbot.eff.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install certbot-apache' + +echo_info 'sudo apt-get install --assume-yes software-properties-common' +sudo apt-get install --assume-yes software-properties-common + +echo_info 'sudo add-apt-repository --yes universe' +sudo add-apt-repository --yes universe + +echo_info 'sudo add-apt-repository --yes ppa:certbot/certbot' +sudo add-apt-repository --yes ppa:certbot/certbot + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes certbot python-certbot-apache ' +sudo apt-get install --assume-yes certbot python-certbot-apache + +echo_info 'sudo certbot --apache' +sudo certbot --apache + +# echo_info 'sudo certbot --apache certonly' +# sudo certbot --apache certonly + +echo_info 'sudo certbot renew --dry-run' +sudo certbot renew --dry-run diff --git a/security/install_cerbot_nginx.sh b/security/install_cerbot_nginx.sh new file mode 100755 index 0000000..64a034c --- /dev/null +++ b/security/install_cerbot_nginx.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * certbot let's encrypt +# * +# * @category security +# * @link https://certbot.eff.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install certbot-nginx' + +echo_info 'sudo apt-get install --assume-yes software-properties-common' +sudo apt-get install --assume-yes software-properties-common + +echo_info 'sudo add-apt-repository --yes universe' +sudo add-apt-repository --yes universe + +echo_info 'sudo add-apt-repository --yes ppa:certbot/certbot' +sudo add-apt-repository --yes ppa:certbot/certbot + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes certbot python-certbot-nginx ' +sudo apt-get install --assume-yes certbot python-certbot-nginx + +echo_info 'sudo certbot --nginx' +sudo certbot --nginx + +# echo_info 'sudo certbot --nginx certonly' +# sudo certbot --nginx certonly + +echo_info 'sudo certbot renew --dry-run' +sudo certbot renew --dry-run diff --git a/security/install_clamav.sh b/security/install_clamav.sh new file mode 100755 index 0000000..f628f13 --- /dev/null +++ b/security/install_clamav.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * clamav +# * +# * Virus scanner +# * +# * @category security +# * @link https://doc.ubuntu-fr.org/clamav +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install clamav' + +echo_info 'sudo apt-get install --assume-yes clamav' +sudo apt-get install --assume-yes clamav + +echo_info 'sudo apt-get install --assume-yes clamtk' +sudo apt-get install --assume-yes clamtk diff --git a/security/install_corkscrew.sh b/security/install_corkscrew.sh new file mode 100755 index 0000000..5c7de4e --- /dev/null +++ b/security/install_corkscrew.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * corkscrew +# * +# * Get ssh through firewall and proxies, with http tunneling +# * +# * ```shell +# * $ ssh -p 22 -o 'ProxyCommand corckscrew -p 192.168.1.1 8118 %h %p' -D 8080 user@remote.dev +# * ``` +# * +# * @category security +# * @link https://github.com/bryanpkc/corkscrew +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install corkscrew' + +echo_info 'sudo apt-get install --assume-yes corkscrew' +sudo apt-get install --assume-yes corkscrew + diff --git a/security/install_ettercap.sh b/security/install_ettercap.sh new file mode 100755 index 0000000..a1d292b --- /dev/null +++ b/security/install_ettercap.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ettercap +# * +# * Man in the middle attack suite +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install ettercap' + +echo_info 'sudo apt-get install --assume-yes ettercap-common ettercap-graphical' +sudo apt-get install --assume-yes ettercap-common ettercap-graphical + diff --git a/security/install_fluxion.sh b/security/install_fluxion.sh new file mode 100755 index 0000000..107b966 --- /dev/null +++ b/security/install_fluxion.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * fluxion +# * +# * Fake accces point generator MITM WPA attacks +# * +# * @category security +# * @link https://github.com/FluxionNetwork/fluxion +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install fluxion' + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +# clone project +echo_info 'git clone --depth 1 https://github.com/FluxionNetwork/fluxion ~/.fluxion' +git clone --depth 1 https://github.com/FluxionNetwork/fluxion ~/.fluxion + +# Install requirements from within the .fluxion folder +( + echo_info 'cd ~/.fluxion || exit 1' + cd ~/.fluxion || exit 1 + + # cleaning git cache + echo_info 'rm -rf .git' + rm -rf .git + + echo_info 'sudo ./fluxion.sh -i' + sudo ./fluxion.sh -i +) + diff --git a/security/install_hydra.sh b/security/install_hydra.sh new file mode 100755 index 0000000..247309d --- /dev/null +++ b/security/install_hydra.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * hydra +# * +# * bruteforce password tool +# * +# * @category security +# * @link https://sectools.org/tool/hydra +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install hydra' + +echo_info 'sudo apt-get install --assume-yes hydra' +sudo apt-get install --assume-yes hydra + +echo_info 'sudo apt-get install --assume-yes hydra-gtk' +sudo apt-get install --assume-yes hydra-gtk diff --git a/security/install_keepassxc.sh b/security/install_keepassxc.sh new file mode 100755 index 0000000..4352b9b --- /dev/null +++ b/security/install_keepassxc.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * KeePassXC +# * +# * Password manager +# * +# * @category security +# * @link https://keepassxc.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install KeePassXC' + +echo_info 'sudo apt-get install --assume-yes keepassxc' +sudo apt-get install --assume-yes keepassxc + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/org.keepassxc.KeePassXC.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/org.keepassxc.KeePassXC.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/security/install_knock.sh b/security/install_knock.sh new file mode 100755 index 0000000..b4735e1 --- /dev/null +++ b/security/install_knock.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * knock +# * +# * find unadvertised subdomains +# * +# * @category security +# * @link https://github.com/guelfoweb/knock +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install knock' + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +if [ ! -x "$(command -v python3)" ]; then + echo_error "\"$(basename "${0}")\" requires python3, try: 'sudo apt-get install -y python3'" + exit 1 +fi + +if [ ! -x "$(command -v pip3)" ]; then + echo_error "\"$(basename "${0}")\" requires pip3, try: 'sudo apt-get install -y pip3'" + exit 1 +fi + +# Make sure that the python package manager and yaml libraries are installed +# echo_info 'sudo apt-get install --assume-yes g++ python2.7 python-pip libyaml-dev python-dev libncurses5-dev' +# sudo apt-get install --assume-yes g++ python2.7 python-pip libyaml-dev python-dev libncurses5-dev + +echo_info 'git clone --depth 1 https://github.com/guelfoweb/knock ~/.knock' +git clone --depth 1 https://github.com/guelfoweb/knock ~/.knock + +echo_info 'pip3 install dnspython' +pip3 install dnspython + +# cleaning +echo_info 'rm -rf ~/.knock/.git' +rm -rf ~/.knock/.git + diff --git a/security/install_lazagne.sh b/security/install_lazagne.sh new file mode 100755 index 0000000..2b9d531 --- /dev/null +++ b/security/install_lazagne.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * LaZagne +# * +# * recover locally stored passwords +# * +# * @category security +# * @link https://github.com/AlessandroZ/LaZagne +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install LaZagne' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + + +if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'" + exit 1 +fi + +echo_info 'wget -q https://github.com/AlessandroZ/LaZagne/releases/download/1.0/Linux-64bits.zip' +wget -q https://github.com/AlessandroZ/LaZagne/releases/download/1.0/Linux-64bits.zip + +echo_info 'unzip Linux-64bits.zip -d ./' +unzip Linux-64bits.zip -d ./ + +echo_info 'mv ./Linux-64bits ~/.LaZagne' +mv ./Linux-64bits ~/.LaZagne + +echo_info 'chmod 755 ~/.LaZagne/LaZagne-64bits' +chmod 755 ~/.LaZagne/LaZagne-64bits + +echo_info 'rm -f ./Linux-64bits.zip' +rm -f ./Linux-64bits.zip + diff --git a/security/install_mana-toolkit.sh b/security/install_mana-toolkit.sh new file mode 100755 index 0000000..33d9097 --- /dev/null +++ b/security/install_mana-toolkit.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mana toolkit +# * +# * create fake wifi access point with sniffing and ssl stripping +# * +# * @category security +# * @note config = /etc/mana-toolkit/hostapd-mana.conf +# * @note start script = /usr/share/mana-toolkit/run-mana/start-nat-simple.sh +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install mana-toolkit' + +echo_info 'apt-get update' +apt-get update + +echo_info 'apt-get install --assume-yes build-essential pkg-config git libnl-genl-3-dev libssl-dev' +apt-get install --assume-yes build-essential pkg-config git libnl-genl-3-dev libssl-dev + +echo_info 'cd /tmp || exit 1' +cd /tmp || exit 1 + +echo_info 'git clone https://github.com/sensepost/hostapd-mana' +git clone https://github.com/sensepost/hostapd-mana + +echo_info 'cd hostapd-mana || exit 1' +cd hostapd-mana || exit 1 + +echo_info 'make -C hostapd' +make -C hostapd + +echo_info 'mv /tmp/hostapd-mana/hostapd/ /usr/lib/mana-toolkit' +mv /tmp/hostapd-mana/hostapd/ /usr/lib/mana-toolkit + +echo_info 'cd /usr/share/ || exit 1' +cd /usr/share/ || exit 1 + +echo_info 'git clone --depth 1 https://github.com/sensepost/mana.git ./mana-toolkit' +git clone --depth 1 https://github.com/sensepost/mana.git ./mana-toolkit + +echo_info 'mkdir /etc/mana-toolkit/' +mkdir /etc/mana-toolkit/ + +echo_info 'mv mana-toolkit/run-mana/conf/*.conf /etc/mana-toolkit/' +mv mana-toolkit/run-mana/conf/*.conf /etc/mana-toolkit/ diff --git a/security/install_nessus.sh b/security/install_nessus.sh new file mode 100755 index 0000000..4006ed2 --- /dev/null +++ b/security/install_nessus.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * nessus +# * +# * network scanner +# * +# * for kali download version: Nessus-8.3.1-debian6_amd64.deb +# * for ubuntu download version: Nessus-8.3.1-ubuntu1110_amd64.deb +# * connect to https://localhot:8834 +# * +# * @category security +# * @link https://www.tenable.com/downloads/nessus +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install nessus' + +APP_VERSION='Nessus-8.3.1-debian6_amd64.deb' + +if [ -e "${APP_VERSION}" ]; then + echo_info "dpkg -i ${APP_VERSION}" + dpkg -i ${APP_VERSION} + + # autostart + echo_info '/etc/init.d/nessusd start' + /etc/init.d/nessusd start + + echo_info 'update-rc.d nessusd enable' + update-rc.d nessusd enable +else + echo_error "cannot install, \"${APP_VERSION}\" not found" +fi diff --git a/security/install_openconnect.sh b/security/install_openconnect.sh new file mode 100755 index 0000000..36024fd --- /dev/null +++ b/security/install_openconnect.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * openconnect +# * +# * VPN client +# * +# * ``` +# * sudo openconnect --protocol=nc https://vpn.domainname.io -u username +# * ``` +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install openconnect' + +echo_info 'sudo apt-get install --assume-yes network-manager-openconnect-gnome' +sudo apt-get install --assume-yes network-manager-openconnect-gnome + diff --git a/security/install_openvpn.sh b/security/install_openvpn.sh new file mode 100755 index 0000000..61d2bc5 --- /dev/null +++ b/security/install_openvpn.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * openvpn +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install openvpn' + +echo_info 'sudo apt-get install --assume-yes openvpn' +sudo apt-get install --assume-yes openvpn + +echo_info 'sudo apt-get install --assume-yes network-manager-openvpn-gnome' +sudo apt-get install --assume-yes network-manager-openvpn-gnome + diff --git a/security/install_owasp_zap.sh b/security/install_owasp_zap.sh new file mode 100755 index 0000000..5f688d7 --- /dev/null +++ b/security/install_owasp_zap.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * OWASP ZAP +# * +# * @category security +# * @link https://www.zaproxy.org +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install OWASP ZAP' + +VERSION=2.12.0 +FOLDER_NAME=ZAP_${VERSION} +FILENAME=${FOLDER_NAME}_Linux.tar.gz +URL=https://github.com/zaproxy/zaproxy/releases/download/v${VERSION}/ZAP_${VERSION}_Linux.tar.gz +INSTALL_DIRECTORY=~/.local/share/OWASP/zap + +alert_primary "Install OWASP ZAP v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget \"${URL}\"" +wget "${URL}" + +# extract archive +echo_info "tar xvzf ${FILENAME}" +tar xvzf ${FILENAME} + +# create parent folder +echo_info "mkdir -p \"$(dirname "${INSTALL_DIRECTORY}")\"" +mkdir -p "$(dirname "${INSTALL_DIRECTORY}")" + +# move folder +echo_info "mv -fv \"${FOLDER_NAME}\" \"${INSTALL_DIRECTORY}\"" +mv -fv "${FOLDER_NAME}" "${INSTALL_DIRECTORY}" + +echo_info "rm -f \"${FILENAME}\"" +rm -f "${FILENAME}" + +# create desktop shortcut +cat > "$(xdg-user-dir DESKTOP)"/zap-zap.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * protonvpn +# * +# * @category security +# * @link https://protonvpn.com/support/official-linux-client +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install protonvpn' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +# install key +echo_info 'wget -qO - https://repo.protonvpn.com/debian/public_key.asc | sudo apt-key add - ' +wget -qO - https://repo.protonvpn.com/debian/public_key.asc | sudo apt-key add - + +# add repository +echo_info "sudo add-apt-repository -y 'deb https://repo.protonvpn.com/debian stable main'" +sudo add-apt-repository -y 'deb https://repo.protonvpn.com/debian stable main' + +# update repositories +echo_info 'sudo apt-get update' +sudo apt-get update + +# install app +echo_info 'sudo apt-get install --assume-yes protonvpn' +sudo apt-get install --assume-yes protonvpn + +# alert_info 'How to use protonvpn' +# echo_warning ' VPN' +# echo_label 18 ' protonvpn-cli'; echo_primary 'login [ProtonVPN username]' +# echo_label 18 ' protonvpn-cli'; echo_primary 'connect (or protonvpn-cli c)' +# echo_label 18 ' protonvpn-cli'; echo_primary 'status (or protonvpn-cli s)' +# echo_label 18 ' protonvpn-cli'; echo_primary 'disconnect (or protonvpn-cli d)' +# echo +# echo_warning ' Kill switch' +# echo_label 18 ' protonvpn-cli'; echo_primary 'ks --on' +# echo_label 18 ' protonvpn-cli'; echo_primary 'ks --always-on' +# echo_label 18 ' protonvpn-cli'; echo_primary 'ks --off' +# echo + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/protonvpn-app.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/protonvpn-app.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/security/install_rkhunter.sh b/security/install_rkhunter.sh new file mode 100755 index 0000000..f753ef0 --- /dev/null +++ b/security/install_rkhunter.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * rkhunter +# * +# * Rootkit scanner +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install rkhunter' + +echo_info 'sudo apt-get install --assume-yes rkhunter' +sudo apt-get install --assume-yes rkhunter + diff --git a/security/install_secrets.sh b/security/install_secrets.sh new file mode 100644 index 0000000..8a13627 --- /dev/null +++ b/security/install_secrets.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * secrets +# * +# * Manage KeePass databases +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install secrets' + +echo_info 'sudo apt-get install --assume-yes secrets' +sudo apt-get install --assume-yes secrets + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/org.gnome.World.Secrets.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/org.gnome.World.Secrets.desktop "$(xdg-user-dir DESKTOP)" diff --git a/security/install_sherlock.sh b/security/install_sherlock.sh new file mode 100755 index 0000000..f4e0f31 --- /dev/null +++ b/security/install_sherlock.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * sherlock +# * +# * Hunt down social media accounts by username across social networks +# * +# * ``` +# * cd ~/.sherlock/sherlock +# * python3 sherlock.py --csv --print-all USERNAMES +# * ``` +# * +# * @category security +# * @link https://github.com/sherlock-project/sherlock +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install sherlock' + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +if [ ! -x "$(command -v pip3)" ]; then + echo_error "\"$(basename "${0}")\" requires pip3, try: 'sudo apt-get install -y pip3'" + exit 1 +fi + +echo_info 'mkdir ~/.sherlock' +mkdir ~/.sherlock + +echo_info 'git clone --depth 1 https://github.com/sherlock-project/sherlock ~/.sherlock' +git clone --depth 1 https://github.com/sherlock-project/sherlock ~/.sherlock + +echo_info 'rm -rf ~/.sherlock/.git' +rm -rf ~/.sherlock/.git + +# echo_info 'sudo pip3 install --user --upgrade setuptools' +# sudo pip3 install --user --upgrade setuptools + +echo_info 'pip3 install --user -r ~/.sherlock/requirements.txt' +pip3 install --user -r ~/.sherlock/requirements.txt \ No newline at end of file diff --git a/security/install_theharvester.sh b/security/install_theharvester.sh new file mode 100755 index 0000000..7bff063 --- /dev/null +++ b/security/install_theharvester.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * theHarvester +# * +# * ``` +# * cd ~/.theHarvester && python3 theHarvester.py -d kali.org -l 500 -b google +# * ``` +# * +# * @category security +# * @link https://github.com/laramies/theHarvester +# * @link https://tools.kali.org/information-gathering/theharvester +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v python3)" ]; then + echo_error "\"$(basename "${0}")\" requires python, try: 'sudo apt-get install -y python3'" + exit 1 +fi + +if [ ! -x "$(command -v pip3)" ]; then + echo_error "\"$(basename "${0}")\" requires pip3, try: 'sudo apt-get install -y pip3'" + exit 1 +fi + +VERSION=$(get_latest_release laramies/theHarvester) +if [ -z "${VERSION}" ]; then + VERSION=3.2.4 +fi + +alert_primary "Install theHarvester v${VERSION}" + +echo_info "wget \"https://github.com/laramies/theHarvester/archive/${VERSION}.tar.gz\"" +wget "https://github.com/laramies/theHarvester/archive/${VERSION}.tar.gz" + +echo_info "tar xvzf \"${VERSION}.tar.gz\"" +tar xvzf "${VERSION}.tar.gz" + +echo_info "mv \"./theHarvester-${VERSION}\" ~/.theHarvester" +mv "./theHarvester-${VERSION}" ~/.theHarvester + +echo_info "rm -rf \"${VERSION}.tar.gz\"" +rm -rf "${VERSION}.tar.gz" + +echo_info 'pip3 install --user -r ~/.theHarvester/requirements.txt' +pip3 install --user -r ~/.theHarvester/requirements.txt \ No newline at end of file diff --git a/security/install_torbrowser.sh b/security/install_torbrowser.sh new file mode 100755 index 0000000..33c54af --- /dev/null +++ b/security/install_torbrowser.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * tor browser +# * +# * @link https://flathub.org/apps/org.torproject.torbrowser-launcher +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install torbrowser' + +if [ ! -x "$(command -v flatpak)" ]; then + echo_error "\"$(basename "${0}")\" requires flatpak, try: 'sudo apt-get install -y flatpak'" + exit 1 +fi + +echo_info 'flatpak install flathub org.torproject.torbrowser-launcher -y' +flatpak install flathub org.torproject.torbrowser-launcher -y + diff --git a/security/install_torbrowser_alt.sh b/security/install_torbrowser_alt.sh new file mode 100755 index 0000000..a7fd4b7 --- /dev/null +++ b/security/install_torbrowser_alt.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * tor browser +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install torbrowser' + +echo_info 'sudo apt-get install --assume-yes torbrowser-launcher' +sudo apt-get install --assume-yes torbrowser-launcher + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/torbrowser.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/torbrowser.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/security/install_twingate.sh b/security/install_twingate.sh new file mode 100755 index 0000000..0c8dbeb --- /dev/null +++ b/security/install_twingate.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * twingate +# * +# * VPN client +# * +# * | Command | Description | +# * |-----------------------|------------------------------------------------------| +# * | `sudo twingate setup` | Interactively configure the Twingate Client. | +# * | `twingate start` | Start the Twingate Client. | +# * | `twingate status` | Output Twingate Client status. | +# * | `twingate stop` | Stop the Twingate Client. | +# * | `twingate resources` | Show available Resources for the authenticated user. | +# * | `twingate help` | Show usage information. | +# * +# * @category security +# * @link https://www.twingate.com/docs/linux +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install twingate' + +echo_info 'curl -s https://binaries.twingate.com/client/linux/install.sh | sudo bash' +curl -s https://binaries.twingate.com/client/linux/install.sh | sudo bash + diff --git a/security/install_veil-evasion.sh b/security/install_veil-evasion.sh new file mode 100755 index 0000000..1e599fd --- /dev/null +++ b/security/install_veil-evasion.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * viel-evasion +# * +# * Generate undetectable meterpreter payloads +# * +# * @category security +# * @link https://github.com/Veil-Framework/Veil +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install viel-evasion' + +echo_info 'sudo apt-get install --assume-yes viel-evasion' +sudo apt-get install --assume-yes viel-evasion + diff --git a/security/install_weevely.sh b/security/install_weevely.sh new file mode 100755 index 0000000..4fd0109 --- /dev/null +++ b/security/install_weevely.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * weevely +# * +# * php web shell +# * +# * ```bash +# * weevely generate password123! /root/shell.php +# * weevely http://target-url.com/uploads/shell.php +# * ``` +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install weevely' + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +if [ ! -x "$(command -v python3)" ]; then + echo_error "\"$(basename "${0}")\" requires python3, try: 'sudo apt-get install -y python3'" + exit 1 +fi + +if [ ! -x "$(command -v pip3)" ]; then + echo_error "\"$(basename "${0}")\" requires pip3, try: 'sudo apt-get install -y pip3'" + exit 1 +fi + +# Make sure that the python package manager and yaml libraries are installed +# echo_info 'sudo apt-get install --assume-yes g++ python2.7 python-pip libyaml-dev python-dev libncurses5-dev' +# sudo apt-get install --assume-yes g++ python2.7 python-pip libyaml-dev python-dev libncurses5-dev + +# clone project +echo_info 'git clone --depth 1 https://github.com/epinna/weevely3.git ~/.weevely3' +git clone --depth 1 https://github.com/epinna/weevely3.git ~/.weevely3 + +# Install requirements from within the .weevely3 folder +( + echo_info 'cd ~/.weevely3 || exit 1' + cd ~/.weevely3 || exit 1 + + # cleaning git cache + echo_info 'rm -rf .git' + rm -rf .git + + echo_info 'sudo pip3 install -r requirements.txt --upgrade' + sudo pip3 install -r requirements.txt --upgrade +) + diff --git a/security/remove_protonvpn.sh b/security/remove_protonvpn.sh new file mode 100755 index 0000000..31bba8d --- /dev/null +++ b/security/remove_protonvpn.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * protonvpn +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_danger 'Remove protonvpn' + +# disable kill switch +echo_info 'protonvpn-cli ks --off' +protonvpn-cli ks --off + +# uninstall app +echo_info 'sudo apt-get autoremove protonvpn' +sudo apt-get autoremove protonvpn + +# clear cache +echo_info 'rm -rf ~/.cache/protonvpn' +rm -rf ~/.cache/protonvpn + +# remove config files +echo_info 'rm -rf ~/.config/protonvpn' +rm -rf ~/.config/protonvpn + +# remove repository +echo_info "sudo add-apt-repository --remove --yes 'deb https://repo.protonvpn.com/debian unstable main'" +sudo add-apt-repository --remove --yes 'deb https://repo.protonvpn.com/debian unstable main' + +# remove desktop link +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/protonvpn-app.desktop" +rm "$(xdg-user-dir DESKTOP)"/protonvpn-app.desktop + diff --git a/security/remove_torbrowser.sh b/security/remove_torbrowser.sh new file mode 100755 index 0000000..0fb0faf --- /dev/null +++ b/security/remove_torbrowser.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * tor browser +# * +# * @category security +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Remove torbrowser' + +echo_info 'sudo apt-get remove --assume-yes torbrowser-launcher' +sudo apt-get remove --assume-yes torbrowser-launcher + +# remove desktop shortcut +echo_info "rm \"$(xdg-user-dir DESKTOP)\"/torbrowser.desktop" +rm "$(xdg-user-dir DESKTOP)"/torbrowser.desktop + diff --git a/servers/config_samba.sh b/servers/config_samba.sh new file mode 100755 index 0000000..3309689 --- /dev/null +++ b/servers/config_samba.sh @@ -0,0 +1,386 @@ +#!/bin/sh +set -e + +#/* +# * This script is based on TangoMan Shoe Shell Microframework version 0.8.0-sm +# * +# * This file is distributed under to the MIT license. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * Permission is hereby granted, free of charge, to any person obtaining a copy +# * of this software and associated documentation files (the "Software"), to deal +# * in the Software without restriction, including without limitation the rights +# * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# * copies of the Software, and to permit persons to whom the Software is +# * furnished to do so, subject to the following conditions: +# * +# * The above copyright notice and this permission notice shall be included in all +# * copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# * SOFTWARE. +# * +# * Source code is available here: https://github.com/TangoMan75/shoe +# */ + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Config Samba +# * +# * Samba file sharing service (default service on ubuntu not NFS as one could expect) +# * +# * https://askubuntu.com/questions/888205/how-to-set-up-an-entire-hard-drive-as-a-shared-drive-in-samba +# * +# * @category servers +# * @link https://doc.ubuntu-fr.org/samba_smb.conf +# * @author "Matthias Morin" +# * @version 0.8.0-sm +# */ + +#-------------------------------------------------- +# Place your parameters after this line +#-------------------------------------------------- + +## Device name /[a-z0-9]+/ +device=sda1 + +#-------------------------------------------------- +# Place your functions after this line +#-------------------------------------------------- + +## Config Samba file sharing +config() { + set_global_config + create_share + validate + password + restart +} + +## Force user and force group on global config +set_global_config() { + echo_info "sudo sed -i \"s/\[global\]/[global]\n force user = ${USER}\n force group = ${USER}\n/\" /etc/samba/smb.conf\n" + sudo sed -i "s/\[global\]/[global]\n force user = ${USER}\n force group = ${USER}\n/" /etc/samba/smb.conf +} + +## Create full hard drive share +create_share() { + # should return a string containing mounted device path eg: /media/user/DATA + path_name=$(lsblk -l | grep ${device} | tr -s ' ' | cut -d' ' -f7) + + sudo tee --append /etc/samba/smb.conf <3) printf "%s ", substr($0, 5)}' "$0" +} + +_get_docbloc() { + awk -v TAG="$1" '/^#\/\*\*$/,/^# \*\/$/{if($3=="@"TAG){for(i=4;i<=NF;++i){printf "%s ",$i}}}' "$0" +} + +_get_padding() { + awk -F '=' '/^[a-zA-Z0-9_]+=.+$/ { MATCH = $1 } + /^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); + MATCH = substr($0, 1, index($0, "{")); + sub("{$", "", MATCH); + } { if (substr(PREV, 1, 3) == "## " && substr(MATCH, 1, 1) != "_" && length(MATCH) > LENGTH) LENGTH = length(MATCH) } + { PREV = $0 } END { print LENGTH+1 }' "$0" +} + +#-------------------------------------------------- +# Core +#-------------------------------------------------- + +_get_functions() { + # this regular expression matches functions with either bash or sh syntax + awk '/^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); # remove leading "function ", round brackets and extra spaces + FUNCTION = substr($0, 1, index($0, "{")); # truncate string after opening curly brace + sub("{$", "", FUNCTION); # remove trailing curly brace + if (substr(PREV, 1, 3) == "## " && substr($0, 1, 1) != "_") print FUNCTION + } { PREV = $0 }' "$0" +} + +_get_variables() { + # constants and private variables will be ignored + awk -F '=' '/^[a-zA-Z0-9_]+=.+$/ { + if (substr(PREV, 1, 3) == "## " && $1 != toupper($1) && substr($0, 1, 1) != "_")print $1 + } { PREV = $0 }' "$0" +} + +#-------------------------------------------------- +# Validation +#-------------------------------------------------- + +_get_constraints() { + awk -v NAME="$1" -F '=' '/^[a-zA-Z0-9_]+=.+$/ { + if (substr(PREV, 1, 3) == "## " && $1 == NAME) {match(PREV, /\/.+\//); print substr(PREV, RSTART, RLENGTH)} + } { PREV = $0 }' "$0" +} + +_validate() { + _validate_variable=$(printf '%s' "$1" | cut -d= -f1) + _validate_value=$(printf '%s' "$1" | cut -d= -f2) + _validate_pattern=$(_get_constraints "${_validate_variable}") + if [ -z "${_validate_pattern}" ]; then + return 0 + fi + if [ "${_validate_value}" != "$(printf '%s' "${_validate_value}" | awk "match(\$0, ${_validate_pattern}) {print substr(\$0, RSTART, RLENGTH)}")" ]; then + printf "${DANGER}error: invalid \"%s\", expected \"%s\", \"%s\" given${EOL}" "${_validate_variable}" "${_validate_pattern}" "${_validate_value}" + exit 1 + fi +} + +#-------------------------------------------------- +# Main loop +#-------------------------------------------------- + +_main() { + if [ $# -lt 1 ]; then + help + exit 0 + fi + + _error='' + _eval='' + _execute='' + _requires_value='' + for _argument in "$@"; do + _is_valid=false + # check if previous argument requires value + if [ -n "${_requires_value}" ]; then + _eval="${_eval} ${_requires_value}=${_argument}" + _requires_value='' + continue + fi + # check argument is a valid option (must start with - or --) + if [ -n "$(printf '%s' "${_argument}" | awk '/^--?[a-zA-Z0-9_]+$/{print}')" ]; then + for _variable in $(_get_variables); do + # get shorthand character + _shorthand="$(printf '%s' "${_variable}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "--${_variable}" ] || [ "${_argument}" = "-${_shorthand}" ]; then + _requires_value="${_variable}" + _is_valid=true + break + fi + done + if [ "${_is_valid}" = false ]; then + _error="\"${_argument}\" is not a valid option" + break + fi + continue + fi + for _function in $(_get_functions); do + # get shorthand character + _shorthand="$(printf '%s' "${_function}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "${_function}" ] || [ "${_argument}" = "${_shorthand}" ]; then + # append argument to the execute stack + _execute="${_execute} ${_function}" + _is_valid=true + break + fi + done + if [ "${_is_valid}" = false ]; then + _error="\"${_argument}\" is not a valid command" + break + fi + done + + if [ -n "${_requires_value}" ]; then + _error="\"--${_requires_value}\" requires value" + fi + + if [ -n "${_error}" ]; then + printf "${DANGER}error: %s${EOL}" "${_error}" + exit 1 + fi + + for _variable in ${_eval}; do + # invalid parameters will raise errors + _validate "${_variable}" + eval "${_variable}" + done + + for _function in ${_execute}; do + eval "${_function}" + done +} + +_main "$@" diff --git a/servers/config_traefik.sh b/servers/config_traefik.sh new file mode 100755 index 0000000..a5fe0a8 --- /dev/null +++ b/servers/config_traefik.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config traefik +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +CONFIG_DIR="${CURDIR}/../config" + +# config traefik +echo_info "sudo cp -Rfv \"${CONFIG_DIR}/etc/traefik/ /etc/traefik/\"" +sudo cp -Rfv "${CONFIG_DIR}/etc/traefik/ /etc/traefik/" + diff --git a/servers/install_apache2-utlis.sh b/servers/install_apache2-utlis.sh new file mode 100755 index 0000000..1f4467c --- /dev/null +++ b/servers/install_apache2-utlis.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * apache2-utils +# * +# * ``` +# * $ htpasswd -nb admin secure_password +# * ``` +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes apache2-utils' +sudo apt-get install --assume-yes apache2-utils + diff --git a/servers/install_apache2.sh b/servers/install_apache2.sh new file mode 100755 index 0000000..48ec3fa --- /dev/null +++ b/servers/install_apache2.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * apache2 +# * +# * web server +# * +# * ``` +# * $ sudo systemctl start apache2 +# * ``` +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo add-apt-repository --yes ppa:ondrej/apache2' +sudo add-apt-repository --yes ppa:ondrej/apache2 + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes apache2' +sudo apt-get install --assume-yes apache2 diff --git a/servers/install_mongodb-org.sh b/servers/install_mongodb-org.sh new file mode 100755 index 0000000..8639065 --- /dev/null +++ b/servers/install_mongodb-org.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mongodb-org +# * database server +# * +# * ``` +# * # Verify that MongoDB has started successfully. +# * $ sudo systemctl status mongod +# * # Autostart after reboot +# * $ sudo systemctl enable mongod +# * ``` +# * +# * @category servers +# * @link https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes gnupg' +sudo apt-get install --assume-yes gnupg + +# import the public key used by the package management system. +echo_info 'wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -' +wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - + +# create a list file for MongoDB +echo_info "echo 'deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list" +echo 'deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes mongodb-org' +sudo apt-get install --assume-yes mongodb-org + diff --git a/servers/install_mysql-server.sh b/servers/install_mysql-server.sh new file mode 100755 index 0000000..8046bee --- /dev/null +++ b/servers/install_mysql-server.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mysql-server +# * database server +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info "sudo add-apt-repository --yes \"deb http://repo.mysql.com/apt/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ $(lsb_release -cs) mysql-5.7\"" +sudo add-apt-repository --yes "deb http://repo.mysql.com/apt/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ $(lsb_release -cs) mysql-5.7" + +# echo_info "sudo add-apt-repository --yes \"deb http://repo.mysql.com/apt/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ $(lsb_release -cs) mysql-8.0\"" +# sudo add-apt-repository --yes "deb http://repo.mysql.com/apt/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ $(lsb_release -cs) mysql-8.0" + +echo_info "sudo add-apt-repository --yes \"deb http://repo.mysql.com/apt/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ $(lsb_release -cs) mysql-tools\"" +sudo add-apt-repository --yes "deb http://repo.mysql.com/apt/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ $(lsb_release -cs) mysql-tools" + +echo_info "sudo apt-get update" +sudo apt-get update + +# create config file when not found +test -f /etc/mysql/mysql.cnf || sudo touch /etc/mysql/mysql.cnf + +echo_info 'sudo apt-get install --assume-yes --allow-unauthenticated mysql-server' +sudo apt-get install --assume-yes --allow-unauthenticated mysql-server + +# set mysql default password (root) +echo_info "sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'" +sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' + +echo_info "sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'" +sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' + +# check mysql installed version +echo_info 'mysql --version' +mysql --version + +# check status +sudo systemctl status mysql + +# config mysql +sudo chown -R "${USER}:${USER}" /etc/mysql/mysql.conf.d/mysqld.cnf +echo 'port = 3306'>>/etc/mysql/mysql.conf.d/mysqld.cnf +echo 'sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'>>/etc/mysql/mysql.conf.d/mysqld.cnf + +# for dev only +#sudo mysql -u root --execute="CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin'; GRANT ALL PRIVILEGES ON *.* to 'admin'@'localhost'; FLUSH PRIVILEGES;" +#sudo mysql -u root --execute="CREATE DATABASE prestashop;" +#sudo mysql -u root --execute="USE prestashop;" + +# firewall allows remote access +echo_info 'sudo ufw allow mysql' +sudo ufw allow mysql + +# start the mysql service +echo_info 'sudo systemctl start mysql' +sudo systemctl start mysql + +# launch at reboot +echo_info 'sudo systemctl enable mysql' +sudo systemctl enable mysql diff --git a/servers/install_nfs-server.sh b/servers/install_nfs-server.sh new file mode 100755 index 0000000..8bea8f8 --- /dev/null +++ b/servers/install_nfs-server.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * nfs-server +# * nfs file sharing server +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes nfs-common' +sudo apt-get install --assume-yes nfs-common + +echo_info 'sudo apt-get install --assume-yes nfs-kernel-server' +sudo apt-get install --assume-yes nfs-kernel-server + +echo_info 'sudo apt-get install --assume-yes nfs-server' +sudo apt-get install --assume-yes nfs-server + +# starting nfs-kernel-server +echo_info 'sudo service nfs-kernel-server start' +sudo service nfs-kernel-server start + diff --git a/servers/install_nginx.sh b/servers/install_nginx.sh new file mode 100755 index 0000000..82dd48a --- /dev/null +++ b/servers/install_nginx.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ngnix +# * web server +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'wget http://nginx.org/keys/nginx_signing.key' +wget http://nginx.org/keys/nginx_signing.key + +echo_info 'sudo apt-key add nginx_signing.key' +sudo apt-key add nginx_signing.key + +echo_info 'rm -f nginx_signing.key' +rm -f nginx_signing.key + +# add repository +echo_info "sudo add-apt-repository --yes -u \"deb http://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx\"" +sudo add-apt-repository --yes -u "deb http://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx" + +# update nginx ppa +echo_info 'sudo add-apt-repository --yes ppa:ondrej/nginx' +sudo add-apt-repository --yes ppa:ondrej/nginx + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes --allow-unauthenticated nginx' +sudo apt-get install --assume-yes --allow-unauthenticated nginx + +# # add www-data to nginx group +# echo_info 'sudo usermod -aG www-data nginx' +# sudo usermod -aG www-data nginx + +# # create basic dev.local +# echo_info 'sudo mv -fv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak' +# sudo mv -fv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak + +# echo_info 'sudo mv -fv ./config/etc/nginx/dev.local.conf /etc/nginx/dev.local.conf' +# sudo mv -fv ./config/etc/nginx/dev.local.conf /etc/nginx/dev.local.conf + +# # create /opt/www folder +# echo_info 'sudo mkdir -p /opt/www' +# sudo mkdir -p /opt/www + +# echo_info 'sudo chown -R www-data:www-data /opt/www' +# sudo chown -R www-data:www-data /opt/www + +# echo_info 'sudo chmod -R 0775 /opt/www' +# sudo chmod -R 0775 /opt/www + +# # configure hosts +# echo_info 'sudo echo "127.0.0.1 dev.local">>/etc/hosts' +# sudo echo "127.0.0.1 dev.local">>/etc/hosts diff --git a/servers/install_openssh-server.sh b/servers/install_openssh-server.sh new file mode 100755 index 0000000..b203346 --- /dev/null +++ b/servers/install_openssh-server.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * openssh-server +# * secure shell protocol +# * +# * Start ssh server +# * sudo systemctl start ssh +# * +# * Stop ssh server +# * sudo systemctl stop ssh +# * +# * Restart ssh server +# * sudo systemctl restart ssh +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install openssh-server' + +echo_info 'sudo apt-get install --assume-yes openssh-server' +sudo apt-get install --assume-yes openssh-server + +# create autostart shortcut +cat > ~/.config/autostart/openssh-server.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * mysql-server +# * database server +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'sudo apt-get install --assume-yes wget ca-certificates' +sudo apt-get install --assume-yes wget ca-certificates + +echo_info 'wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -' +wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - + +echo_info "sudo sh -c 'echo \"deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main\" >> /etc/apt/sources.list.d/pgdg.list'" +sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install postgresql postgresql-contrib' +sudo apt-get install postgresql postgresql-contrib diff --git a/servers/install_redis-server.sh b/servers/install_redis-server.sh new file mode 100755 index 0000000..62f6f1d --- /dev/null +++ b/servers/install_redis-server.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * redis-server +# * cache server +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes redis-server' +sudo apt-get install --assume-yes redis-server diff --git a/servers/install_samba.sh b/servers/install_samba.sh new file mode 100755 index 0000000..625153b --- /dev/null +++ b/servers/install_samba.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * samba +# * +# * samba file sharing service (default service on ubuntu not NFS as one could expect) +# * +# * NOTE: use `config_samba.sh` to configure service +# * +# * @category servers +# * @note config here: /etc/samba/smb.conf +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Samba' + +echo_info 'sudo apt-get install --assume-yes samba' +sudo apt-get install --assume-yes samba diff --git a/servers/install_traefik.sh b/servers/install_traefik.sh new file mode 100755 index 0000000..4fa5f0a --- /dev/null +++ b/servers/install_traefik.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * traefik +# * +# * usage: sudo traefik --accesslog=true --api=true --api.insecure=true --api.dashboard=true --api.debug=true --log.level=INFO +# * +# * ``` +# * http://localhost:8080/api/rawdata +# * http://localhost:8080/dashboard +# * ``` +# * +# * @category servers +# * @link https://doc.traefik.io/traefik/getting-started/quick-start/ +# * @link https://raw.githubusercontent.com/containous/traefik/v2.3/traefik.sample.toml +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +REPOSITORY=traefik/traefik +VERSION=2.4.8 +FILENAME=traefik_v${VERSION}_linux_amd64.tar.gz + +alert_primary "Install traefik v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "wget -qO traefik.tar.gz \"https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}\"" +wget -qO traefik.tar.gz "https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}" + +# extract tar file +echo_info 'tar xzvf traefik.tar.gz' +tar xzvf traefik.tar.gz + +# install traefik globally +echo_info 'sudo mv -fv traefik /usr/local/bin/traefik' +sudo mv -fv traefik /usr/local/bin/traefik + +# set executable permissions +echo_info 'sudo chmod uga+x /usr/local/bin/traefik' +sudo chmod uga+x /usr/local/bin/traefik + +echo_info 'sync' +sync + +echo_info 'rm LICENSE.md CHANGELOG.md traefik.tar.gz' +rm LICENSE.md CHANGELOG.md traefik.tar.gz diff --git a/servers/remove_apache2.sh b/servers/remove_apache2.sh new file mode 100755 index 0000000..4bef4c6 --- /dev/null +++ b/servers/remove_apache2.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove apache2 +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes apache2' +sudo apt-get purge --assume-yes apache2 + +echo_info 'sudo rm -rf /var/lib/apache2' +sudo rm -rf /var/lib/apache2 + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/servers/remove_mysql.sh b/servers/remove_mysql.sh new file mode 100755 index 0000000..10a4651 --- /dev/null +++ b/servers/remove_mysql.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove mysql-server +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes mysql-server' +sudo apt-get purge --assume-yes mysql-server + +echo_info 'sudo apt-get purge --assume-yes libmysqlclient20' +sudo apt-get purge --assume-yes libmysqlclient20 + +echo_info 'sudo apt-get purge --assume-yes libmysqlcppconn7v5' +sudo apt-get purge --assume-yes libmysqlcppconn7v5 + +echo_info 'sudo apt-get purge --assume-yes mysql-client-5.7' +sudo apt-get purge --assume-yes mysql-client-5.7 + +echo_info 'sudo apt-get purge --assume-yes mysql-client-core-5.7' +sudo apt-get purge --assume-yes mysql-client-core-5.7 + +echo_info 'sudo apt-get purge --assume-yes mysql-common' +sudo apt-get purge --assume-yes mysql-common + +echo_info 'sudo apt-get purge --assume-yes mysql-server-5.7' +sudo apt-get purge --assume-yes mysql-server-5.7 + +echo_info 'sudo apt-get purge --assume-yes mysql-server-core-5.7' +sudo apt-get purge --assume-yes mysql-server-core-5.7 + +echo_info 'sudo apt-get purge --assume-yes mysql-utilities' +sudo apt-get purge --assume-yes mysql-utilities + +for VERSION in '' 5.6 7.0 7.1 7.2 7.3; do + echo_info "sudo apt-get purge --assume-yes php${VERSION}-mysql" + sudo apt-get purge --assume-yes php${VERSION}-mysql +done + +echo_info 'sudo rm -rf /etc/mysql' +sudo rm -rf /etc/mysql + +echo_info 'sudo rm -rf /var/lib/mysql' +sudo rm -rf /var/lib/mysql + +echo_info 'sudo rm -rf /var/lib/mysql-files' +sudo rm -rf /var/lib/mysql-files + +echo_info 'sudo rm -rf /var/lib/mysql-keyring' +sudo rm -rf /var/lib/mysql-keyring + +echo_info 'sudo rm -rf /var/lib/mysql-upgrade' +sudo rm -rf /var/lib/mysql-upgrade + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/servers/remove_nfs.sh b/servers/remove_nfs.sh new file mode 100755 index 0000000..e628f65 --- /dev/null +++ b/servers/remove_nfs.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove nfs file sharing server +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# stopping nfs-kernel-server +echo_info 'sudo service nfs-kernel-server stop' +sudo service nfs-kernel-server stop + +# uninstall nfs server +echo_warning 'uninstall nfs' + +echo_info 'sudo dpkg --purge nfs-kernel-server' +sudo dpkg --purge nfs-kernel-server + +echo_info 'sudo dpkg --purge nfs-common' +sudo dpkg --purge nfs-common + diff --git a/servers/remove_samba.sh b/servers/remove_samba.sh new file mode 100755 index 0000000..5729533 --- /dev/null +++ b/servers/remove_samba.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * samba +# * samba file sharing service +# * +# * @category servers +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get remove --assume-yes samba' +sudo apt-get remove --assume-yes samba + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/system/config_bash_aliases.sh b/system/config_bash_aliases.sh new file mode 100755 index 0000000..3bda4bf --- /dev/null +++ b/system/config_bash_aliases.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config bash_aliases +# * +# * @category system +# */ + +# shellcheck disable=SC2028 +echo "printf \"\\033[0;36m _____%17s_____\\n|_ _|___ ___ ___ ___|%5s|___ ___\\n | | | .'| | . | . | | | | .'| |\\n |_| |__,|_|_|_ |___|_|_|_|__,|_|_|\\n%14s|___|%6stangoman.io\\033[0m\\n\"" >> ~/.bash_aliases diff --git a/system/config_dell_inspiron_keyboard.sh b/system/config_dell_inspiron_keyboard.sh new file mode 100755 index 0000000..4f4f7a8 --- /dev/null +++ b/system/config_dell_inspiron_keyboard.sh @@ -0,0 +1,435 @@ +#!/bin/sh +set -e + +#/* +# * This script is based on TangoMan Shoe Shell Microframework version 0.8.0-xxs +# * +# * This file is distributed under to the MIT license. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * Permission is hereby granted, free of charge, to any person obtaining a copy +# * of this software and associated documentation files (the "Software"), to deal +# * in the Software without restriction, including without limitation the rights +# * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# * copies of the Software, and to permit persons to whom the Software is +# * furnished to do so, subject to the following conditions: +# * +# * The above copyright notice and this permission notice shall be included in all +# * copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# * SOFTWARE. +# * +# * Source code is available here: https://github.com/TangoMan75/shoe +# */ + +#/** +# * Configure Dell Inspiron keyboard +# * +# * This bash script modifies the keyboard layout configuration file (/usr/share/X11/xkb/symbols/pc) +# * to swap the functionality of the F11 and F12 keys with the Home and End keys, respectively. +# * +# * @category system +# * @author "Matthias Morin" +# * @version 0.8.0-xxs +# * @link https://github.com/TangoMan75/provisions +# * @link https://help.ubuntu.com/community/Custom%20keyboard%20layout%20definitions +# */ + +#-------------------------------------------------- +# Place your constants after this line +#-------------------------------------------------- + +CONFIG_DIR="${CURDIR}/../config" + +#-------------------------------------------------- + +## Default +run() { + insert_xkb_symbols +} + +## Open +open() { + echo_info 'sudo subl /usr/share/X11/xkb/symbols/pc\n' + sudo subl /usr/share/X11/xkb/symbols/pc +} + +## Config by editing xkb symbols +insert_xkb_symbols() { + backup_xkb_symbols + RELEASE="$(lsb_release -cs)" + if [ "${RELEASE}" = focal ]; then + _insert_xkb_symbols_focal + + elif [ "${RELEASE}" = noble ]; then + _insert_xkb_symbols_noble + + else + echo_error "Cannot configure \"${RELEASE}\", invalid version" + return 1 + fi + clear_xkb_cache +} + +## Config by editing xkb symbols +_insert_xkb_symbols_focal() { + # remove previous configuration : + # search for any line containing `key ` (for F11) and `key ` (for F12) + # using regular expressions `/.*key .*/`. + # If found, the d command deletes those lines. + # This effectively removes any existing definitions for the F11 and F12 keys. + + echo_info "sudo sed -i '/.*key .*/d' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '/.*key .*/d' /usr/share/X11/xkb/symbols/pc + + echo_info "sudo sed -i '/.*key .*/d' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '/.*key .*/d' /usr/share/X11/xkb/symbols/pc + + # Insert configuration : + # The `16i` part instructs `sed` to insert the following content at line 16 of the file. + # (Line must be inserted after `include "keypad(x11)"`) + # The inserted content defines new key mappings: + # Line 3: key now sends End keystroke. + # Line 4: key now sends Home keystroke. + + echo_info "sudo sed -i '16i\ key { [ End, End, End, End ] };' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '16i\ key { [ End, End, End, End ] };' /usr/share/X11/xkb/symbols/pc + + echo_info "sudo sed -i '16i\ key { [ Home, Home, Home, Home ] };' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '16i\ key { [ Home, Home, Home, Home ] };' /usr/share/X11/xkb/symbols/pc + + # remap the keys associated with "" and "" + # to generate the F11 or F12 key press (based on the replacement string). + + echo_info "sudo sed -i '/key /s/\[.*\]/[ F11, F11, F11, F11 ]/' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '/key /s/\[.*\]/[ F11, F11, F11, F11 ]/' /usr/share/X11/xkb/symbols/pc + + echo_info "sudo sed -i '/key /s/\[.*\]/[ F12, F12, F12, F12 ]/' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '/key /s/\[.*\]/[ F12, F12, F12, F12 ]/' /usr/share/X11/xkb/symbols/pc +} + +## Config by editing xkb symbols +_insert_xkb_symbols_noble() { + # remove previous configuration : + echo_info "sudo sed -i '/.*key .*/d' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '/.*key .*/d' /usr/share/X11/xkb/symbols/pc + + echo_info "sudo sed -i '/.*key .*/d' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '/.*key .*/d' /usr/share/X11/xkb/symbols/pc + + # Insert configuration : + # The `75i` part instructs `sed` to insert the following content at line 75 of the file. + # (Line must be inserted after `include "keypad(x11)"`) + + echo_info "sudo sed -i '75i\ key {[ End, End ]};' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '75i\ key {[ End, End ]};' /usr/share/X11/xkb/symbols/pc + + echo_info "sudo sed -i '75i\ key {[ Home, Home ]};' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '75i\ key {[ Home, Home ]};' /usr/share/X11/xkb/symbols/pc + + # remap the keys associated with "" and "" + # to generate the F11 or F12 key press (based on the replacement string). + + echo_info "sudo sed -i '/key /s/\[.*\]/[ F11 ]/' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '/key /s/\[.*\]/[ F11 ]/' /usr/share/X11/xkb/symbols/pc + + echo_info "sudo sed -i '/key /s/\[.*\]/[ F12 ]/' /usr/share/X11/xkb/symbols/pc\n" + sudo sed -i '/key /s/\[.*\]/[ F12 ]/' /usr/share/X11/xkb/symbols/pc + +} + +## Backup xkb symbols +backup_xkb_symbols() { + CONFIG_DIR="$(dirname "$(realpath "$0")")/../config" + SOURCE=/usr/share/X11/xkb/symbols + DESTINATION=${CONFIG_DIR}${SOURCE} + FILENAME="pc_$(lsb_release -cs | tail).bkp" + + if [ ! -f "${DESTINATION}/${FILENAME}" ]; then + echo_info "cp -f \"${SOURCE}/pc\" \"${DESTINATION}/${FILENAME}\"\n" + cp -f "${SOURCE}/pc" "${DESTINATION}/${FILENAME}" + fi +} + +## Restore xkb symbols +restore_xkb_symbols() { + CONFIG_DIR="$(dirname "$(realpath "$0")")/../config" + SOURCE=/usr/share/X11/xkb/symbols + DESTINATION=${CONFIG_DIR}${SOURCE} + FILENAME="pc_$(lsb_release -cs | tail).bkp" + + if [ ! -f "${DESTINATION}/${FILENAME}" ]; then + echo_info "cp -f \"${DESTINATION}/${FILENAME}\" \"${SOURCE}/pc\"\n" + cp -f "${DESTINATION}/${FILENAME}" "${SOURCE}/pc" + fi + + clear_xkb_cache +} + +## Clear xkb cache +clear_xkb_cache() { + echo_info 'sudo rm -rf /var/lib/xkb/*\n' + sudo rm -rf /var/lib/xkb/* + + echo_info 'sudo dpkg-reconfigure xkb-data\n' + sudo dpkg-reconfigure xkb-data +} + +## Config with xmodmap (not recommended) +config_xmodmap() { + if [ ! -x "$(command -v xmodmap)" ]; then + echo_error "\"$(basename "${0}")\" requires xmodmap, try: 'sudo apt-get install -y xmodmap'\n" + return 1 + fi + +echo_info 'cat <\n' + echo_label 10 ' version'; echo_primary '0.8.0-xxs\n' + echo_label 10 ' link'; echo_primary 'https://github.com/TangoMan75/shoe\n\n' + echo_warning 'Description:\n' + echo_primary ' Create self documented shell scripts with argument validation easily. Prefix a comment with two pound signs on the previous line of any function or variable you want documented with the "help" command.\n\n' | fold -w 64 -s + echo_warning 'Usage:\n' + printf "%b sh $(basename "${0}") [%bcommand%b]\n\n" "${INFO}" "${SUCCESS}" "${INFO}" + _print_commands 10 +} + +#-------------------------------------------------- + +_print_commands() { + # $1 = padding + if [ -z "$1" ]; then set -- 12; fi + printf "%bCommands:%b\n" "${WARNING}" "${DEFAULT}" + awk "/^### /{printf\"\n${WARNING}%s:${EOL}\",substr(\$0,5)} + /^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub(\"^function \",\"\"); gsub(\"[ ()]\",\"\"); + FUNCTION = substr(\$0, 1, index(\$0, \"{\")); + sub(\"{\$\", \"\", FUNCTION); + if (substr(PREV, 1, 3) == \"## \" && substr(\$0, 1, 1) != \"_\") + printf \"${SUCCESS} %-$1s ${DEFAULT}%s\n\", FUNCTION, substr(PREV, 4) + } { PREV = \$0 }" "$0" + printf '\n' +} + +#-------------------------------------------------- +# Core +#-------------------------------------------------- + +_get_functions() { + # this regular expression matches functions with either bash or sh syntax + awk '/^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); # remove leading "function ", round brackets and extra spaces + FUNCTION = substr($0, 1, index($0, "{")); # truncate string after opening curly brace + sub("{$", "", FUNCTION); # remove trailing curly brace + if (substr(PREV, 1, 3) == "## " && substr($0, 1, 1) != "_") print FUNCTION + } { PREV = $0 }' "$0" +} + +#-------------------------------------------------- +# Main loop +#-------------------------------------------------- + +_main() { + if [ $# -lt 1 ]; then + help + exit 0 + fi + + _execute='' + for _argument in "$@"; do + _is_valid=false + for _function in $(_get_functions); do + # get shorthand character + _shorthand="$(printf '%s' "${_function}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "${_function}" ] || [ "${_argument}" = "${_shorthand}" ]; then + # append argument to the execute stack + _execute="${_execute} ${_function}" + _is_valid=true + break + fi + done + # unknown parameters will raise errors + if [ "${_is_valid}" = false ]; then + printf "${DANGER}error: \"%s\" is not a valid command${EOL}" "${_argument}" + exit 1 + fi + done + + for _function in ${_execute}; do + eval "${_function}" + done +} + +_main "$@" diff --git a/system/config_disable_wifi_powersave.sh b/system/config_disable_wifi_powersave.sh new file mode 100755 index 0000000..0fb65eb --- /dev/null +++ b/system/config_disable_wifi_powersave.sh @@ -0,0 +1,272 @@ +#!/bin/bash +set -e + +#/* +# * This script is based on TangoMan Shoe Shell Microframework version 0.8.0-xxs +# * +# * This file is distributed under to the MIT license. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * Permission is hereby granted, free of charge, to any person obtaining a copy +# * of this software and associated documentation files (the "Software"), to deal +# * in the Software without restriction, including without limitation the rights +# * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# * copies of the Software, and to permit persons to whom the Software is +# * furnished to do so, subject to the following conditions: +# * +# * The above copyright notice and this permission notice shall be included in all +# * copies or substantial portions of the Software. +# * +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# * SOFTWARE. +# * +# * Source code is available here: https://github.com/TangoMan75/shoe +# */ + +#/** +# * Configure Disable Wifi Powersave +# * +# * @deprecated +# * @category system +# * @author "Matthias Morin" +# * @version 0.8.0-xxs +# * @link https://unix.stackexchange.com/questions/269661/how-to-turn-off-wireless-power-management-permanently +# */ + +#-------------------------------------------------- +# Place your constants after this line +#-------------------------------------------------- + +## Disable all +disable_all() { + disable_conf + disable_pcie +} + +## Enable all +enable_all() { + enable_conf + enable_pcie +} + +## Print current wifi config +status() { + echo_info 'iwconfig' + iwconfig +} + +## Disable power management with nmcli (temporary) +disable_nmcli() { + # Check nmcli installation + if [ ! -x "$(command -v nmcli)" ]; then + echo_error "\"$(basename "${0}")\" requires nmcli, try: 'sudo apt-get install -y nmcli'\n" + return 1 + fi + + device="$(nmcli connection show --active | grep -m1 wifi | awk '{print $NF}')" + if [ -z "${device}" ]; then + echo_error 'no network connection found.\n' + return 1 + fi + + echo_info "sudo iwconfig \"${device}\" power off" + sudo iwconfig "${device}" power off +} + +## Disable power management from "NetworkManager/conf.d" (permanent) +disable_conf() { + echo_info "sudo sed -i -E '/wifi.powersave =/s/[0-9]+/2/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf\n" + sudo sed -i -E '/wifi.powersave =/s/[0-9]+/2/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf +} + +## Re-enable power management from "NetworkManager/conf.d" +enable_conf() { + echo_info "sudo sed -i -E '/wifi.powersave =/s/[0-9]+/3/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf\n" + sudo sed -i -E '/wifi.powersave =/s/[0-9]+/3/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf +} + +## Disable PCIe Active State Power from grub +disable_pcie() { + # pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power + # Management. + # off Disable ASPM. + # force Enable ASPM even on devices that claim not to support it. + # WARNING: Forcing ASPM on may cause system lockups. + + echo_success 'Disable PCIe Active State Power\n' + # remove default grub style if any + echo_info "sudo sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/d' /etc/default/grub\n" + sudo sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/d' /etc/default/grub + + echo_info "sudo bash -c \"echo 'GRUB_CMDLINE_LINUX_DEFAULT=\"pcie_aspm=off\"' >> /etc/default/grub\"\n" + sudo bash -c "echo 'GRUB_CMDLINE_LINUX_DEFAULT=\"pcie_aspm=off\"' >> /etc/default/grub" + + update_grub +} + +## Enable PCIe Active State Power from grub +enable_pcie() { + # pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power + # Management. + # off Disable ASPM. + # force Enable ASPM even on devices that claim not to support it. + # WARNING: Forcing ASPM on may cause system lockups. + + echo_success 'Disable PCIe Active State Power\n' + # remove default grub style if any + echo_info "sudo sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/d' /etc/default/grub\n" + sudo sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/d' /etc/default/grub + + echo_info "sudo bash -c \"echo 'GRUB_CMDLINE_LINUX_DEFAULT=\"\"' >> /etc/default/grub\"\n" + sudo bash -c "echo 'GRUB_CMDLINE_LINUX_DEFAULT=\"\"' >> /etc/default/grub" + + update_grub +} + +update_grub() { + # Update grub config + echo_success 'Updating grub config...\n' + if [[ -x "$(command -v update-grub)" ]]; then + echo_info 'sudo update-grub\n' + sudo update-grub + + elif [[ -x "$(command -v grub-mkconfig)" ]]; then + echo_info 'sudo grub-mkconfig -o /boot/grub/grub.cfg\n' + sudo grub-mkconfig -o /boot/grub/grub.cfg + + elif [[ -x "$(command -v grub2-mkconfig)" ]]; then + if [[ -x "$(command -v zypper)" ]]; then + echo_info 'sudo grub2-mkconfig -o /boot/grub2/grub.cfg\n' + sudo grub2-mkconfig -o /boot/grub2/grub.cfg + + elif [[ -x "$(command -v dnf)" ]]; then + echo_info 'sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg\n' + sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg + fi + fi +} + +#-------------------------------------------------- +# Semantic colors set +#-------------------------------------------------- + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[1;104;97m'; ALERT_SECONDARY='\033[1;45;97m'; ALERT_SUCCESS='\033[1;42;97m'; ALERT_DANGER='\033[1;41;97m'; ALERT_WARNING='\033[1;43;97m'; ALERT_INFO='\033[1;44;97m'; ALERT_LIGHT='\033[1;47;90m'; ALERT_DARK='\033[1;40;37m'; +} + +echo_primary() { printf "%b%b${DEFAULT}" "${PRIMARY}" "${*}"; } +echo_secondary() { printf "%b%b${DEFAULT}" "${SECONDARY}" "${*}"; } +echo_success() { printf "%b%b${DEFAULT}" "${SUCCESS}" "${*}"; } +echo_danger() { printf "%b%b${DEFAULT}" "${DANGER}" "${*}"; } +echo_warning() { printf "%b%b${DEFAULT}" "${WARNING}" "${*}"; } +echo_info() { printf "%b%b${DEFAULT}" "${INFO}" "${*}"; } +echo_light() { printf "%b%b${DEFAULT}" "${LIGHT}" "${*}"; } +echo_dark() { printf "%b%b${DEFAULT}" "${DARK}" "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2"; else printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}"; fi } +echo_error() { printf "%berror: %b${DEFAULT}" "${DANGER}" "${*}"; } + +alert_primary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" ''; } +alert_secondary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" ''; } +alert_success() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "${*}" "${ALERT_SUCCESS}" ''; } +alert_danger() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DANGER}" '' "${ALERT_DANGER}" "${*}" "${ALERT_DANGER}" ''; } +alert_warning() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "${*}" "${ALERT_WARNING}" ''; } +alert_info() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "${*}" "${ALERT_INFO}" ''; } +alert_light() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" ''; } +alert_dark() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" ''; } + +#-------------------------------------------------- +# Self documentation +#-------------------------------------------------- + +### Help + +## Print this help (default) +help() { + alert_primary 'TangoMan Shoe XXS' + echo_warning 'Infos:\n' + echo_label 10 ' author'; echo_primary '"Matthias Morin" \n' + echo_label 10 ' version'; echo_primary '0.8.0-xxs\n' + echo_label 10 ' link'; echo_primary 'https://github.com/TangoMan75/shoe\n\n' + echo_warning 'Description:\n' + echo_primary ' Create self documented shell scripts with argument validation easily. Prefix a comment with two pound signs on the previous line of any function or variable you want documented with the "help" command.\n\n' | fold -w 64 -s + echo_warning 'Usage:\n' + printf "%b sh $(basename "${0}") [%bcommand%b]\n\n" "${INFO}" "${SUCCESS}" "${INFO}" + _print_commands 10 +} + +#-------------------------------------------------- + +_print_commands() { + # $1 = padding + if [ -z "$1" ]; then set -- 12; fi + printf "%bCommands:%b\n" "${WARNING}" "${DEFAULT}" + awk "/^### /{printf\"\n${WARNING}%s:${EOL}\",substr(\$0,5)} + /^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub(\"^function \",\"\"); gsub(\"[ ()]\",\"\"); + FUNCTION = substr(\$0, 1, index(\$0, \"{\")); + sub(\"{\$\", \"\", FUNCTION); + if (substr(PREV, 1, 3) == \"## \" && substr(\$0, 1, 1) != \"_\") + printf \"${SUCCESS} %-$1s ${DEFAULT}%s\n\", FUNCTION, substr(PREV, 4) + } { PREV = \$0 }" "$0" + printf '\n' +} + +#-------------------------------------------------- +# Core +#-------------------------------------------------- + +_get_functions() { + # this regular expression matches functions with either bash or sh syntax + awk '/^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); # remove leading "function ", round brackets and extra spaces + FUNCTION = substr($0, 1, index($0, "{")); # truncate string after opening curly brace + sub("{$", "", FUNCTION); # remove trailing curly brace + if (substr(PREV, 1, 3) == "## " && substr($0, 1, 1) != "_") print FUNCTION + } { PREV = $0 }' "$0" +} + +#-------------------------------------------------- +# Main loop +#-------------------------------------------------- + +_main() { + if [ $# -lt 1 ]; then + help + exit 0 + fi + + _execute='' + for _argument in "$@"; do + _is_valid=false + for _function in $(_get_functions); do + # get shorthand character + _shorthand="$(printf '%s' "${_function}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "${_function}" ] || [ "${_argument}" = "${_shorthand}" ]; then + # append argument to the execute stack + _execute="${_execute} ${_function}" + _is_valid=true + break + fi + done + # unknown parameters will raise errors + if [ "${_is_valid}" = false ]; then + printf "${DANGER}error: \"%s\" is not a valid command${EOL}" "${_argument}" + exit 1 + fi + done + + for _function in ${_execute}; do + eval "${_function}" + done +} + +_main "$@" diff --git a/system/config_gnome_dconf.sh b/system/config_gnome_dconf.sh new file mode 100755 index 0000000..8bc49a4 --- /dev/null +++ b/system/config_gnome_dconf.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config org_gnome +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_secondary 'Config dconf' + +if [ ! -x "$(command -v dconf)" ]; then + echo_error "\"$(basename "${0}")\" requires dconf, try: 'sudo apt-get install -y dconf-editor'" + exit 1 +fi + +CONFIG_DIR="${CURDIR}/../config" + +# check system uses gnome +GNOME=false +RELEASE="$(lsb_release -cs)" +for CODENAME in bionic cosmic disco eoan focal jammy kali +do + if [ "${RELEASE}" = "${CODENAME}" ]; then + GNOME=true + fi +done + +if [ "${GNOME}" = true ]; then + echo_info "dconf load /org/gnome/ < \"${CONFIG_DIR}/gnome/dconf/org_gnome.conf\"" + dconf load /org/gnome/ < "${CONFIG_DIR}/gnome/dconf/org_gnome.conf" +else + echo_error "${RELEASE} not supported" +fi diff --git a/system/config_grub.sh b/system/config_grub.sh new file mode 100755 index 0000000..3e589ca --- /dev/null +++ b/system/config_grub.sh @@ -0,0 +1,112 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config grub +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +OPTIND=0 +while getopts :h OPTION; do + case "${OPTION}" in + h) echo_label 12 'description'; echo_primary "$(basename "${0}"): disable grub splash screen to avoid freeze on boot" + echo_label 12 'usage'; echo_primary "$(basename "${0}") -h (help)" + exit 0;; + \?) echo_error "invalid option \"${OPTARG}\"" + exit 1;; + esac +done + +echo_primary 'Enabling grub menu' +# remove default grub style if any +echo_info "sudo sed -i '/GRUB_TIMEOUT_STYLE=/d' /etc/default/grub" +sudo sed -i '/GRUB_TIMEOUT_STYLE=/d' /etc/default/grub + +echo_info "sudo bash -c \"echo 'GRUB_TIMEOUT_STYLE=\"menu\"' >> /etc/default/grub\"" +sudo bash -c "echo 'GRUB_TIMEOUT_STYLE=\"menu\"' >> /etc/default/grub" + +#-------------------------------------------------- + +echo_primary 'Setting grub timeout to 1 second' +# remove default timeout if any +echo_info "sudo sed -i '/GRUB_TIMEOUT=/d' /etc/default/grub" +sudo sed -i '/GRUB_TIMEOUT=/d' /etc/default/grub + +echo_info "sudo bash -c \"echo 'GRUB_TIMEOUT=\"1\"' >> /etc/default/grub\"" +sudo bash -c "echo 'GRUB_TIMEOUT=\"1\"' >> /etc/default/grub" + +#-------------------------------------------------- + +echo_primary 'Setting grub normal color' +# remove default normal color if any +echo_info "sudo sed -i '/GRUB_COLOR_NORMAL=/d' /etc/default/grub" +sudo sed -i '/GRUB_COLOR_NORMAL=/d' /etc/default/grub + +echo_info "sudo bash -c \"echo 'GRUB_COLOR_NORMAL=\"light-gray/magenta\"' >> /etc/default/grub\"" +sudo bash -c "echo 'GRUB_COLOR_NORMAL=\"light-gray/magenta\"' >> /etc/default/grub" + +#-------------------------------------------------- + +echo_primary 'Setting grub highlight color' +# remove default highlight color if any +echo_info "sudo sed -i '/GRUB_COLOR_HIGHLIGHT=/d' /etc/default/grub" +sudo sed -i '/GRUB_COLOR_HIGHLIGHT=/d' /etc/default/grub + +echo_info "sudo bash -c \"echo 'GRUB_COLOR_HIGHLIGHT=\"dark-gray/light-magenta\"' >> /etc/default/grub\"" +sudo bash -c "echo 'GRUB_COLOR_HIGHLIGHT=\"dark-gray/light-magenta\"' >> /etc/default/grub" + +#-------------------------------------------------- + +echo_primary 'Setting grub cmdline' +# remove default cmdline if any +echo_info "sudo sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/d' /etc/default/grub" +sudo sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/d' /etc/default/grub + +echo_info "sudo bash -c \"echo 'GRUB_CMDLINE_LINUX_DEFAULT=\"\"' >> /etc/default/grub\"" +sudo bash -c "echo 'GRUB_CMDLINE_LINUX_DEFAULT=\"\"' >> /etc/default/grub" + +#-------------------------------------------------- + +echo_primary 'Setting grub resolution' +# remove default normal color if any +echo_info "sudo sed -i '/GRUB_GFXMODE=/d' /etc/default/grub" +sudo sed -i '/GRUB_GFXMODE=/d' /etc/default/grub + +echo_info "sudo bash -c \"echo 'GRUB_GFXMODE=1920x1080' >> /etc/default/grub\"" +sudo bash -c "echo 'GRUB_GFXMODE=1920x1080' >> /etc/default/grub" + +#-------------------------------------------------- + +# Update grub config +echo_primary 'Updating grub config...' +if [[ -x "$(command -v update-grub)" ]]; then + echo_info 'sudo update-grub' + sudo update-grub + +elif [[ -x "$(command -v grub-mkconfig)" ]]; then + echo_info 'sudo grub-mkconfig -o /boot/grub/grub.cfg' + sudo grub-mkconfig -o /boot/grub/grub.cfg + +elif [[ -x "$(command -v grub2-mkconfig)" ]]; then + if [[ -x "$(command -v zypper)" ]]; then + echo_info 'sudo grub2-mkconfig -o /boot/grub2/grub.cfg' + sudo grub2-mkconfig -o /boot/grub2/grub.cfg + + elif [[ -x "$(command -v dnf)" ]]; then + echo_info 'sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg' + sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg + fi +fi diff --git a/system/config_keyboard.sh b/system/config_keyboard.sh new file mode 100755 index 0000000..a3494a1 --- /dev/null +++ b/system/config_keyboard.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * config_keyboard +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ -f '/etc/default/keyboard' ]; then + echo_info "sudo sed -ie '/^XKBLAYOUT=/s/\".*\"/\"fr\"/' /etc/default/keyboard" + sudo sed -ie '/^XKBLAYOUT=/s/".*"/"fr"/' /etc/default/keyboard + + # note: /string1/s/string2/string3/ => replace string1string2 by string1string3 + # TLDR; `s/` doesn't have to be at the beginnig of a string + echo_info "sudo sed -ie '/^XKBOPTIONS=/s/\".*\"/\"shift:breaks_caps\"/' /etc/default/keyboard" + sudo sed -ie '/^XKBOPTIONS=/s/".*"/"shift:breaks_caps"/' /etc/default/keyboard +fi + +echo_info 'udevadm trigger --subsystem-match=input --action=change' +udevadm trigger --subsystem-match=input --action=change diff --git a/system/config_zsh.sh b/system/config_zsh.sh new file mode 100755 index 0000000..fcb447d --- /dev/null +++ b/system/config_zsh.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Set ZSH as Default Shell +# * +# * @category bin +# * @license MIT +# */ + +# check zsh installed +if [ ! -x "$(command -v zsh)" ]; then + echo_error "\"$(basename "${0}")\" requires zsh, try: 'sudo apt-get install -y zsh'" + exit 1 +fi + +# check .zshrc present +if [ ! -f ~/.zshrc ]; then + echo_error '.zshrc file not found' + exit 1 +fi + +# add hostname config if not present +# $HOST don't expand on purpose +# shellcheck disable=2016 +if [ -z "$(sed -n '/export\sHOSTNAME=$HOST/p' ~/.zshrc)" ]; then + cat >> ~/.zshrc <> ~/.zshrc </dev/null 2>&1; then + ncolors=$(tput colors) + fi + if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then + GREEN="$(tput setaf 2)" + BLUE="$(tput setaf 4)" + NORMAL="$(tput sgr0)" + else + GREEN="" + BLUE="" + NORMAL="" + fi + + # Only enable exit-on-error after the non-critical colorization stuff, + # which may fail on systems lacking tput or terminfo + set -e + + # If this user's login shell is not already "zsh", attempt to switch. + TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') + if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then + # If this platform provides a "chsh" command (not Cygwin), do it, man! + if hash chsh >/dev/null 2>&1; then + printf "%sTime to change your default shell to zsh!%s\n" "${BLUE}" "${NORMAL}" + chsh -s "$(grep /zsh$ /etc/shells | tail -1)" + # Else, suggest the user do so manually. + else + printf "I can't change your shell automatically because this system does not have chsh.\n" + printf "%sPlease manually change your default shell to zsh!%s\n" "${BLUE}" "${NORMAL}" + fi + fi + + printf "%s" "${GREEN}" + echo ' __ __ ' + echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' + echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' + echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' + echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' + echo ' /____/ ....is now installed!' + echo '' + echo '' + echo 'Please look over the ~/.zshrc file to select plugins, themes, and options.' + echo '' + echo 'p.s. Follow us at https://twitter.com/ohmyzsh.' + echo '' + echo 'p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.' + echo '' + printf "%s" "${NORMAL}" + env zsh -l +} + +set_as_default_shell + diff --git a/system/install_alien.sh b/system/install_alien.sh new file mode 100755 index 0000000..4c5f334 --- /dev/null +++ b/system/install_alien.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * alien +# * +# * Convert different Linux packages distribution to Debian +# * +# * @category system +# * @link https://en.wikipedia.org/wiki/Alien_(file_converter) +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Alien' + +echo_info 'sudo apt-get install --assume-yes alien' +sudo apt-get install --assume-yes alien + diff --git a/system/install_bash_aliases.sh b/system/install_bash_aliases.sh new file mode 100755 index 0000000..b965d11 --- /dev/null +++ b/system/install_bash_aliases.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * bash_aliases +# * +# * @category system +# * @link https://github.com/TangoMan75/bash_aliases +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +if [ ! -x "$(command -v unzip)" ]; then + echo_error "\"$(basename "${0}")\" requires unzip, try: 'sudo apt-get install -y unzip'" + exit 1 +fi + +# -------------------------------------------------- + +PROJECT=bash_aliases +AUTHOR=TangoMan75 +REPOSITORY=${AUTHOR}/${PROJECT} +MAIN_BRANCH=main + +# -------------------------------------------------- + +REMOTE_FILE="${MAIN_BRANCH}.zip" +TEMP="$(mktemp -d)" +ARCHIVE="${TEMP}/${REMOTE_FILE}" +DESTINATION=~/.tangoman/bash_aliases + +# -------------------------------------------------- + +# Download source +URL=https://github.com/${REPOSITORY}/archive/refs/heads/${REMOTE_FILE} + +# -------------------------------------------------- + +alert_primary "Install ${PROJECT}" + +# -------------------------------------------------- + +if [ -x "$(command -v curl)" ]; then + # download latest version from github with curl + echo_info "curl -L \"${URL}\" -o \"${ARCHIVE}\"" + curl -L "${URL}" -o "${ARCHIVE}" + +elif [ -x "$(command -v wget)" ]; then + # download latest version from github with wget + echo_info "wget -nv \"${URL}\" -O \"${ARCHIVE}\"" + wget -nv "${URL}" -O "${ARCHIVE}" +fi + +# -------------------------------------------------- + +# create destination folder +if [ ! -d "${DESTINATION}" ]; then + echo_info "mkdir -p \"${DESTINATION}\"" + mkdir -p "${DESTINATION}" +fi + +# -------------------------------------------------- + +# ${ARCHIVE##*.} : This is a parameter expansion expression +# ## : Removes the shortest pattern that matches the entire string from the end of the value +# * : Matches zero or more characters +# . : Matches a literal dot (.) +if [ "${ARCHIVE##*.}" = 'gz' ]; then + # extract source with tar + # -C, --directory [DIR] : destination directory + # -x, --extract + # -v, --verbose + # -z, --gzip, --gunzip --ungzip + # -f, --file [ARCHIVE] + echo_info "tar -C \"${TEMP}\" -xzf \"${ARCHIVE}\"" + tar -C "${TEMP}" -xzf "${ARCHIVE}" + +elif [ "${ARCHIVE##*.}" = 'zip' ]; then + # extract source with unzip + echo_info "unzip \"${ARCHIVE}\" -d \"${TEMP}\"" + unzip "${ARCHIVE}" -d "${TEMP}" +fi + +# -------------------------------------------------- + +# move extacted folder to destination +EXTRACTION_FOLDER="${TEMP}/${PROJECT}-${MAIN_BRANCH}" +echo_info "cp -rfT \"${EXTRACTION_FOLDER}\" \"${DESTINATION}\"" +cp -rfT "${EXTRACTION_FOLDER}" "${DESTINATION}" + diff --git a/system/install_bleachbit.sh b/system/install_bleachbit.sh new file mode 100755 index 0000000..1fd3f1b --- /dev/null +++ b/system/install_bleachbit.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * bleachbit +# * +# * system cache cleaner +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes bleachbit' +sudo apt-get install --assume-yes bleachbit diff --git a/system/install_boot-info.sh b/system/install_boot-info.sh new file mode 100755 index 0000000..783ac4c --- /dev/null +++ b/system/install_boot-info.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * boot-info +# * +# * print boot manager information +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo add-apt-repository --yes ppa:yannubuntu/boot-repair' +sudo add-apt-repository --yes ppa:yannubuntu/boot-repair + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes boot-info' +sudo apt-get install --assume-yes boot-info diff --git a/system/install_boot-repair.sh b/system/install_boot-repair.sh new file mode 100755 index 0000000..74aaf70 --- /dev/null +++ b/system/install_boot-repair.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * boot-repair +# * +# * repair boot manager +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo add-apt-repository --yes ppa:yannubuntu/boot-repair' +sudo add-apt-repository --yes ppa:yannubuntu/boot-repair + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes boot-repair' +sudo apt-get install --assume-yes boot-repair diff --git a/system/install_bottles.sh b/system/install_bottles.sh new file mode 100755 index 0000000..9c4ee3b --- /dev/null +++ b/system/install_bottles.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * bottles +# * +# * Run Windows softwares +# * +# * @category system +# * @link https://usebottles.com +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Bottles' + +if [ ! -x "$(command -v flatpak)" ]; then + echo_error "\"$(basename "${0}")\" requires flatpak, try: 'sudo apt-get install -y flatpak'" + exit 1 +fi + +echo_info 'sudo flatpak install -y flathub com.usebottles.bottles' +sudo flatpak install -y flathub com.usebottles.bottles + +echo_warning 'You need to reboot your system for the change to take effect' diff --git a/system/install_bpytop.sh b/system/install_bpytop.sh new file mode 100755 index 0000000..82a21ac --- /dev/null +++ b/system/install_bpytop.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * bpytop +# * +# * A Python-based resource monitor for your terminal +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +echo_info 'sudo snap install bpytop --stable' +sudo snap install bpytop --stable diff --git a/system/install_build-essential.sh b/system/install_build-essential.sh new file mode 100755 index 0000000..e77c4f1 --- /dev/null +++ b/system/install_build-essential.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * build-essentials +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get -y install autoconf' +sudo apt-get -y install autoconf + +echo_info 'sudo apt-get -y install build-essential' +sudo apt-get -y install build-essential + +echo_info 'sudo apt-get -y install libssl-dev' +sudo apt-get -y install libssl-dev + +echo_info 'sudo apt-get -y install libxml2-dev' +sudo apt-get -y install libxml2-dev + +echo_info 'sudo apt-get -y install libxslt-dev' +sudo apt-get -y install libxslt-dev + +echo_info 'sudo apt-get -y install ruby-dev' +sudo apt-get -y install ruby-dev diff --git a/system/install_dconf-editor.sh b/system/install_dconf-editor.sh new file mode 100755 index 0000000..3e29b78 --- /dev/null +++ b/system/install_dconf-editor.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * dconf-editor +# * +# * enable advanced gnome configuration +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# check system uses gnome +if [ "${XDG_CURRENT_DESKTOP}" != 'ubuntu:GNOME' ]; then + RELEASE="$(lsb_release -cs 2>/dev/null)" + echo_error "${RELEASE} not supported" + + exit 1 +fi + +echo_info 'sudo apt-get install --assume-yes dconf-editor' +sudo apt-get install --assume-yes dconf-editor diff --git a/system/install_diodon.sh b/system/install_diodon.sh new file mode 100755 index 0000000..a7a63ab --- /dev/null +++ b/system/install_diodon.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * diodon +# * +# * clipboard manager +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install diodon' + +echo_info 'sudo apt-get install --assume-yes diodon' +sudo apt-get install --assume-yes diodon diff --git a/system/install_flatpak.sh b/system/install_flatpak.sh new file mode 100755 index 0000000..feedd8c --- /dev/null +++ b/system/install_flatpak.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * flatpak +# * +# * Linux packaging tool +# * +# * @category system +# * @link https://doc.ubuntu-fr.org/flatpak +# * @link https://flathub.org/apps +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Flatpack' + +echo_info 'sudo apt-get install --assume-yes flatpak' +sudo apt-get install --assume-yes flatpak + +echo_info 'sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo' +sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo diff --git a/system/install_gnome-tweaks.sh b/system/install_gnome-tweaks.sh new file mode 100755 index 0000000..afa3a6d --- /dev/null +++ b/system/install_gnome-tweaks.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * gnome-tweaks +# * +# * Tweaks for gnome desktop +# * +# * @note gnome-tweak-tool is an alias for gnome-tweaks +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install gnome-tweaks' + +echo_info 'sudo apt-get install --assume-yes gnome-tweaks' +sudo apt-get install --assume-yes gnome-tweaks + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/org.gnome.tweaks.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/org.gnome.tweaks.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/system/install_gparted.sh b/system/install_gparted.sh new file mode 100755 index 0000000..0e2e84d --- /dev/null +++ b/system/install_gparted.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * gparted +# * +# * partition manager +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install gparted' + +echo_info 'sudo apt-get install --assume-yes gparted' +sudo apt-get install --assume-yes gparted diff --git a/system/install_grub-customizer.sh b/system/install_grub-customizer.sh new file mode 100755 index 0000000..a76ebb7 --- /dev/null +++ b/system/install_grub-customizer.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * grub-customizer +# * +# * grub configuration editor +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo add-apt-repository --yes ppa:danielrichter2007/grub-customizer' +sudo add-apt-repository --yes ppa:danielrichter2007/grub-customizer + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes grub-customizer' +sudo apt-get install --assume-yes grub-customizer diff --git a/system/install_hardinfo.sh b/system/install_hardinfo.sh new file mode 100755 index 0000000..016ec24 --- /dev/null +++ b/system/install_hardinfo.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * hardinfo +# * +# * hardware info and benchmark +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes hardinfo' +sudo apt-get install --assume-yes hardinfo diff --git a/system/install_htop.sh b/system/install_htop.sh new file mode 100755 index 0000000..ae37c55 --- /dev/null +++ b/system/install_htop.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * htop +# * +# * command line system monitor +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes htop' +sudo apt-get install --assume-yes htop diff --git a/system/install_i-nex.sh b/system/install_i-nex.sh new file mode 100755 index 0000000..0af5ba4 --- /dev/null +++ b/system/install_i-nex.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * i-nex +# * +# * processor information +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo add-apt-repository --yes ppa:i-nex-development-team/daily' +sudo add-apt-repository --yes ppa:i-nex-development-team/daily + +echo_info 'sudo add-apt-repository --yes ppa:gambas-team/gambas3' +sudo add-apt-repository --yes ppa:gambas-team/gambas3 + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt install -y i-nex' +sudo apt install -y i-nex diff --git a/system/install_lshw.sh b/system/install_lshw.sh new file mode 100755 index 0000000..7fbcee1 --- /dev/null +++ b/system/install_lshw.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install lshw +# * +# * hardware lister +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes lshw' +sudo apt-get install --assume-yes lshw diff --git a/system/install_make.sh b/system/install_make.sh new file mode 100755 index 0000000..66eea7d --- /dev/null +++ b/system/install_make.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * install make +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install make' + +echo_info 'sudo apt-get install --assume-yes make' +sudo apt-get install --assume-yes make diff --git a/system/install_multisystem.sh b/system/install_multisystem.sh new file mode 100755 index 0000000..5e462a6 --- /dev/null +++ b/system/install_multisystem.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * multisystem +# * +# * create bootable usb drives +# * +# * @deprecated use woeusb instead +# * @category system +# * @link https://doc.ubuntu-fr.org/multisystem +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install multisystem' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info "sudo apt-add-repository -y 'deb http://liveusb.info/multisystem/depot all main'" +sudo apt-add-repository -y 'deb http://liveusb.info/multisystem/depot all main' + +echo_info 'wget -q http://liveusb.info/multisystem/depot/multisystem.asc -O- | sudo apt-key add -' +wget -q http://liveusb.info/multisystem/depot/multisystem.asc -O- | sudo apt-key add - + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes multisystem' +sudo apt-get install --assume-yes multisystem diff --git a/system/install_ncdu.sh b/system/install_ncdu.sh new file mode 100755 index 0000000..226dbde --- /dev/null +++ b/system/install_ncdu.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ncdu +# * +# * command line disk usage manager +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes ncdu' +sudo apt-get install --assume-yes ncdu diff --git a/system/install_openjdk-11-jdk.sh b/system/install_openjdk-11-jdk.sh new file mode 100755 index 0000000..9f0c8e2 --- /dev/null +++ b/system/install_openjdk-11-jdk.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * openjdk-11-jdk +# * +# * Java JDK +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v snap)" ]; then + echo_error "\"$(basename "${0}")\" requires snap, try: 'sudo apt-get install -y snapd'" + exit 1 +fi + +echo_info 'sudo apt-get install --assume-yes openjdk-11-jdk' +sudo apt-get install --assume-yes openjdk-11-jdk diff --git a/system/install_osquery.sh b/system/install_osquery.sh new file mode 100755 index 0000000..e2cca9a --- /dev/null +++ b/system/install_osquery.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * osquery +# * +# * Multi-platform system information with SQL queries +# * +# * @category system +# * @link https://osquery.io +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1484120AC4E9F8A1A577AEEE97A80C63C9D8B80B' +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1484120AC4E9F8A1A577AEEE97A80C63C9D8B80B + +echo_info "sudo add-apt-repository 'deb [arch=amd64] https://pkg.osquery.io/deb deb main'" +sudo add-apt-repository 'deb [arch=amd64] https://pkg.osquery.io/deb deb main' + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt install -y osquery' +sudo apt install -y osquery diff --git a/system/install_shc.sh b/system/install_shc.sh new file mode 100755 index 0000000..2480ba3 --- /dev/null +++ b/system/install_shc.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * shc +# * +# * Compile `.sh`` scripts to `c` binary +# * +# * ``` +# * shc -f foobar.sh -o foobar +# * ``` +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install shc' + +echo_info 'sudo apt-get install --assume-yes shc' +sudo apt-get install --assume-yes shc + diff --git a/system/install_snap.sh b/system/install_snap.sh new file mode 100755 index 0000000..195bfc4 --- /dev/null +++ b/system/install_snap.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * snap +# * +# * Snap package manager +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install snap' + +echo_info 'sudo apt install -y snapd' +sudo apt install -y snapd + +# if snap showing "snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks" +# sudo snap refresh core --beta + +# list installed apps +# sudo snap list diff --git a/system/install_stacer.sh b/system/install_stacer.sh new file mode 100755 index 0000000..9fadab8 --- /dev/null +++ b/system/install_stacer.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * stacer +# * +# * system optimizer and monitor +# * +# * @category system +# * @link https://github.com/oguzhaninan/Stacer +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install stacer' + +echo_info 'sudo apt-get install --assume-yes stacer' +sudo apt-get install --assume-yes stacer + +# create shortcut on desktop +echo_info "cp -p /usr/share/applications/stacer.desktop \"$(xdg-user-dir DESKTOP)\"" +cp -p /usr/share/applications/stacer.desktop "$(xdg-user-dir DESKTOP)" + diff --git a/system/install_startup-disk-creator.sh b/system/install_startup-disk-creator.sh new file mode 100755 index 0000000..572e22b --- /dev/null +++ b/system/install_startup-disk-creator.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * startup-disk-creator +# * +# * Create bootable Ubuntu startup disk +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes usb-creator-gtk' +sudo apt-get install --assume-yes usb-creator-gtk + diff --git a/system/install_tree.sh b/system/install_tree.sh new file mode 100755 index 0000000..4ac73e2 --- /dev/null +++ b/system/install_tree.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * tree +# * +# * list contents of directories in a tree-like format. +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install tree' + +echo_info 'sudo apt-get install --assume-yes tree' +sudo apt-get install --assume-yes tree diff --git a/system/install_unetbootin.sh b/system/install_unetbootin.sh new file mode 100755 index 0000000..a3c3f14 --- /dev/null +++ b/system/install_unetbootin.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * unetbootin +# * +# * create bootable usb drives +# * +# * @category system +# * @note use multisystem instead +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo add-apt-repository --yes ppa:gezakovacs/ppa' +sudo add-apt-repository --yes ppa:gezakovacs/ppa + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes unetbootin' +sudo apt-get install --assume-yes unetbootin diff --git a/system/install_wine.sh b/system/install_wine.sh new file mode 100755 index 0000000..713aba8 --- /dev/null +++ b/system/install_wine.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * wine +# * +# * windows emulator +# * +# * configure wine +# * `winecfg` +# * +# * wine virtual drive can be found here: +# * `~/.wine/drive_c` +# * +# * @link https://wiki.winehq.org/Ubuntu +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Wine' + +# enable 32-bit architecture +echo_info 'sudo dpkg --add-architecture i386' +sudo dpkg --add-architecture i386 + +# install lib-32 +echo_info 'sudo apt-get install --assume-yes lib32z1' +sudo apt-get install --assume-yes lib32z1 + +echo_info 'sudo apt-get install --assume-yes wine-stable' +sudo apt-get install --assume-yes wine-stable diff --git a/system/install_winehq.sh b/system/install_winehq.sh new file mode 100755 index 0000000..a5f0ac1 --- /dev/null +++ b/system/install_winehq.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * winehq +# * +# * windows emulator +# * +# * configure wine +# * `winecfg` +# * +# * wine virtual drive can be found here: +# * `~/.wine/drive_c` +# * +# * @category system +# * @note this is the recommended version for ubuntu +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install Wine HQ' + +# enable 32-bit architecture +echo_info 'sudo dpkg --add-architecture i386' +sudo dpkg --add-architecture i386 + +# install lib-32 +echo_info 'sudo apt-get install --assume-yes lib32z1' +sudo apt-get install --assume-yes lib32z1 + +if [ -z "$(lsb_release -cs 2>/dev/null)" ]; then + echo_error 'wrong system' + exit 1 +fi + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'sudo mkdir -pm755 /etc/apt/keyrings' +sudo mkdir -pm755 /etc/apt/keyrings + +echo_info 'sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key' +sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key + +echo_info "sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources" +sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/"$(lsb_release -cs)"/winehq-"$(lsb_release -cs)".sources + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt --assume-yes install winehq-stable' +sudo apt --assume-yes install winehq-stable + +# echo_info 'sudo apt --assume-yes install wine-stable' +# sudo apt --assume-yes install wine-stable + diff --git a/system/install_winetricks.sh b/system/install_winetricks.sh new file mode 100755 index 0000000..71b8566 --- /dev/null +++ b/system/install_winetricks.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * winetricks +# * +# * allows dotnet installation +# * +# * install dotnet40: `winetricks dotnet40` +# * wine virtual drive can be found here: +# * `~/.wine/drive_c` +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes winetricks' +sudo apt-get install --assume-yes winetricks + +echo_info 'winetricks dotnet40' +winetricks dotnet40 + diff --git a/system/install_woeusb.sh b/system/install_woeusb.sh new file mode 100755 index 0000000..b3c52d5 --- /dev/null +++ b/system/install_woeusb.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * woeusb +# * +# * create bootable usb drives +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install woeusb' + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'sudo add-apt-repository -y ppa:tomtomtom/woeusb' +sudo add-apt-repository -y ppa:tomtomtom/woeusb + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get install --assume-yes woeusb woeusb-frontend-wxgtk' +sudo apt-get install --assume-yes woeusb woeusb-frontend-wxgtk diff --git a/system/install_xclip.sh b/system/install_xclip.sh new file mode 100755 index 0000000..7e0205f --- /dev/null +++ b/system/install_xclip.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * xclip +# * +# * pipe terminal stdout to clipboard +# * +# * @deprecated use xsel instead +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes xclip' +sudo apt-get install --assume-yes xclip diff --git a/system/install_xdotool.sh b/system/install_xdotool.sh new file mode 100755 index 0000000..149bcf5 --- /dev/null +++ b/system/install_xdotool.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * xdotool +# * +# * fake keyboard mouse input +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes xdotool' +sudo apt-get install --assume-yes xdotool diff --git a/system/install_xsel.sh b/system/install_xsel.sh new file mode 100755 index 0000000..b9ecc7b --- /dev/null +++ b/system/install_xsel.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * xsel +# * +# * pipe terminal stdin and stdout to clipboard +# * +# * ``` +# * # example +# * echo 'foobar' | xsel --input --clipboard +# * xsel --output --clipboard > foobar.txt +# * +# * # create aliases +# * alias pbcopy='xsel --input --clipboard' +# * alias pbpaste='xsel --output --clipboard' +# * ``` +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install xsel' + +echo_info 'sudo apt-get install --assume-yes xsel' +sudo apt-get install --assume-yes xsel + diff --git a/system/install_zsh.sh b/system/install_zsh.sh new file mode 100755 index 0000000..9331f45 --- /dev/null +++ b/system/install_zsh.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Install ZSH +# * +# * @category system +# * @license MIT +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes zsh' +sudo apt-get install --assume-yes zsh + diff --git a/system/remove_aptitude.sh b/system/remove_aptitude.sh new file mode 100755 index 0000000..9182d05 --- /dev/null +++ b/system/remove_aptitude.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove aptitude +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes aptitude' +sudo apt-get purge --assume-yes aptitude + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/system/remove_diodon.sh b/system/remove_diodon.sh new file mode 100755 index 0000000..1fb7f72 --- /dev/null +++ b/system/remove_diodon.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove diodon +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get remove --assume-yes diodon' +sudo apt-get remove --assume-yes diodon diff --git a/system/remove_grub-customizer.sh b/system/remove_grub-customizer.sh new file mode 100755 index 0000000..2b4205e --- /dev/null +++ b/system/remove_grub-customizer.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove grub-customizer +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes grub-customizer' +sudo apt-get purge --assume-yes grub-customizer + +echo_info 'sudo add-apt-repository --remove --yes ppa:danielrichter2007/grub-customizer' +sudo add-apt-repository --remove --yes ppa:danielrichter2007/grub-customizer diff --git a/system/remove_multisystem.sh b/system/remove_multisystem.sh new file mode 100755 index 0000000..888f62c --- /dev/null +++ b/system/remove_multisystem.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * multisystem +# * +# * create bootable usb drives +# * +# * @deprecated +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes multisystem' +sudo apt-get purge --assume-yes multisystem + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/system/remove_ubuntu-web-launchers.sh b/system/remove_ubuntu-web-launchers.sh new file mode 100755 index 0000000..884f4ec --- /dev/null +++ b/system/remove_ubuntu-web-launchers.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove ubuntu-web-launchers +# * +# * Remove Amazon bloat from gnome +# * +# * @deprecated +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get purge --assume-yes ubuntu-web-launchers' +sudo apt-get purge --assume-yes ubuntu-web-launchers + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + diff --git a/system/remove_wine.sh b/system/remove_wine.sh new file mode 100755 index 0000000..47a5be4 --- /dev/null +++ b/system/remove_wine.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove wine +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'rm -r ~/.wine' +rm -r ~/.wine + +echo_info 'rm ~/.config/menus/applications-merged/wine*' +rm ~/.config/menus/applications-merged/wine* + +echo_info 'rm -r ~/.local/share/applications/wine' +rm -r ~/.local/share/applications/wine + +echo_info 'rm ~/.local/share/desktop-directories/wine*' +rm ~/.local/share/desktop-directories/wine* + +echo_info 'rm ~/.local/share/icons/????_*.xpm' +rm ~/.local/share/icons/????_*.xpm + +# remove keys +echo_info 'sudo rm -f /etc/apt/keyrings/winehq-archive.key' +sudo rm -f /etc/apt/keyrings/winehq-archive.key + +echo_info "sudo rm -f /etc/apt/sources.list.d/archive*" +sudo rm -f /etc/apt/sources.list.d/archive* + +echo_info "sudo rm -f /etc/apt/sources.list.d/winehq-$(lsb_release -cs).sources" +sudo rm -f /etc/apt/sources.list.d/winehq-"$(lsb_release -cs)".sources + +# remove lib +echo_info 'sudo apt-get remove --purge --assume-yes lib32z1' +sudo apt-get remove --purge --assume-yes lib32z1 + +# remove wine +if [ -x "$(command -v aptitude)" ]; then + echo_info 'sudo aptitude purge -y winehq-stable' + sudo aptitude purge -y winehq-stable +fi + +echo_info 'sudo apt-get remove --purge --assume-yes wine32' +sudo apt-get remove --purge --assume-yes wine32 + +echo_info 'sudo apt-get remove --purge --assume-yes wine' +sudo apt-get remove --purge --assume-yes wine + +echo_info 'sudo apt-get remove --purge --assume-yes wine-stable' +sudo apt-get remove --purge --assume-yes wine-stable + +echo_info 'sudo apt-get purge -y winehq' +sudo apt-get purge -y winehq + +echo_info 'sudo apt-get purge -y winehq-stable' +sudo apt-get purge -y winehq-stable + +echo_info 'sudo apt-get --assume-yes autoremove' +sudo apt-get --assume-yes autoremove + +echo_info 'sudo apt-get update' +sudo apt-get update + +echo_info 'sudo apt-get autoclean' +sudo apt-get autoclean + +echo_info 'sudo apt-get clean' +sudo apt-get clean + +echo_info 'sudo apt-get autoremove' +sudo apt-get autoremove + diff --git a/system/remove_zsh.sh b/system/remove_zsh.sh new file mode 100755 index 0000000..c98ca83 --- /dev/null +++ b/system/remove_zsh.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove zsh +# * +# * @category system +# * @license MIT +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# restore default shell +echo_info "chsh -s \"$(command -v bash)\"" +chsh -s "$(command -v bash)" + +# uninstall zsh +echo_info 'sudo apt-get purge -y zsh zsh-common' +sudo apt-get purge -y zsh zsh-common + +# cleaning +echo_info 'sudo apt -y autoremove' +sudo apt -y autoremove + diff --git a/system/repair_snap.sh b/system/repair_snap.sh new file mode 100755 index 0000000..7fc6562 --- /dev/null +++ b/system/repair_snap.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * repair snap +# * +# * @category system +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Repair snap' + +# if snap showing "snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks" +# sudo snap refresh core --beta + +# remove snap +echo_info 'sudo apt-get remove --assume-yes snapd' +sudo apt-get remove --assume-yes snapd + +echo_info 'sudo apt-get purge --assume-yes snapd snap-confine' +sudo apt-get purge --assume-yes snapd snap-confine + +# clear snap cache +echo_info 'sudo rm -f /var/lib/snapd/cache/*' +sudo rm -f /var/lib/snapd/cache/* + +# remove all accounts from snap +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/account/* + +echo_info 'sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/*' +sudo rm -rf /var/lib/snapd/assertions/asserts-v0/snap-declaration/* + +# remove snapshots +echo_info 'sudo rm -f /var/lib/snapd/snapshots/*' +sudo rm -f /var/lib/snapd/snapshots/* + +# remove old snaps +LANG=C snap list --all | awk '/disabled/{print $1, $3}' | +while read -r SNAPNAME revision; do + snap remove "${SNAPNAME}" --revision="${revision}" +done + +# list upgradable snaps +echo_info 'sudo snap refresh --list' +sudo snap refresh --list + +# list installed apps +# sudo snap list diff --git a/themes/bootloader-themes/CyberRe/background.png b/themes/bootloader-themes/CyberRe/background.png new file mode 100755 index 0000000..64803d9 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/background.png differ diff --git a/themes/bootloader-themes/CyberRe/boot_menu2_c.png b/themes/bootloader-themes/CyberRe/boot_menu2_c.png new file mode 100755 index 0000000..af67642 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/boot_menu2_c.png differ diff --git a/themes/bootloader-themes/CyberRe/dejavu_14.pf2 b/themes/bootloader-themes/CyberRe/dejavu_14.pf2 new file mode 100755 index 0000000..e85fe3a Binary files /dev/null and b/themes/bootloader-themes/CyberRe/dejavu_14.pf2 differ diff --git a/themes/bootloader-themes/CyberRe/droidlogo_bold_17.pf2 b/themes/bootloader-themes/CyberRe/droidlogo_bold_17.pf2 new file mode 100755 index 0000000..2199357 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/droidlogo_bold_17.pf2 differ diff --git a/themes/bootloader-themes/CyberRe/droidlogo_bold_20.pf2 b/themes/bootloader-themes/CyberRe/droidlogo_bold_20.pf2 new file mode 100755 index 0000000..c91a693 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/droidlogo_bold_20.pf2 differ diff --git a/themes/bootloader-themes/CyberRe/droidlogo_bold_26.pf2 b/themes/bootloader-themes/CyberRe/droidlogo_bold_26.pf2 new file mode 100755 index 0000000..3c0d157 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/droidlogo_bold_26.pf2 differ diff --git a/themes/bootloader-themes/CyberRe/droidlogo_regular_12.pf2 b/themes/bootloader-themes/CyberRe/droidlogo_regular_12.pf2 new file mode 100755 index 0000000..53187f4 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/droidlogo_regular_12.pf2 differ diff --git a/themes/bootloader-themes/CyberRe/droidlogo_regular_17.pf2 b/themes/bootloader-themes/CyberRe/droidlogo_regular_17.pf2 new file mode 100755 index 0000000..607bcf2 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/droidlogo_regular_17.pf2 differ diff --git a/themes/bootloader-themes/CyberRe/highlight_c.png b/themes/bootloader-themes/CyberRe/highlight_c.png new file mode 100755 index 0000000..dc9f694 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/highlight_c.png differ diff --git a/themes/bootloader-themes/CyberRe/highlight_w.png b/themes/bootloader-themes/CyberRe/highlight_w.png new file mode 100755 index 0000000..e003713 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/highlight_w.png differ diff --git a/themes/bootloader-themes/CyberRe/preview.png b/themes/bootloader-themes/CyberRe/preview.png new file mode 100755 index 0000000..e7e5049 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/preview.png differ diff --git a/themes/bootloader-themes/CyberRe/progress_highlight_c.png b/themes/bootloader-themes/CyberRe/progress_highlight_c.png new file mode 100755 index 0000000..c9a4643 Binary files /dev/null and b/themes/bootloader-themes/CyberRe/progress_highlight_c.png differ diff --git a/themes/bootloader-themes/CyberRe/theme.txt b/themes/bootloader-themes/CyberRe/theme.txt new file mode 100755 index 0000000..bb006f1 --- /dev/null +++ b/themes/bootloader-themes/CyberRe/theme.txt @@ -0,0 +1,49 @@ +# Copyright (C) 2020 L. Henrique Lopes - HENK + +# general settings + title-text: "" + title-color: "#3ec6ae" + message-font: "DejaVu Sans Regular 14" + message-color: "#fd262e" + message-bg-color: "#808080" + desktop-image: "background.png" + desktop-color: "#808080" + terminal-font: "DejaVu Sans Regular 14" + + +# boot menu ++ boot_menu { + left = 28% + width = 50% + top = 22% + height = 45% + item_font = "DroidLogo Regular 17" + item_color = "#fb3048" + selected_item_font = "DroidLogo Regular 17" + selected_item_color = "#74d6cf" + icon_width = 16 + icon_height = 16 + item_height = 33 + item_padding = 20 + item_icon_space = 5 + item_spacing = 5 + menu_pixmap_style = "boot_menu2_*.png" + selected_item_pixmap_style = "highlight_*.png" +} + +# Show progress ++ progress_bar { + id = "__timeout__" + left = 0% + width = 100% + top = 99% + height = 31 + show_text = false + text = "" + fg_color = "#3daee9" + bg_color = "#31363b" + border_color = "#31363b" + highlight_style = "progress_highlight_*.png" +} + + diff --git a/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_12.pf2 b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_12.pf2 new file mode 100644 index 0000000..f2556c7 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_12.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_14.pf2 b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_14.pf2 new file mode 100644 index 0000000..a846e50 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_14.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_16.pf2 b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_16.pf2 new file mode 100644 index 0000000..658fd70 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_16.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_24.pf2 b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_24.pf2 new file mode 100644 index 0000000..e6fda6e Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_24.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_32.pf2 b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_32.pf2 new file mode 100644 index 0000000..2549ac1 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_32.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_48.pf2 b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_48.pf2 new file mode 100644 index 0000000..3ddbb81 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/Blender_Pro_Book_48.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/background.png b/themes/bootloader-themes/Cyberpunk/background.png new file mode 100644 index 0000000..b6bc9f6 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/background.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/Manjaro.i686.png b/themes/bootloader-themes/Cyberpunk/icons/Manjaro.i686.png new file mode 100644 index 0000000..4376e3a Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/Manjaro.i686.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/Manjaro.x86_64.png b/themes/bootloader-themes/Cyberpunk/icons/Manjaro.x86_64.png new file mode 100644 index 0000000..4376e3a Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/Manjaro.x86_64.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/android-x86.png b/themes/bootloader-themes/Cyberpunk/icons/android-x86.png new file mode 100644 index 0000000..e0f12ae Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/android-x86.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/android.png b/themes/bootloader-themes/Cyberpunk/icons/android.png new file mode 100644 index 0000000..e0f12ae Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/android.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/antergos.png b/themes/bootloader-themes/Cyberpunk/icons/antergos.png new file mode 100644 index 0000000..efcdec7 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/antergos.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/arch.png b/themes/bootloader-themes/Cyberpunk/icons/arch.png new file mode 100644 index 0000000..25e2217 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/arch.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/cancel.png b/themes/bootloader-themes/Cyberpunk/icons/cancel.png new file mode 100644 index 0000000..6374e9d Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/cancel.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/cd.png b/themes/bootloader-themes/Cyberpunk/icons/cd.png new file mode 100644 index 0000000..ab7e3e5 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/cd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/chakra.png b/themes/bootloader-themes/Cyberpunk/icons/chakra.png new file mode 100644 index 0000000..be1da23 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/chakra.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/debian.png b/themes/bootloader-themes/Cyberpunk/icons/debian.png new file mode 100644 index 0000000..0a95576 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/debian.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/deepin.png b/themes/bootloader-themes/Cyberpunk/icons/deepin.png new file mode 100644 index 0000000..1b4fbcf Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/deepin.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/devuan.png b/themes/bootloader-themes/Cyberpunk/icons/devuan.png new file mode 100644 index 0000000..457b0ce Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/devuan.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/dragonflybsd.png b/themes/bootloader-themes/Cyberpunk/icons/dragonflybsd.png new file mode 100644 index 0000000..99c987a Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/dragonflybsd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/driver.png b/themes/bootloader-themes/Cyberpunk/icons/driver.png new file mode 100644 index 0000000..8c04e4d Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/driver.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/dvd.png b/themes/bootloader-themes/Cyberpunk/icons/dvd.png new file mode 100644 index 0000000..7f18df0 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/dvd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/edit.png b/themes/bootloader-themes/Cyberpunk/icons/edit.png new file mode 100644 index 0000000..024bcad Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/edit.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/efi.png b/themes/bootloader-themes/Cyberpunk/icons/efi.png new file mode 100644 index 0000000..701ab8b Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/efi.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/elementary.png b/themes/bootloader-themes/Cyberpunk/icons/elementary.png new file mode 100644 index 0000000..26b5f5e Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/elementary.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/endeavouros.png b/themes/bootloader-themes/Cyberpunk/icons/endeavouros.png new file mode 100644 index 0000000..710d929 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/endeavouros.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/fedora.png b/themes/bootloader-themes/Cyberpunk/icons/fedora.png new file mode 100644 index 0000000..9096d47 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/fedora.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/find.efi.png b/themes/bootloader-themes/Cyberpunk/icons/find.efi.png new file mode 100644 index 0000000..d9d66b8 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/find.efi.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/find.none.png b/themes/bootloader-themes/Cyberpunk/icons/find.none.png new file mode 100644 index 0000000..6ec0579 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/find.none.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/freebsd.png b/themes/bootloader-themes/Cyberpunk/icons/freebsd.png new file mode 100644 index 0000000..4c07bec Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/freebsd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/gentoo.png b/themes/bootloader-themes/Cyberpunk/icons/gentoo.png new file mode 100644 index 0000000..41b0b2a Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/gentoo.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/gnu-linux.png b/themes/bootloader-themes/Cyberpunk/icons/gnu-linux.png new file mode 100644 index 0000000..46a74c6 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/gnu-linux.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/guix.png b/themes/bootloader-themes/Cyberpunk/icons/guix.png new file mode 100644 index 0000000..61a1aa8 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/guix.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/guixsd.png b/themes/bootloader-themes/Cyberpunk/icons/guixsd.png new file mode 100644 index 0000000..38e2b31 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/guixsd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/hard-drive.png b/themes/bootloader-themes/Cyberpunk/icons/hard-drive.png new file mode 100644 index 0000000..0a6e71c Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/hard-drive.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/harddrive.png b/themes/bootloader-themes/Cyberpunk/icons/harddrive.png new file mode 100644 index 0000000..39e7495 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/harddrive.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/hdd.png b/themes/bootloader-themes/Cyberpunk/icons/hdd.png new file mode 100644 index 0000000..9d52357 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/hdd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/help.png b/themes/bootloader-themes/Cyberpunk/icons/help.png new file mode 100644 index 0000000..6fd9d49 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/help.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/iso.png b/themes/bootloader-themes/Cyberpunk/icons/iso.png new file mode 100644 index 0000000..cfcae6f Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/iso.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/kali.png b/themes/bootloader-themes/Cyberpunk/icons/kali.png new file mode 100644 index 0000000..357ae85 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/kali.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/kaos.png b/themes/bootloader-themes/Cyberpunk/icons/kaos.png new file mode 100644 index 0000000..746b83e Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/kaos.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/kbd.png b/themes/bootloader-themes/Cyberpunk/icons/kbd.png new file mode 100644 index 0000000..d11d1f7 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/kbd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/korora.png b/themes/bootloader-themes/Cyberpunk/icons/korora.png new file mode 100644 index 0000000..2e7b0e4 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/korora.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/kubuntu.png b/themes/bootloader-themes/Cyberpunk/icons/kubuntu.png new file mode 100644 index 0000000..3985b48 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/kubuntu.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/lang.png b/themes/bootloader-themes/Cyberpunk/icons/lang.png new file mode 100644 index 0000000..54c1407 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/lang.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/lfs.png b/themes/bootloader-themes/Cyberpunk/icons/lfs.png new file mode 100644 index 0000000..46a74c6 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/lfs.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/linux.png b/themes/bootloader-themes/Cyberpunk/icons/linux.png new file mode 100644 index 0000000..46a74c6 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/linux.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/linuxmint.png b/themes/bootloader-themes/Cyberpunk/icons/linuxmint.png new file mode 100644 index 0000000..dec24bc Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/linuxmint.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/lubuntu.png b/themes/bootloader-themes/Cyberpunk/icons/lubuntu.png new file mode 100644 index 0000000..c9ea208 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/lubuntu.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/macos.png b/themes/bootloader-themes/Cyberpunk/icons/macos.png new file mode 100644 index 0000000..87e0e81 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/macos.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/macosx.png b/themes/bootloader-themes/Cyberpunk/icons/macosx.png new file mode 100644 index 0000000..54a92a4 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/macosx.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/mageia.png b/themes/bootloader-themes/Cyberpunk/icons/mageia.png new file mode 100644 index 0000000..a4d0227 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/mageia.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/manjaro.png b/themes/bootloader-themes/Cyberpunk/icons/manjaro.png new file mode 100644 index 0000000..4376e3a Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/manjaro.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/memtest.png b/themes/bootloader-themes/Cyberpunk/icons/memtest.png new file mode 100644 index 0000000..a02a148 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/memtest.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/memtest86.png b/themes/bootloader-themes/Cyberpunk/icons/memtest86.png new file mode 100644 index 0000000..2b89c84 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/memtest86.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/neon.png b/themes/bootloader-themes/Cyberpunk/icons/neon.png new file mode 100644 index 0000000..6ad23ac Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/neon.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/netbsd.png b/themes/bootloader-themes/Cyberpunk/icons/netbsd.png new file mode 100644 index 0000000..2c01056 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/netbsd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/nixos.png b/themes/bootloader-themes/Cyberpunk/icons/nixos.png new file mode 100644 index 0000000..1384064 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/nixos.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/openbsd.png b/themes/bootloader-themes/Cyberpunk/icons/openbsd.png new file mode 100644 index 0000000..735f23c Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/openbsd.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/opensuse.png b/themes/bootloader-themes/Cyberpunk/icons/opensuse.png new file mode 100644 index 0000000..d467135 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/opensuse.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/optical.png b/themes/bootloader-themes/Cyberpunk/icons/optical.png new file mode 100644 index 0000000..e858d4b Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/optical.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/os.png b/themes/bootloader-themes/Cyberpunk/icons/os.png new file mode 100644 index 0000000..94dc684 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/os.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/osx.png b/themes/bootloader-themes/Cyberpunk/icons/osx.png new file mode 100644 index 0000000..d477d68 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/osx.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/poweroff.png b/themes/bootloader-themes/Cyberpunk/icons/poweroff.png new file mode 100644 index 0000000..77e3dbd Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/poweroff.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/puppy.png b/themes/bootloader-themes/Cyberpunk/icons/puppy.png new file mode 100644 index 0000000..183b2cd Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/puppy.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/reactos.png b/themes/bootloader-themes/Cyberpunk/icons/reactos.png new file mode 100644 index 0000000..b9dc83e Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/reactos.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/reboot.png b/themes/bootloader-themes/Cyberpunk/icons/reboot.png new file mode 100644 index 0000000..b12a44c Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/reboot.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/recovery.png b/themes/bootloader-themes/Cyberpunk/icons/recovery.png new file mode 100644 index 0000000..9ba0c30 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/recovery.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/redhat.png b/themes/bootloader-themes/Cyberpunk/icons/redhat.png new file mode 100644 index 0000000..6a7638e Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/redhat.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/restart.png b/themes/bootloader-themes/Cyberpunk/icons/restart.png new file mode 100644 index 0000000..b7eba91 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/restart.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/sabayon.png b/themes/bootloader-themes/Cyberpunk/icons/sabayon.png new file mode 100644 index 0000000..da2efbb Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/sabayon.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/shutdown.png b/themes/bootloader-themes/Cyberpunk/icons/shutdown.png new file mode 100644 index 0000000..260bf67 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/shutdown.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/siduction.png b/themes/bootloader-themes/Cyberpunk/icons/siduction.png new file mode 100644 index 0000000..f2f8459 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/siduction.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/slackware.png b/themes/bootloader-themes/Cyberpunk/icons/slackware.png new file mode 100644 index 0000000..c20b809 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/slackware.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/solus.png b/themes/bootloader-themes/Cyberpunk/icons/solus.png new file mode 100644 index 0000000..450ec6d Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/solus.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/solusos.png b/themes/bootloader-themes/Cyberpunk/icons/solusos.png new file mode 100644 index 0000000..80ea0e8 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/solusos.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/steam.png b/themes/bootloader-themes/Cyberpunk/icons/steam.png new file mode 100644 index 0000000..fbc115b Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/steam.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/steamos.png b/themes/bootloader-themes/Cyberpunk/icons/steamos.png new file mode 100644 index 0000000..37d4066 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/steamos.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/suse.png b/themes/bootloader-themes/Cyberpunk/icons/suse.png new file mode 100644 index 0000000..7c260b8 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/suse.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/system-setup.png b/themes/bootloader-themes/Cyberpunk/icons/system-setup.png new file mode 100644 index 0000000..320e86e Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/system-setup.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/system_setup.png b/themes/bootloader-themes/Cyberpunk/icons/system_setup.png new file mode 100644 index 0000000..0aa4f0c Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/system_setup.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/systemsetup.png b/themes/bootloader-themes/Cyberpunk/icons/systemsetup.png new file mode 100644 index 0000000..6ecadfd Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/systemsetup.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/type.png b/themes/bootloader-themes/Cyberpunk/icons/type.png new file mode 100644 index 0000000..c658255 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/type.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/tz.png b/themes/bootloader-themes/Cyberpunk/icons/tz.png new file mode 100644 index 0000000..26350eb Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/tz.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/ubuntu-budgie.png b/themes/bootloader-themes/Cyberpunk/icons/ubuntu-budgie.png new file mode 100644 index 0000000..83b0cff Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/ubuntu-budgie.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/ubuntu-mate.png b/themes/bootloader-themes/Cyberpunk/icons/ubuntu-mate.png new file mode 100644 index 0000000..3f90d9f Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/ubuntu-mate.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/ubuntu.png b/themes/bootloader-themes/Cyberpunk/icons/ubuntu.png new file mode 100644 index 0000000..b0add07 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/ubuntu.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/ubuntu_budgie.png b/themes/bootloader-themes/Cyberpunk/icons/ubuntu_budgie.png new file mode 100644 index 0000000..f644534 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/ubuntu_budgie.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/ubuntu_mate.png b/themes/bootloader-themes/Cyberpunk/icons/ubuntu_mate.png new file mode 100644 index 0000000..136b32b Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/ubuntu_mate.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/unknown.png b/themes/bootloader-themes/Cyberpunk/icons/unknown.png new file mode 100644 index 0000000..6ec0579 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/unknown.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/unset.png b/themes/bootloader-themes/Cyberpunk/icons/unset.png new file mode 100644 index 0000000..5c632a4 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/unset.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/usb.png b/themes/bootloader-themes/Cyberpunk/icons/usb.png new file mode 100644 index 0000000..30eca17 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/usb.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/void.png b/themes/bootloader-themes/Cyberpunk/icons/void.png new file mode 100644 index 0000000..5b0e8d6 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/void.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/windows.png b/themes/bootloader-themes/Cyberpunk/icons/windows.png new file mode 100644 index 0000000..45da55c Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/windows.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/x86android.png b/themes/bootloader-themes/Cyberpunk/icons/x86android.png new file mode 100644 index 0000000..e0f12ae Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/x86android.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/xubuntu.png b/themes/bootloader-themes/Cyberpunk/icons/xubuntu.png new file mode 100644 index 0000000..6a3126a Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/xubuntu.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/zorin.png b/themes/bootloader-themes/Cyberpunk/icons/zorin.png new file mode 100644 index 0000000..e392436 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/zorin.png differ diff --git a/themes/bootloader-themes/Cyberpunk/icons/zorinos.png b/themes/bootloader-themes/Cyberpunk/icons/zorinos.png new file mode 100644 index 0000000..f22d97a Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/icons/zorinos.png differ diff --git a/themes/bootloader-themes/Cyberpunk/progress_bar_c.png b/themes/bootloader-themes/Cyberpunk/progress_bar_c.png new file mode 100644 index 0000000..a0fb812 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/progress_bar_c.png differ diff --git a/themes/bootloader-themes/Cyberpunk/progress_highlight_c.png b/themes/bootloader-themes/Cyberpunk/progress_highlight_c.png new file mode 100644 index 0000000..856cf82 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/progress_highlight_c.png differ diff --git a/themes/bootloader-themes/Cyberpunk/sb_frame_c.png b/themes/bootloader-themes/Cyberpunk/sb_frame_c.png new file mode 100644 index 0000000..1f3eb64 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/sb_frame_c.png differ diff --git a/themes/bootloader-themes/Cyberpunk/sb_frame_n.png b/themes/bootloader-themes/Cyberpunk/sb_frame_n.png new file mode 100644 index 0000000..316f912 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/sb_frame_n.png differ diff --git a/themes/bootloader-themes/Cyberpunk/sb_frame_s.png b/themes/bootloader-themes/Cyberpunk/sb_frame_s.png new file mode 100644 index 0000000..8cde8fd Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/sb_frame_s.png differ diff --git a/themes/bootloader-themes/Cyberpunk/sb_thumb_c.png b/themes/bootloader-themes/Cyberpunk/sb_thumb_c.png new file mode 100644 index 0000000..a6fdbd6 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/sb_thumb_c.png differ diff --git a/themes/bootloader-themes/Cyberpunk/sb_thumb_n.png b/themes/bootloader-themes/Cyberpunk/sb_thumb_n.png new file mode 100644 index 0000000..1743ebe Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/sb_thumb_n.png differ diff --git a/themes/bootloader-themes/Cyberpunk/sb_thumb_s.png b/themes/bootloader-themes/Cyberpunk/sb_thumb_s.png new file mode 100644 index 0000000..b11a2c6 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/sb_thumb_s.png differ diff --git a/themes/bootloader-themes/Cyberpunk/select_c.png b/themes/bootloader-themes/Cyberpunk/select_c.png new file mode 100644 index 0000000..b272750 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/select_c.png differ diff --git a/themes/bootloader-themes/Cyberpunk/select_e.png b/themes/bootloader-themes/Cyberpunk/select_e.png new file mode 100644 index 0000000..34f608f Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/select_e.png differ diff --git a/themes/bootloader-themes/Cyberpunk/select_w.png b/themes/bootloader-themes/Cyberpunk/select_w.png new file mode 100644 index 0000000..098f5a7 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/select_w.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_c.png b/themes/bootloader-themes/Cyberpunk/terminal_box_c.png new file mode 100644 index 0000000..d0dd52a Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_c.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_e.png b/themes/bootloader-themes/Cyberpunk/terminal_box_e.png new file mode 100644 index 0000000..394cbe4 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_e.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_n.png b/themes/bootloader-themes/Cyberpunk/terminal_box_n.png new file mode 100644 index 0000000..476f8bc Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_n.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_ne.png b/themes/bootloader-themes/Cyberpunk/terminal_box_ne.png new file mode 100644 index 0000000..9e26959 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_ne.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_nw.png b/themes/bootloader-themes/Cyberpunk/terminal_box_nw.png new file mode 100644 index 0000000..5c3cba8 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_nw.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_s.png b/themes/bootloader-themes/Cyberpunk/terminal_box_s.png new file mode 100644 index 0000000..85a8901 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_s.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_se.png b/themes/bootloader-themes/Cyberpunk/terminal_box_se.png new file mode 100644 index 0000000..d8627ee Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_se.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_sw.png b/themes/bootloader-themes/Cyberpunk/terminal_box_sw.png new file mode 100644 index 0000000..67c600c Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_sw.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminal_box_w.png b/themes/bootloader-themes/Cyberpunk/terminal_box_w.png new file mode 100644 index 0000000..d066e2d Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminal_box_w.png differ diff --git a/themes/bootloader-themes/Cyberpunk/terminus-12.pf2 b/themes/bootloader-themes/Cyberpunk/terminus-12.pf2 new file mode 100644 index 0000000..6092035 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminus-12.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/terminus-14.pf2 b/themes/bootloader-themes/Cyberpunk/terminus-14.pf2 new file mode 100644 index 0000000..8ab8bd1 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminus-14.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/terminus-16.pf2 b/themes/bootloader-themes/Cyberpunk/terminus-16.pf2 new file mode 100644 index 0000000..6e6b25d Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminus-16.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/terminus-18.pf2 b/themes/bootloader-themes/Cyberpunk/terminus-18.pf2 new file mode 100644 index 0000000..129cef1 Binary files /dev/null and b/themes/bootloader-themes/Cyberpunk/terminus-18.pf2 differ diff --git a/themes/bootloader-themes/Cyberpunk/theme.txt b/themes/bootloader-themes/Cyberpunk/theme.txt new file mode 100644 index 0000000..98e148e --- /dev/null +++ b/themes/bootloader-themes/Cyberpunk/theme.txt @@ -0,0 +1,63 @@ +# GRUB2 gfxmenu Linux theme +# Designed for any resolution + +# Global Property +title-text: "" +desktop-image: "background.png" +desktop-color: "#000000" +terminal-font: "Terminus Regular 14" +terminal-box: "terminal_box_*.png" +terminal-left: "0" +terminal-top: "0" +terminal-width: "100%" +terminal-height: "100%" +terminal-border: "0" + +# Show the boot menu ++ boot_menu { + left = 30% + top = 28% + width = 45% + height = 50% + item_font = "Blender Pro Regular 16" + item_color = "#ffff00" + selected_item_color = "#000000" + icon_width = 32 + icon_height = 32 + item_icon_space = 20 + item_height = 36 + item_padding = 5 + item_spacing = 10 + selected_item_pixmap_style = "select_*.png" + scrollbar = true + scrollbar_width = 24 + scrollbar_thumb = "sb_thumb_*.png" + scrollbar_frame = "sb_frame_*.png" +} + ++ progress_bar { + id = "__timeout__" + left = 23% + width = 60% + top = 80% + height = 31 + show_text = false + text = "" + fg_color = "#ffff00" + bg_color = "#31363b" + border_color = "#31363b" + bar_style = "progress_bar_*.png" + highlight_style = "progress_highlight_*.png" +} + ++ label { + top = 100%-25 + left = 0 + width = 100% + height = 20 + text = "@KEYMAP_MIDDLE@" + align = "center" + font = "Blender Pro Regular 12" + color = "#FFFF00" +} + diff --git a/themes/bootloader-themes/Shodan/bgnd_1024x768.png b/themes/bootloader-themes/Shodan/bgnd_1024x768.png new file mode 100644 index 0000000..18f3584 Binary files /dev/null and b/themes/bootloader-themes/Shodan/bgnd_1024x768.png differ diff --git a/themes/bootloader-themes/Shodan/fonts/unifont_16.pf2 b/themes/bootloader-themes/Shodan/fonts/unifont_16.pf2 new file mode 100644 index 0000000..3ac9cce Binary files /dev/null and b/themes/bootloader-themes/Shodan/fonts/unifont_16.pf2 differ diff --git a/themes/bootloader-themes/Shodan/menu_c.png b/themes/bootloader-themes/Shodan/menu_c.png new file mode 100644 index 0000000..9ce6bc0 Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_c.png differ diff --git a/themes/bootloader-themes/Shodan/menu_e.png b/themes/bootloader-themes/Shodan/menu_e.png new file mode 100644 index 0000000..7ed7b78 Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_e.png differ diff --git a/themes/bootloader-themes/Shodan/menu_n.png b/themes/bootloader-themes/Shodan/menu_n.png new file mode 100644 index 0000000..c96c084 Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_n.png differ diff --git a/themes/bootloader-themes/Shodan/menu_ne.png b/themes/bootloader-themes/Shodan/menu_ne.png new file mode 100644 index 0000000..c5c7599 Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_ne.png differ diff --git a/themes/bootloader-themes/Shodan/menu_nw.png b/themes/bootloader-themes/Shodan/menu_nw.png new file mode 100644 index 0000000..795213c Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_nw.png differ diff --git a/themes/bootloader-themes/Shodan/menu_s.png b/themes/bootloader-themes/Shodan/menu_s.png new file mode 100644 index 0000000..c96c084 Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_s.png differ diff --git a/themes/bootloader-themes/Shodan/menu_se.png b/themes/bootloader-themes/Shodan/menu_se.png new file mode 100644 index 0000000..7c41195 Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_se.png differ diff --git a/themes/bootloader-themes/Shodan/menu_sw.png b/themes/bootloader-themes/Shodan/menu_sw.png new file mode 100644 index 0000000..70aa9a9 Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_sw.png differ diff --git a/themes/bootloader-themes/Shodan/menu_w.png b/themes/bootloader-themes/Shodan/menu_w.png new file mode 100644 index 0000000..fe5f105 Binary files /dev/null and b/themes/bootloader-themes/Shodan/menu_w.png differ diff --git a/themes/bootloader-themes/Shodan/progress_bar_c.png b/themes/bootloader-themes/Shodan/progress_bar_c.png new file mode 100644 index 0000000..c0ae2b1 Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_bar_c.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_c.png b/themes/bootloader-themes/Shodan/progress_border_c.png new file mode 100644 index 0000000..9b063f5 Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_c.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_e.png b/themes/bootloader-themes/Shodan/progress_border_e.png new file mode 100644 index 0000000..e30c7ee Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_e.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_n.png b/themes/bootloader-themes/Shodan/progress_border_n.png new file mode 100644 index 0000000..dbe8be2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_n.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_ne.png b/themes/bootloader-themes/Shodan/progress_border_ne.png new file mode 100644 index 0000000..d1302ed Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_ne.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_nw.png b/themes/bootloader-themes/Shodan/progress_border_nw.png new file mode 100644 index 0000000..7f4dcce Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_nw.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_s.png b/themes/bootloader-themes/Shodan/progress_border_s.png new file mode 100644 index 0000000..ec273c2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_s.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_se.png b/themes/bootloader-themes/Shodan/progress_border_se.png new file mode 100644 index 0000000..0909400 Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_se.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_sw.png b/themes/bootloader-themes/Shodan/progress_border_sw.png new file mode 100644 index 0000000..a25735d Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_sw.png differ diff --git a/themes/bootloader-themes/Shodan/progress_border_w.png b/themes/bootloader-themes/Shodan/progress_border_w.png new file mode 100644 index 0000000..ca2080f Binary files /dev/null and b/themes/bootloader-themes/Shodan/progress_border_w.png differ diff --git a/themes/bootloader-themes/Shodan/slider_c.png b/themes/bootloader-themes/Shodan/slider_c.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/slider_c.png differ diff --git a/themes/bootloader-themes/Shodan/slider_n.png b/themes/bootloader-themes/Shodan/slider_n.png new file mode 100644 index 0000000..eaa55c1 Binary files /dev/null and b/themes/bootloader-themes/Shodan/slider_n.png differ diff --git a/themes/bootloader-themes/Shodan/slider_s.png b/themes/bootloader-themes/Shodan/slider_s.png new file mode 100644 index 0000000..eaa55c1 Binary files /dev/null and b/themes/bootloader-themes/Shodan/slider_s.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_c.png b/themes/bootloader-themes/Shodan/terminal_c.png new file mode 100644 index 0000000..b137fd3 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_c.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_e.png b/themes/bootloader-themes/Shodan/terminal_e.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_e.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_n.png b/themes/bootloader-themes/Shodan/terminal_n.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_n.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_ne.png b/themes/bootloader-themes/Shodan/terminal_ne.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_ne.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_nw.png b/themes/bootloader-themes/Shodan/terminal_nw.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_nw.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_s.png b/themes/bootloader-themes/Shodan/terminal_s.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_s.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_se.png b/themes/bootloader-themes/Shodan/terminal_se.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_se.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_sw.png b/themes/bootloader-themes/Shodan/terminal_sw.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_sw.png differ diff --git a/themes/bootloader-themes/Shodan/terminal_w.png b/themes/bootloader-themes/Shodan/terminal_w.png new file mode 100644 index 0000000..9a993b2 Binary files /dev/null and b/themes/bootloader-themes/Shodan/terminal_w.png differ diff --git a/themes/bootloader-themes/Shodan/theme.txt b/themes/bootloader-themes/Shodan/theme.txt new file mode 100644 index 0000000..2d976c5 --- /dev/null +++ b/themes/bootloader-themes/Shodan/theme.txt @@ -0,0 +1,60 @@ +desktop-image: "bgnd_1024x768.png" +#desktop-color: "#000000" +title-text: "" +#title-color: "#67AC68" +#title-font: "" +terminal-box: "terminal_*.png" +terminal-font: "Unifont Regular 16" +#message-font: "Unifont Regular 16" +#message-color: "#67AC68" +#message-bg-color: "#000000" ++ boot_menu { + visible = true + left = 10 + top = 50%-102 + width = 400 + height = 204 + menu_pixmap_style = "menu_*.png" + scrollbar = true + scrollbar_width = 2 + #scrollbar_frame = "scr_frame_*.png" + scrollbar_thumb = "slider_*.png" + item_font = "Unifont Regular 16" + item_color = "#67AC68" + selected_item_font = "Unifont Regular 16" + selected_item_color= "#00FF00" + #selected_item_pixmap_style = "select_*.png" + item_height = 20 + item_padding = 10 + item_spacing = 0 + item_icon_space = 0 + icon_width = 0 + icon_height = 0 +} ++ progress_bar { + visible = true + id = "__timeout__" + left = 10 + top = 50%+104 + height = 30 + width = 400 + font = "Unifont Regular 16" + text_color = "#00FF00" + fg_color = "#000000" + bg_color = "#67AC68" + border_color = "#67AC68" + text = "@TIMEOUT_NOTIFICATION_SHORT@" + bar_style = "progress_border_*.png" + highlight_style = "progress_bar_*.png" + +} ++ label { + top = 75% + left = 50% + width = 100% + height = 25 + text = "" + align = "center" + font = "Unifont Regular 16" + color = "#FFFFFF" +} \ No newline at end of file diff --git a/themes/bootloader-themes/Vimix/background.jpg b/themes/bootloader-themes/Vimix/background.jpg new file mode 100644 index 0000000..f4720e5 Binary files /dev/null and b/themes/bootloader-themes/Vimix/background.jpg differ diff --git a/themes/bootloader-themes/Vimix/dejavu_32.pf2 b/themes/bootloader-themes/Vimix/dejavu_32.pf2 new file mode 100644 index 0000000..ab25446 Binary files /dev/null and b/themes/bootloader-themes/Vimix/dejavu_32.pf2 differ diff --git a/themes/bootloader-themes/Vimix/dejavu_sans_12.pf2 b/themes/bootloader-themes/Vimix/dejavu_sans_12.pf2 new file mode 100644 index 0000000..19e0499 Binary files /dev/null and b/themes/bootloader-themes/Vimix/dejavu_sans_12.pf2 differ diff --git a/themes/bootloader-themes/Vimix/dejavu_sans_14.pf2 b/themes/bootloader-themes/Vimix/dejavu_sans_14.pf2 new file mode 100644 index 0000000..dcc727e Binary files /dev/null and b/themes/bootloader-themes/Vimix/dejavu_sans_14.pf2 differ diff --git a/themes/bootloader-themes/Vimix/dejavu_sans_16.pf2 b/themes/bootloader-themes/Vimix/dejavu_sans_16.pf2 new file mode 100644 index 0000000..37f3ef4 Binary files /dev/null and b/themes/bootloader-themes/Vimix/dejavu_sans_16.pf2 differ diff --git a/themes/bootloader-themes/Vimix/dejavu_sans_24.pf2 b/themes/bootloader-themes/Vimix/dejavu_sans_24.pf2 new file mode 100644 index 0000000..8c3e434 Binary files /dev/null and b/themes/bootloader-themes/Vimix/dejavu_sans_24.pf2 differ diff --git a/themes/bootloader-themes/Vimix/dejavu_sans_48.pf2 b/themes/bootloader-themes/Vimix/dejavu_sans_48.pf2 new file mode 100644 index 0000000..776c982 Binary files /dev/null and b/themes/bootloader-themes/Vimix/dejavu_sans_48.pf2 differ diff --git a/themes/bootloader-themes/Vimix/icons/Manjaro.i686.png b/themes/bootloader-themes/Vimix/icons/Manjaro.i686.png new file mode 100644 index 0000000..79643c4 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/Manjaro.i686.png differ diff --git a/themes/bootloader-themes/Vimix/icons/Manjaro.x86_64.png b/themes/bootloader-themes/Vimix/icons/Manjaro.x86_64.png new file mode 100644 index 0000000..79643c4 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/Manjaro.x86_64.png differ diff --git a/themes/bootloader-themes/Vimix/icons/antergos.png b/themes/bootloader-themes/Vimix/icons/antergos.png new file mode 100644 index 0000000..f388d80 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/antergos.png differ diff --git a/themes/bootloader-themes/Vimix/icons/arch.png b/themes/bootloader-themes/Vimix/icons/arch.png new file mode 100644 index 0000000..a86a162 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/arch.png differ diff --git a/themes/bootloader-themes/Vimix/icons/archlinux.png b/themes/bootloader-themes/Vimix/icons/archlinux.png new file mode 100644 index 0000000..a86a162 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/archlinux.png differ diff --git a/themes/bootloader-themes/Vimix/icons/arcolinux.png b/themes/bootloader-themes/Vimix/icons/arcolinux.png new file mode 100644 index 0000000..213090a Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/arcolinux.png differ diff --git a/themes/bootloader-themes/Vimix/icons/cancel.png b/themes/bootloader-themes/Vimix/icons/cancel.png new file mode 100644 index 0000000..c352c9a Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/cancel.png differ diff --git a/themes/bootloader-themes/Vimix/icons/chakra.png b/themes/bootloader-themes/Vimix/icons/chakra.png new file mode 100644 index 0000000..940053a Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/chakra.png differ diff --git a/themes/bootloader-themes/Vimix/icons/debian.png b/themes/bootloader-themes/Vimix/icons/debian.png new file mode 100644 index 0000000..4f503c1 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/debian.png differ diff --git a/themes/bootloader-themes/Vimix/icons/deepin.png b/themes/bootloader-themes/Vimix/icons/deepin.png new file mode 100644 index 0000000..a0607e1 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/deepin.png differ diff --git a/themes/bootloader-themes/Vimix/icons/devuan.png b/themes/bootloader-themes/Vimix/icons/devuan.png new file mode 100644 index 0000000..a3490a1 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/devuan.png differ diff --git a/themes/bootloader-themes/Vimix/icons/driver.png b/themes/bootloader-themes/Vimix/icons/driver.png new file mode 100644 index 0000000..db8a364 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/driver.png differ diff --git a/themes/bootloader-themes/Vimix/icons/edit.png b/themes/bootloader-themes/Vimix/icons/edit.png new file mode 100644 index 0000000..2109dc4 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/edit.png differ diff --git a/themes/bootloader-themes/Vimix/icons/efi.png b/themes/bootloader-themes/Vimix/icons/efi.png new file mode 100644 index 0000000..1085045 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/efi.png differ diff --git a/themes/bootloader-themes/Vimix/icons/elementary.png b/themes/bootloader-themes/Vimix/icons/elementary.png new file mode 100644 index 0000000..4543a92 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/elementary.png differ diff --git a/themes/bootloader-themes/Vimix/icons/endeavouros.png b/themes/bootloader-themes/Vimix/icons/endeavouros.png new file mode 100644 index 0000000..3d45b99 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/endeavouros.png differ diff --git a/themes/bootloader-themes/Vimix/icons/fedora.png b/themes/bootloader-themes/Vimix/icons/fedora.png new file mode 100644 index 0000000..b06e6e7 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/fedora.png differ diff --git a/themes/bootloader-themes/Vimix/icons/find.efi.png b/themes/bootloader-themes/Vimix/icons/find.efi.png new file mode 100644 index 0000000..b06454d Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/find.efi.png differ diff --git a/themes/bootloader-themes/Vimix/icons/find.none.png b/themes/bootloader-themes/Vimix/icons/find.none.png new file mode 100644 index 0000000..3c91e94 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/find.none.png differ diff --git a/themes/bootloader-themes/Vimix/icons/gentoo.png b/themes/bootloader-themes/Vimix/icons/gentoo.png new file mode 100644 index 0000000..9fe5177 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/gentoo.png differ diff --git a/themes/bootloader-themes/Vimix/icons/gnu-linux.png b/themes/bootloader-themes/Vimix/icons/gnu-linux.png new file mode 100644 index 0000000..c36f960 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/gnu-linux.png differ diff --git a/themes/bootloader-themes/Vimix/icons/help.png b/themes/bootloader-themes/Vimix/icons/help.png new file mode 100644 index 0000000..11356db Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/help.png differ diff --git a/themes/bootloader-themes/Vimix/icons/kali.png b/themes/bootloader-themes/Vimix/icons/kali.png new file mode 100644 index 0000000..141bfee Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/kali.png differ diff --git a/themes/bootloader-themes/Vimix/icons/kaos.png b/themes/bootloader-themes/Vimix/icons/kaos.png new file mode 100644 index 0000000..5439512 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/kaos.png differ diff --git a/themes/bootloader-themes/Vimix/icons/kbd.png b/themes/bootloader-themes/Vimix/icons/kbd.png new file mode 100644 index 0000000..5e177f7 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/kbd.png differ diff --git a/themes/bootloader-themes/Vimix/icons/korora.png b/themes/bootloader-themes/Vimix/icons/korora.png new file mode 100644 index 0000000..d146940 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/korora.png differ diff --git a/themes/bootloader-themes/Vimix/icons/kubuntu.png b/themes/bootloader-themes/Vimix/icons/kubuntu.png new file mode 100644 index 0000000..1a4230e Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/kubuntu.png differ diff --git a/themes/bootloader-themes/Vimix/icons/lang.png b/themes/bootloader-themes/Vimix/icons/lang.png new file mode 100644 index 0000000..8051692 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/lang.png differ diff --git a/themes/bootloader-themes/Vimix/icons/lfs.png b/themes/bootloader-themes/Vimix/icons/lfs.png new file mode 100644 index 0000000..c36f960 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/lfs.png differ diff --git a/themes/bootloader-themes/Vimix/icons/linux.png b/themes/bootloader-themes/Vimix/icons/linux.png new file mode 100644 index 0000000..c36f960 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/linux.png differ diff --git a/themes/bootloader-themes/Vimix/icons/linuxmint.png b/themes/bootloader-themes/Vimix/icons/linuxmint.png new file mode 100644 index 0000000..0db2010 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/linuxmint.png differ diff --git a/themes/bootloader-themes/Vimix/icons/lubuntu.png b/themes/bootloader-themes/Vimix/icons/lubuntu.png new file mode 100644 index 0000000..effcd05 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/lubuntu.png differ diff --git a/themes/bootloader-themes/Vimix/icons/macosx.png b/themes/bootloader-themes/Vimix/icons/macosx.png new file mode 100644 index 0000000..68ff105 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/macosx.png differ diff --git a/themes/bootloader-themes/Vimix/icons/mageia.png b/themes/bootloader-themes/Vimix/icons/mageia.png new file mode 100644 index 0000000..5133b97 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/mageia.png differ diff --git a/themes/bootloader-themes/Vimix/icons/manjaro.png b/themes/bootloader-themes/Vimix/icons/manjaro.png new file mode 100644 index 0000000..79643c4 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/manjaro.png differ diff --git a/themes/bootloader-themes/Vimix/icons/memtest.png b/themes/bootloader-themes/Vimix/icons/memtest.png new file mode 100644 index 0000000..db8a364 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/memtest.png differ diff --git a/themes/bootloader-themes/Vimix/icons/opensuse.png b/themes/bootloader-themes/Vimix/icons/opensuse.png new file mode 100644 index 0000000..3ac99e0 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/opensuse.png differ diff --git a/themes/bootloader-themes/Vimix/icons/pop-os.png b/themes/bootloader-themes/Vimix/icons/pop-os.png new file mode 100644 index 0000000..cef4e1b Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/pop-os.png differ diff --git a/themes/bootloader-themes/Vimix/icons/recovery.png b/themes/bootloader-themes/Vimix/icons/recovery.png new file mode 100644 index 0000000..259131a Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/recovery.png differ diff --git a/themes/bootloader-themes/Vimix/icons/restart.png b/themes/bootloader-themes/Vimix/icons/restart.png new file mode 100644 index 0000000..15ba3d6 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/restart.png differ diff --git a/themes/bootloader-themes/Vimix/icons/shutdown.png b/themes/bootloader-themes/Vimix/icons/shutdown.png new file mode 100644 index 0000000..10a9488 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/shutdown.png differ diff --git a/themes/bootloader-themes/Vimix/icons/siduction.png b/themes/bootloader-themes/Vimix/icons/siduction.png new file mode 100644 index 0000000..5e4cdaf Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/siduction.png differ diff --git a/themes/bootloader-themes/Vimix/icons/solus.png b/themes/bootloader-themes/Vimix/icons/solus.png new file mode 100644 index 0000000..c91e6b5 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/solus.png differ diff --git a/themes/bootloader-themes/Vimix/icons/steamos.png b/themes/bootloader-themes/Vimix/icons/steamos.png new file mode 100644 index 0000000..23011cd Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/steamos.png differ diff --git a/themes/bootloader-themes/Vimix/icons/type.png b/themes/bootloader-themes/Vimix/icons/type.png new file mode 100644 index 0000000..6e497de Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/type.png differ diff --git a/themes/bootloader-themes/Vimix/icons/tz.png b/themes/bootloader-themes/Vimix/icons/tz.png new file mode 100644 index 0000000..bd5ce0a Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/tz.png differ diff --git a/themes/bootloader-themes/Vimix/icons/ubuntu.png b/themes/bootloader-themes/Vimix/icons/ubuntu.png new file mode 100644 index 0000000..761defa Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/ubuntu.png differ diff --git a/themes/bootloader-themes/Vimix/icons/unknown.png b/themes/bootloader-themes/Vimix/icons/unknown.png new file mode 100644 index 0000000..c36f960 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/unknown.png differ diff --git a/themes/bootloader-themes/Vimix/icons/unset.png b/themes/bootloader-themes/Vimix/icons/unset.png new file mode 100644 index 0000000..675cdf0 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/unset.png differ diff --git a/themes/bootloader-themes/Vimix/icons/void.png b/themes/bootloader-themes/Vimix/icons/void.png new file mode 100644 index 0000000..91ec934 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/void.png differ diff --git a/themes/bootloader-themes/Vimix/icons/windows.png b/themes/bootloader-themes/Vimix/icons/windows.png new file mode 100644 index 0000000..0998c59 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/windows.png differ diff --git a/themes/bootloader-themes/Vimix/icons/xubuntu.png b/themes/bootloader-themes/Vimix/icons/xubuntu.png new file mode 100644 index 0000000..d592ee1 Binary files /dev/null and b/themes/bootloader-themes/Vimix/icons/xubuntu.png differ diff --git a/themes/bootloader-themes/Vimix/select_c.png b/themes/bootloader-themes/Vimix/select_c.png new file mode 100644 index 0000000..b1f8d58 Binary files /dev/null and b/themes/bootloader-themes/Vimix/select_c.png differ diff --git a/themes/bootloader-themes/Vimix/select_e.png b/themes/bootloader-themes/Vimix/select_e.png new file mode 100644 index 0000000..9332368 Binary files /dev/null and b/themes/bootloader-themes/Vimix/select_e.png differ diff --git a/themes/bootloader-themes/Vimix/select_w.png b/themes/bootloader-themes/Vimix/select_w.png new file mode 100644 index 0000000..28f6424 Binary files /dev/null and b/themes/bootloader-themes/Vimix/select_w.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_c.png b/themes/bootloader-themes/Vimix/terminal_box_c.png new file mode 100644 index 0000000..d0dd52a Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_c.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_e.png b/themes/bootloader-themes/Vimix/terminal_box_e.png new file mode 100644 index 0000000..394cbe4 Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_e.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_n.png b/themes/bootloader-themes/Vimix/terminal_box_n.png new file mode 100644 index 0000000..476f8bc Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_n.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_ne.png b/themes/bootloader-themes/Vimix/terminal_box_ne.png new file mode 100644 index 0000000..9e26959 Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_ne.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_nw.png b/themes/bootloader-themes/Vimix/terminal_box_nw.png new file mode 100644 index 0000000..5c3cba8 Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_nw.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_s.png b/themes/bootloader-themes/Vimix/terminal_box_s.png new file mode 100644 index 0000000..85a8901 Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_s.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_se.png b/themes/bootloader-themes/Vimix/terminal_box_se.png new file mode 100644 index 0000000..d8627ee Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_se.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_sw.png b/themes/bootloader-themes/Vimix/terminal_box_sw.png new file mode 100644 index 0000000..67c600c Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_sw.png differ diff --git a/themes/bootloader-themes/Vimix/terminal_box_w.png b/themes/bootloader-themes/Vimix/terminal_box_w.png new file mode 100644 index 0000000..d066e2d Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminal_box_w.png differ diff --git a/themes/bootloader-themes/Vimix/terminus-12.pf2 b/themes/bootloader-themes/Vimix/terminus-12.pf2 new file mode 100644 index 0000000..6092035 Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminus-12.pf2 differ diff --git a/themes/bootloader-themes/Vimix/terminus-14.pf2 b/themes/bootloader-themes/Vimix/terminus-14.pf2 new file mode 100644 index 0000000..8ab8bd1 Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminus-14.pf2 differ diff --git a/themes/bootloader-themes/Vimix/terminus-16.pf2 b/themes/bootloader-themes/Vimix/terminus-16.pf2 new file mode 100644 index 0000000..6e6b25d Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminus-16.pf2 differ diff --git a/themes/bootloader-themes/Vimix/terminus-18.pf2 b/themes/bootloader-themes/Vimix/terminus-18.pf2 new file mode 100644 index 0000000..129cef1 Binary files /dev/null and b/themes/bootloader-themes/Vimix/terminus-18.pf2 differ diff --git a/themes/bootloader-themes/Vimix/theme.txt b/themes/bootloader-themes/Vimix/theme.txt new file mode 100644 index 0000000..b2fafab --- /dev/null +++ b/themes/bootloader-themes/Vimix/theme.txt @@ -0,0 +1,44 @@ +# GRUB2 gfxmenu Linux theme +# Designed for any resolution + +# Global Property +title-text: "" +desktop-image: "background.jpg" +desktop-color: "#000000" +terminal-font: "Terminus Regular 14" +terminal-box: "terminal_box_*.png" +terminal-left: "0" +terminal-top: "0" +terminal-width: "100%" +terminal-height: "100%" +terminal-border: "0" + +# Show the boot menu ++ boot_menu { + left = 30% + top = 30% + width = 45% + height = 60% + item_font = "Unifont Regular 16" + item_color = "#cccccc" + selected_item_color = "#ffffff" + icon_width = 32 + icon_height = 32 + item_icon_space = 20 + item_height = 36 + item_padding = 5 + item_spacing = 10 + selected_item_pixmap_style = "select_*.png" +} + +# Show a countdown message using the label component ++ label { + top = 82% + left = 32% + width = 30% + align = "center" + id = "__timeout__" + text = "Booting in %d seconds" + color = "#cccccc" + font = "Unifont Regular 16" +} diff --git a/themes/bootloader-themes/fallout/LICENSE b/themes/bootloader-themes/fallout/LICENSE new file mode 100644 index 0000000..68280df --- /dev/null +++ b/themes/bootloader-themes/fallout/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Andrei Shevchuk + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/themes/bootloader-themes/fallout/README.md b/themes/bootloader-themes/fallout/README.md new file mode 100644 index 0000000..bead66b --- /dev/null +++ b/themes/bootloader-themes/fallout/README.md @@ -0,0 +1,25 @@ +## Fallout GRUB theme + +Supported languages: Chinese (simplified), English, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, Ukrainian + +![](https://i.imgur.com/7LUYwTn.gif) + +--- + +### Installation / update + +1. **Secure way:** + - Download install script: + `wget -P /tmp https://github.com/shvchk/fallout-grub-theme/raw/master/install.sh` + - Review install script at `/tmp/install.sh` + - Run it: `bash /tmp/install.sh` + +2. **Easier, less secure way** — just download and run install script: + `wget -O - https://github.com/shvchk/fallout-grub-theme/raw/master/install.sh | bash` + +--- + +### See also + +- [Poly light GRUB theme](https://github.com/shvchk/poly-light) +- [Poly dark GRUB theme](https://github.com/shvchk/poly-dark) diff --git a/themes/bootloader-themes/fallout/background.png b/themes/bootloader-themes/fallout/background.png new file mode 100644 index 0000000..dc16c99 Binary files /dev/null and b/themes/bootloader-themes/fallout/background.png differ diff --git a/themes/bootloader-themes/fallout/fixedsys-regular-32.pf2 b/themes/bootloader-themes/fallout/fixedsys-regular-32.pf2 new file mode 100644 index 0000000..1c10eec Binary files /dev/null and b/themes/bootloader-themes/fallout/fixedsys-regular-32.pf2 differ diff --git a/themes/bootloader-themes/fallout/icons/antergos.png b/themes/bootloader-themes/fallout/icons/antergos.png new file mode 100644 index 0000000..ba6e695 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/antergos.png differ diff --git a/themes/bootloader-themes/fallout/icons/arch.png b/themes/bootloader-themes/fallout/icons/arch.png new file mode 100644 index 0000000..b5cd586 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/arch.png differ diff --git a/themes/bootloader-themes/fallout/icons/chakra.png b/themes/bootloader-themes/fallout/icons/chakra.png new file mode 100644 index 0000000..57394b6 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/chakra.png differ diff --git a/themes/bootloader-themes/fallout/icons/debian.png b/themes/bootloader-themes/fallout/icons/debian.png new file mode 100644 index 0000000..2114183 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/debian.png differ diff --git a/themes/bootloader-themes/fallout/icons/deepin.png b/themes/bootloader-themes/fallout/icons/deepin.png new file mode 100644 index 0000000..6641a7d Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/deepin.png differ diff --git a/themes/bootloader-themes/fallout/icons/elementary.png b/themes/bootloader-themes/fallout/icons/elementary.png new file mode 100644 index 0000000..4b2e1f8 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/elementary.png differ diff --git a/themes/bootloader-themes/fallout/icons/fedora.png b/themes/bootloader-themes/fallout/icons/fedora.png new file mode 100644 index 0000000..4c1d8bc Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/fedora.png differ diff --git a/themes/bootloader-themes/fallout/icons/gentoo.png b/themes/bootloader-themes/fallout/icons/gentoo.png new file mode 100644 index 0000000..eec2482 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/gentoo.png differ diff --git a/themes/bootloader-themes/fallout/icons/gnu-linux.png b/themes/bootloader-themes/fallout/icons/gnu-linux.png new file mode 100644 index 0000000..b826003 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/gnu-linux.png differ diff --git a/themes/bootloader-themes/fallout/icons/kali.png b/themes/bootloader-themes/fallout/icons/kali.png new file mode 100644 index 0000000..93a60a7 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/kali.png differ diff --git a/themes/bootloader-themes/fallout/icons/kaos.png b/themes/bootloader-themes/fallout/icons/kaos.png new file mode 100644 index 0000000..bd82999 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/kaos.png differ diff --git a/themes/bootloader-themes/fallout/icons/korora.png b/themes/bootloader-themes/fallout/icons/korora.png new file mode 100644 index 0000000..0f0b1e2 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/korora.png differ diff --git a/themes/bootloader-themes/fallout/icons/kubuntu.png b/themes/bootloader-themes/fallout/icons/kubuntu.png new file mode 100644 index 0000000..672ac6a Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/kubuntu.png differ diff --git a/themes/bootloader-themes/fallout/icons/lfs.png b/themes/bootloader-themes/fallout/icons/lfs.png new file mode 100644 index 0000000..3d0b465 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/lfs.png differ diff --git a/themes/bootloader-themes/fallout/icons/linuxmint.png b/themes/bootloader-themes/fallout/icons/linuxmint.png new file mode 100644 index 0000000..8035bf5 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/linuxmint.png differ diff --git a/themes/bootloader-themes/fallout/icons/lubuntu.png b/themes/bootloader-themes/fallout/icons/lubuntu.png new file mode 100644 index 0000000..5452ebd Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/lubuntu.png differ diff --git a/themes/bootloader-themes/fallout/icons/mageia.png b/themes/bootloader-themes/fallout/icons/mageia.png new file mode 100644 index 0000000..7430726 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/mageia.png differ diff --git a/themes/bootloader-themes/fallout/icons/manjaro.png b/themes/bootloader-themes/fallout/icons/manjaro.png new file mode 100644 index 0000000..1d6b67b Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/manjaro.png differ diff --git a/themes/bootloader-themes/fallout/icons/opensuse.png b/themes/bootloader-themes/fallout/icons/opensuse.png new file mode 100644 index 0000000..2520371 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/opensuse.png differ diff --git a/themes/bootloader-themes/fallout/icons/siduction.png b/themes/bootloader-themes/fallout/icons/siduction.png new file mode 100644 index 0000000..9c6cbf2 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/siduction.png differ diff --git a/themes/bootloader-themes/fallout/icons/ubuntu.png b/themes/bootloader-themes/fallout/icons/ubuntu.png new file mode 100644 index 0000000..6c81d60 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/ubuntu.png differ diff --git a/themes/bootloader-themes/fallout/icons/windows.png b/themes/bootloader-themes/fallout/icons/windows.png new file mode 100644 index 0000000..7a4974d Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/windows.png differ diff --git a/themes/bootloader-themes/fallout/icons/xubuntu.png b/themes/bootloader-themes/fallout/icons/xubuntu.png new file mode 100644 index 0000000..a4364f7 Binary files /dev/null and b/themes/bootloader-themes/fallout/icons/xubuntu.png differ diff --git a/themes/bootloader-themes/fallout/item_c.png b/themes/bootloader-themes/fallout/item_c.png new file mode 100644 index 0000000..930463b Binary files /dev/null and b/themes/bootloader-themes/fallout/item_c.png differ diff --git a/themes/bootloader-themes/fallout/selected_item_c.png b/themes/bootloader-themes/fallout/selected_item_c.png new file mode 100644 index 0000000..0269a8a Binary files /dev/null and b/themes/bootloader-themes/fallout/selected_item_c.png differ diff --git a/themes/bootloader-themes/fallout/terminal_box_c.png b/themes/bootloader-themes/fallout/terminal_box_c.png new file mode 100644 index 0000000..252d950 Binary files /dev/null and b/themes/bootloader-themes/fallout/terminal_box_c.png differ diff --git a/themes/bootloader-themes/fallout/theme.txt b/themes/bootloader-themes/fallout/theme.txt new file mode 100644 index 0000000..543809a --- /dev/null +++ b/themes/bootloader-themes/fallout/theme.txt @@ -0,0 +1,88 @@ +# Global properties +title-text: "" +desktop-image: "background.png" +desktop-color: "#000000" +terminal-font: "Fixedsys Regular 32" +terminal-box: "terminal_box_*.png" +terminal-left: "0" +terminal-top: "0" +terminal-width: "100%" +terminal-height: "100%" +terminal-border: "0" + +# Boot menu ++ boot_menu { + left = 15% + top = 20% + width = 70% + height = 60% + item_font = "Fixedsys Regular 32" + item_color = "#67d97a" + selected_item_color = "#ffffff" + item_height = 48 + item_spacing = 8 + item_icon_space = 12 + item_pixmap_style = "item_*.png" + selected_item_pixmap_style = "selected_item_*.png" +} + +# Countdown message ++ label { + left = 0 + top = 98%-70 + width = 100% + align = "center" + id = "__timeout__" + # DE + # text = "Start in %d Sekunden." + # EN + text = "Booting in %d seconds" + # ES + # text = "Arranque en %d segundos" + # FR + # text = "Démarrage automatique dans %d secondes" + # IT + # text = "Avvio in %d secondi" + # NO + # text = "Starter om %d sekunder" + # PT + # text = "Arranque automático dentro de %d segundos" + # RU + # text = "Загрузка выбранного пункта через %d сек." + # UA + # text = "Автоматичне завантаження розпочнеться через %d сек." + # zh_CN + # text = "在 %d 内启动" + color = "#67d97a" + font = "Fixedsys Regular 32" +} + +# Navigation keys hint ++ label { + left = 0 + top = 98%-30 + width = 100% + align = "center" + # DE + # text = "System mit ↑ und ↓ auswählen und mit Enter bestätigen." + # EN + text = "Use ↑ and ↓ keys to change selection, Enter to confirm" + # ES + # text = "Use las teclas ↑ y ↓ para cambiar la selección, Enter para confirmar" + # FR + # text = "Choisissez le système avec les flèches du clavier (↑ et ↓), puis validez avec la touche Enter (↲)" + # IT + # text = "Usa i tasti ↑ e ↓ per cambiare la selezione, premi Invio ↲ per confermare" + # NO + # text = "Bruk ↑ og ↓ for å endre menyvalg, velg med Enter" + # PT + # text = "Use as teclas ↑ e ↓ para mudar a seleção, e ENTER para confirmar" + # RU + # text = "Используйте клавиши ↑ и ↓ для изменения выбора, Enter для подтверждения" + # UA + # text = "Використовуйте ↑ та ↓ для вибору, Enter для підтвердження" + # zh_CN + # text = "使用 ↑ 和 ↓ 键移动选择条,Enter 键确认" + color = "#67d97a" + font = "Fixedsys Regular 32" +} diff --git a/themes/install_agnoster-theme.sh b/themes/install_agnoster-theme.sh new file mode 100755 index 0000000..ad21972 --- /dev/null +++ b/themes/install_agnoster-theme.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Install agnoster Theme +# * +# * @category themes +# * @license MIT +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +THEME_NAME=agnoster + +# check zsh installed +if [ ! -x "$(command -v zsh)" ]; then + echo_error "\"$(basename "${0}")\" requires zsh, try: 'sudo apt-get install -y zsh'" + exit 1 +fi + +# check oh-my-zsh installed +if [ ! -d ~/.oh-my-zsh ]; then + echo_error 'oh-my-zsh not installed' + exit 1 +fi + +# check .zshrc present +if [ ! -f ~/.zshrc ]; then + echo_error '.zshrc file not found' + exit 1 +fi + +echo_info "sed -i -E s/ZSH_THEME=\".+\"/ZSH_THEME=\"${THEME_NAME}\"/g ~/.zshrc" +sed -i -E s/ZSH_THEME=\".+\"/ZSH_THEME=\"${THEME_NAME}\"/g ~/.zshrc + +echo_success "${THEME_NAME} theme set successfully" +echo_info 'You may need to restart your session' + diff --git a/themes/install_blackpearlconky.sh b/themes/install_blackpearlconky.sh new file mode 100755 index 0000000..a758178 --- /dev/null +++ b/themes/install_blackpearlconky.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * blackpearlconky theme +# * widget gnome system monitor +# * +# * @category themes +# * @license MIT +# * @link http://www.linuxandubuntu.com/home/5-best-linux-conky-themes +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +echo_info 'mkdir ~/.conky' +mkdir ~/.conky + +echo_info 'git clone --depth 1 https://github.com/bchretien/BlackPearlConky ~/.conky' +git clone --depth 1 https://github.com/bchretien/BlackPearlConky ~/.conky + +( + echo_info 'cd ~/.conky || exit 1' + cd ~/.conky || exit 1 + + echo_info 'rm -rf .git' + rm -rf .git +) diff --git a/themes/install_bootloader_theme.sh b/themes/install_bootloader_theme.sh new file mode 100755 index 0000000..45f10d7 --- /dev/null +++ b/themes/install_bootloader_theme.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bootloader Theme Installer +# * +# * @license MIT +# * @author "Matthias Morin" +# * @category themes +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +THEME_SOURCE=${CURDIR}/bootloader-themes +THEME_DIR=/usr/share/grub/themes +THEME_NAME=CyberRe + +function install_theme() { + # create themes directory if not exists + if [[ ! -d "${THEME_DIR}/${THEME_NAME}" ]]; then + # Copy theme + echo_success "Installing ${THEME_NAME} theme..." + + echo_info "sudo mkdir -p \"${THEME_DIR}/${THEME_NAME}\"" + sudo mkdir -p "${THEME_DIR}/${THEME_NAME}" + + echo_info "sudo cp -a \"${THEME_SOURCE}/${THEME_NAME}\"/* \"${THEME_DIR}/${THEME_NAME}\"" + sudo cp -a "${THEME_SOURCE}/${THEME_NAME}"/* "${THEME_DIR}/${THEME_NAME}" + fi +} + +function config_grub() { + echo_success 'Enabling grub menu' + # remove default grub style if any + echo_info "sudo sed -i '/GRUB_TIMEOUT_STYLE=/d' /etc/default/grub" + sudo sed -i '/GRUB_TIMEOUT_STYLE=/d' /etc/default/grub + + echo_info "sudo bash -c \"echo 'GRUB_TIMEOUT_STYLE=\"menu\"' >> /etc/default/grub\"" + sudo bash -c "echo 'GRUB_TIMEOUT_STYLE=\"menu\"' >> /etc/default/grub" + + #-------------------------------------------------- + + echo_success 'Setting grub timeout to 1 second' + # remove default timeout if any + echo_info "sudo sed -i '/GRUB_TIMEOUT=/d' /etc/default/grub" + sudo sed -i '/GRUB_TIMEOUT=/d' /etc/default/grub + + echo_info "sudo bash -c \"echo 'GRUB_TIMEOUT=\"1\"' >> /etc/default/grub\"" + sudo bash -c "echo 'GRUB_TIMEOUT=\"1\"' >> /etc/default/grub" + + #-------------------------------------------------- + + echo_success "Setting ${THEME_NAME} as default" + # remove theme if any + echo_info "sudo sed -i '/GRUB_THEME=/d' /etc/default/grub" + sudo sed -i '/GRUB_THEME=/d' /etc/default/grub + + echo_info "sudo bash -c \"echo \"GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"\" >> /etc/default/grub\"" + sudo bash -c "echo \"GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"\" >> /etc/default/grub" +} + +function update_grub() { + # Update grub config + echo_success 'Updating grub config...' + if [[ -x "$(command -v update-grub)" ]]; then + echo_info 'sudo update-grub' + sudo update-grub + + elif [[ -x "$(command -v grub-mkconfig)" ]]; then + echo_info 'sudo grub-mkconfig -o /boot/grub/grub.cfg' + sudo grub-mkconfig -o /boot/grub/grub.cfg + + elif [[ -x "$(command -v grub2-mkconfig)" ]]; then + if [[ -x "$(command -v zypper)" ]]; then + echo_info 'sudo grub2-mkconfig -o /boot/grub2/grub.cfg' + sudo grub2-mkconfig -o /boot/grub2/grub.cfg + + elif [[ -x "$(command -v dnf)" ]]; then + echo_info 'sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg' + sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg + fi + fi +} + +function main() { + alert_primary 'TangoMan Theme Installer' + + install_theme + + config_grub + update_grub +} + +main diff --git a/themes/install_conky-all.sh b/themes/install_conky-all.sh new file mode 100755 index 0000000..6bb52ea --- /dev/null +++ b/themes/install_conky-all.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * conky-all +# * widget gnome system monitor +# * +# * @category themes +# * @license MIT +# * @link https://askubuntu.com/questions/1014263/is-there-any-widget-that-can-show-my-cpu-and-other-performances-live +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes conky-all' +sudo apt-get install --assume-yes conky-all diff --git a/themes/install_conky.sh b/themes/install_conky.sh new file mode 100755 index 0000000..8a6cd75 --- /dev/null +++ b/themes/install_conky.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * conky +# * widget gnome system monitor +# * +# * @category themes +# * @license MIT +# * @link https://askubuntu.com/questions/1014263/is-there-any-widget-that-can-show-my-cpu-and-other-performances-live +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +CONFIG_DIR="${CURDIR}/../config" + +echo_info 'sudo apt-get install --assume-yes conky' +sudo apt-get install --assume-yes conky + +# # autostart +# cat > ~/.config/autostart/conky.desktop < +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * edex-ui +# * +# * @category themes +# * @license MIT +# * @link https://github.com/GitSquared/edex-ui/releases +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/git/get_latest_release.sh" + +REPOSITORY=GitSquared/edex-ui +VERSION=$(get_latest_release "${REPOSITORY}") +if [ -z "${VERSION}" ]; then + VERSION=2.2.8 +fi +FILENAME=eDEX-UI-Linux-x86_64.AppImage + +alert_primary "Install eDEX-UI v${VERSION}" + +if [ ! -x "$(command -v wget)" ]; then + echo_error "\"$(basename "${0}")\" requires wget, try: 'sudo apt-get install -y wget'" + exit 1 +fi + +echo_info 'mkdir ~/.edex-ui' +mkdir ~/.edex-ui + +echo_info "wget -qO ~/.edex-ui/edex-ui.AppImage \"https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}\"" +wget -qO ~/.edex-ui/edex-ui.AppImage "https://github.com/${REPOSITORY}/releases/download/v${VERSION}/${FILENAME}" + +echo_info 'chmod a+x ~/.edex-ui/edex-ui.AppImage' +chmod a+x ~/.edex-ui/edex-ui.AppImage + +# create desktop shortcut +cat > "$(xdg-user-dir DESKTOP)"/edex-ui.desktop< +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * hollywood +# * +# * hollywood hacker terminal +# * +# * @category themes +# * @license MIT +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes hollywood' +sudo apt-get install --assume-yes hollywood diff --git a/themes/install_ohmyzsh.sh b/themes/install_ohmyzsh.sh new file mode 100755 index 0000000..e7f9ef1 --- /dev/null +++ b/themes/install_ohmyzsh.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ohmyzsh +# * themes for zsh +# * +# * @category themes +# * @license MIT +# * @link https://ohmyz.sh/#install +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'" + exit 1 +fi + +# if [ -x "$(command -v curl)" ]; then +# # install ohmyzsh (via curl) +# echo_info "bash -c \"\$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)\"" +# bash -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" + +# exit 0 +# fi + +main() { + # Use colors, but only if connected to a terminal, and that terminal + # supports them. + if command -v tput >/dev/null 2>&1; then + ncolors=$(tput colors) + fi + if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then + GREEN="$(tput setaf 2)" + YELLOW="$(tput setaf 3)" + BLUE="$(tput setaf 4)" + NORMAL="$(tput sgr0)" + else + GREEN="" + YELLOW="" + BLUE="" + NORMAL="" + fi + + # Only enable exit-on-error after the non-critical colorization stuff, + # which may fail on systems lacking tput or terminfo + set -e + + if ! command -v zsh >/dev/null 2>&1; then + printf "%sZsh is not installed!%s Please install zsh first!\n" "${YELLOW}" "${NORMAL}" + exit + fi + + if [ -z "$ZSH" ]; then + ZSH=~/.oh-my-zsh + fi + + if [ -d "$ZSH" ]; then + printf "%sYou already have Oh My Zsh installed.%s\n" "${YELLOW}" "${NORMAL}" + printf "You'll need to remove \$ZSH if you want to re-install.\n" + exit + fi + + # Prevent the cloned repository from having insecure permissions. Failing to do + # so causes compinit() calls to fail with "command not found: compdef" errors + # for users with insecure umasks (e.g., "002", allowing group writability). Note + # that this will be ignored under Cygwin by default, as Windows ACLs take + # precedence over umasks except for filesystems mounted with option "noacl". + umask g-w,o-w + + printf "%sCloning Oh My Zsh...%s\n" "${BLUE}" "${NORMAL}" + command -v git >/dev/null 2>&1 || { + echo "Error: git is not installed" + exit 1 + } + # The Windows (MSYS) Git is not compatible with normal use on cygwin + if [ "$OSTYPE" = cygwin ]; then + if git --version | grep msysgit > /dev/null; then + echo "Error: Windows/MSYS Git is not supported on Cygwin" + echo "Error: Make sure the Cygwin git package is installed and is first on the path" + exit 1 + fi + fi + env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git "$ZSH" || { + printf "Error: git clone of oh-my-zsh repo failed\n" + exit 1 + } + + printf "%sLooking for an existing zsh config...%s\n" "${BLUE}" "${NORMAL}" + if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then + printf "%sFound ~/.zshrc.%s %sBacking up to ~/.zshrc.pre-oh-my-zsh%s\n" "${YELLOW}" "${NORMAL}" "${GREEN}" "${NORMAL}" + mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh + fi + + printf "%sUsing the Oh My Zsh template file and adding it to ~/.zshrc%s\n" "${BLUE}" "${NORMAL}" + cp "$ZSH"/templates/zshrc.zsh-template ~/.zshrc + sed "/^export ZSH=/ c\\ + export ZSH=\"$ZSH\" + " ~/.zshrc > ~/.zshrc-omztemp + mv -f ~/.zshrc-omztemp ~/.zshrc +} + +main diff --git a/themes/install_powerlevel10k.sh b/themes/install_powerlevel10k.sh new file mode 100755 index 0000000..0f72cdf --- /dev/null +++ b/themes/install_powerlevel10k.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Install powerlevel10k +# * +# * powerlevel10k theme for oh-my-zsh terminal +# * +# * Open Terminal → Preferences and click on the selected profile under Profiles. +# * Check Custom font under Text Appearance and select MesloLGS Nerd Font +# * +# * ``` +# * p10k configure +# * ``` +# * +# * @category themes +# * @license MIT +# * @link https://github.com/romkatv/powerlevel10k +# * @link https://www.linuxfordevices.com/tutorials/linux/make-arch-terminal-awesome +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +THEME_NAME=powerlevel10k\\/powerlevel10k +CONFIG_DIR="${CURDIR}/../config" + +#-------------------------------------------------- + +# check zsh installed +if [ ! -x "$(command -v zsh)" ]; then + echo_error "\"$(basename "${0}")\" requires zsh, try: 'sudo apt-get install -y zsh'" + exit 1 +fi + +# check oh-my-zsh installed +if [ ! -d ~/.oh-my-zsh ]; then + echo_error 'oh-my-zsh not installed' + exit 1 +fi + +# check .zshrc present +if [ ! -f ~/.zshrc ]; then + echo_error '.zshrc file not found' + exit 1 +fi + +#-------------------------------------------------- + +echo_info "git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k\"" +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" + +echo_info "sed -i -E s/ZSH_THEME=\".+\"/ZSH_THEME=\"${THEME_NAME}\"/g ~/.zshrc" +sed -i -E s/ZSH_THEME=\".+\"/ZSH_THEME=\"${THEME_NAME}\"/g ~/.zshrc + +#-------------------------------------------------- + +# config p10k +echo_info "cp -fv \"${CONFIG_DIR}/home/.p10k.zsh\" ~" +cp -fv "${CONFIG_DIR}/home/.p10k.zsh" ~ + +#-------------------------------------------------- + +# remove previous config if any +echo_info "sed -i '/# To customize prompt, run \`p10k configure\` or edit ~\/.p10k.zsh./d' ~/.zshrc" +# shellcheck disable=SC2016 +sed -i '/# To customize prompt, run `p10k configure` or edit ~\/.p10k.zsh./d' ~/.zshrc + +echo_info "sed -i '/[[ ! -f ~\/.p10k.zsh ]] || source ~\/.p10k.zsh/d' ~/.zshrc" +# shellcheck disable=SC2016 +sed -i '/[[ ! -f ~\/.p10k.zsh ]] || source ~\/.p10k.zsh/d' ~/.zshrc + +# append config to "~/.zshrc" +# shellcheck disable=SC2016 +echo '# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.' >> ~/.zshrc +# shellcheck disable=SC2016 +echo '[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh' >> ~/.zshrc + +#-------------------------------------------------- + +echo_success "${THEME_NAME} theme set successfully" +echo_info 'You may need to restart your session' diff --git a/themes/install_tangoman-theme.sh b/themes/install_tangoman-theme.sh new file mode 100755 index 0000000..9e3d42e --- /dev/null +++ b/themes/install_tangoman-theme.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Install TangoMan Theme +# * +# * @category themes +# * @license MIT +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +THEME_SOURCE=${CURDIR}/zsh-themes +THEME_DIR=~/.oh-my-zsh/themes/ +THEME_NAME=tangoman + +# check zsh installed +if [ ! -x "$(command -v zsh)" ]; then + echo_error "\"$(basename "${0}")\" requires zsh, try: 'sudo apt-get install -y zsh'" + exit 1 +fi + +# check oh-my-zsh installed +if [ ! -d ~/.oh-my-zsh ]; then + echo_error 'oh-my-zsh not installed' + exit 1 +fi + +# check .zshrc present +if [ ! -f ~/.zshrc ]; then + echo_error '.zshrc file not found' + exit 1 +fi + +# copy theme +echo_info "cp \"${THEME_SOURCE}/${THEME_NAME}.zsh-theme\" \"${THEME_DIR}/${THEME_NAME}.zsh-theme\"" +cp "${THEME_SOURCE}/${THEME_NAME}.zsh-theme" "${THEME_DIR}/${THEME_NAME}.zsh-theme" + +echo_info "sed -i -E s/ZSH_THEME=\".+\"/ZSH_THEME=\"${THEME_NAME}\"/g ~/.zshrc" +sed -i -E s/ZSH_THEME=\".+\"/ZSH_THEME=\"${THEME_NAME}\"/g ~/.zshrc + +echo_success "${THEME_NAME} theme set successfully" +echo_info 'You may need to restart your session' + diff --git a/themes/remove_ohmyzsh.sh b/themes/remove_ohmyzsh.sh new file mode 100755 index 0000000..f5b5583 --- /dev/null +++ b/themes/remove_ohmyzsh.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * remove ohmyzsh +# * +# * @category themes +# * @license MIT +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +# clean zsh folder +echo_info 'rm -rf ~/.oh-my-zsh' +rm -rf ~/.oh-my-zsh + +echo_info 'rm -f ~/.zshrc' +rm -f ~/.zshrc + +echo_info 'rm -f ~/.zshrc.bak' +rm -f ~/.zshrc.bak + +echo_info 'rm -f ~/.zsh_history' +rm -f ~/.zsh_history + +echo_success 'oh-my-zsh uninstalled' diff --git a/themes/zsh-themes/agnoster.zsh-theme b/themes/zsh-themes/agnoster.zsh-theme new file mode 100644 index 0000000..fe7ddba --- /dev/null +++ b/themes/zsh-themes/agnoster.zsh-theme @@ -0,0 +1,259 @@ +# vim:ft=zsh ts=2 sw=2 sts=2 +# +# agnoster's Theme - https://gist.github.com/3712874 +# A Powerline-inspired theme for ZSH +# +# # README +# +# In order for this theme to render correctly, you will need a +# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). +# Make sure you have a recent version: the code points that Powerline +# uses changed in 2012, and older versions will display incorrectly, +# in confusing ways. +# +# In addition, I recommend the +# [Solarized theme](https://github.com/altercation/solarized/) and, if you're +# using it on Mac OS X, [iTerm 2](https://iterm2.com/) over Terminal.app - +# it has significantly better color fidelity. +# +# If using with "light" variant of the Solarized color schema, set +# SOLARIZED_THEME variable to "light". If you don't specify, we'll assume +# you're using the "dark" variant. +# +# # Goals +# +# The aim of this theme is to only show you *relevant* information. Like most +# prompts, it will only show git information when in a git working directory. +# However, it goes a step further: everything from the current user and +# hostname to whether the last call exited with an error to whether background +# jobs are running in this shell will all be displayed automatically when +# appropriate. + +### Segment drawing +# A few utility functions to make it easy and re-usable to draw segmented prompts + +CURRENT_BG='NONE' + +case ${SOLARIZED_THEME:-dark} in + light) CURRENT_FG='white';; + *) CURRENT_FG='black';; +esac + +# Special Powerline characters + +() { + local LC_ALL="" LC_CTYPE="en_US.UTF-8" + # NOTE: This segment separator character is correct. In 2012, Powerline changed + # the code points they use for their special characters. This is the new code point. + # If this is not working for you, you probably have an old version of the + # Powerline-patched fonts installed. Download and install the new version. + # Do not submit PRs to change this unless you have reviewed the Powerline code point + # history and have new information. + # This is defined using a Unicode escape sequence so it is unambiguously readable, regardless of + # what font the user is viewing this source code in. Do not replace the + # escape sequence with a single literal character. + # Do not change this! Do not make it '\u2b80'; that is the old, wrong code point. + SEGMENT_SEPARATOR=$'\ue0b0' +} + +# Begin a segment +# Takes two arguments, background and foreground. Both can be omitted, +# rendering default background/foreground. +prompt_segment() { + local bg fg + [[ -n $1 ]] && bg="%K{$1}" || bg="%k" + [[ -n $2 ]] && fg="%F{$2}" || fg="%f" + if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then + echo -n " %{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%} " + else + echo -n "%{$bg%}%{$fg%} " + fi + CURRENT_BG=$1 + [[ -n $3 ]] && echo -n $3 +} + +# End the prompt, closing any open segments +prompt_end() { + if [[ -n $CURRENT_BG ]]; then + echo -n " %{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" + else + echo -n "%{%k%}" + fi + echo -n "%{%f%}" + CURRENT_BG='' +} + +### Prompt components +# Each component will draw itself, and hide itself if no information needs to be shown + +# Context: user@hostname (who am I and where am I) +prompt_context() { + if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then + prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m" + fi +} + +# Git: branch/detached head, dirty status +prompt_git() { + (( $+commands[git] )) || return + if [[ "$(git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]]; then + return + fi + local PL_BRANCH_CHAR + () { + local LC_ALL="" LC_CTYPE="en_US.UTF-8" + PL_BRANCH_CHAR=$'\ue0a0' #  + } + local ref dirty mode repo_path + + if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then + repo_path=$(git rev-parse --git-dir 2>/dev/null) + dirty=$(parse_git_dirty) + ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)" + if [[ -n $dirty ]]; then + prompt_segment yellow black + else + prompt_segment green $CURRENT_FG + fi + + if [[ -e "${repo_path}/BISECT_LOG" ]]; then + mode=" " + elif [[ -e "${repo_path}/MERGE_HEAD" ]]; then + mode=" >M<" + elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then + mode=" >R>" + fi + + setopt promptsubst + autoload -Uz vcs_info + + zstyle ':vcs_info:*' enable git + zstyle ':vcs_info:*' get-revision true + zstyle ':vcs_info:*' check-for-changes true + zstyle ':vcs_info:*' stagedstr '✚' + zstyle ':vcs_info:*' unstagedstr '±' + zstyle ':vcs_info:*' formats ' %u%c' + zstyle ':vcs_info:*' actionformats ' %u%c' + vcs_info + echo -n "${ref/refs\/heads\//$PL_BRANCH_CHAR }${vcs_info_msg_0_%% }${mode}" + fi +} + +prompt_bzr() { + (( $+commands[bzr] )) || return + + # Test if bzr repository in directory hierarchy + local dir="$PWD" + while [[ ! -d "$dir/.bzr" ]]; do + [[ "$dir" = "/" ]] && return + dir="${dir:h}" + done + + local bzr_status status_mod status_all revision + if bzr_status=$(bzr status 2>&1); then + status_mod=$(echo -n "$bzr_status" | head -n1 | grep "modified" | wc -m) + status_all=$(echo -n "$bzr_status" | head -n1 | wc -m) + revision=$(bzr log -r-1 --log-format line | cut -d: -f1) + if [[ $status_mod -gt 0 ]] ; then + prompt_segment yellow black "bzr@$revision ✚" + else + if [[ $status_all -gt 0 ]] ; then + prompt_segment yellow black "bzr@$revision" + else + prompt_segment green black "bzr@$revision" + fi + fi + fi +} + +prompt_hg() { + (( $+commands[hg] )) || return + local rev st branch + if $(hg id >/dev/null 2>&1); then + if $(hg prompt >/dev/null 2>&1); then + if [[ $(hg prompt "{status|unknown}") = "?" ]]; then + # if files are not added + prompt_segment red white + st='±' + elif [[ -n $(hg prompt "{status|modified}") ]]; then + # if any modification + prompt_segment yellow black + st='±' + else + # if working copy is clean + prompt_segment green $CURRENT_FG + fi + echo -n $(hg prompt "☿ {rev}@{branch}") $st + else + st="" + rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g') + branch=$(hg id -b 2>/dev/null) + if `hg st | grep -q "^\?"`; then + prompt_segment red black + st='±' + elif `hg st | grep -q "^[MA]"`; then + prompt_segment yellow black + st='±' + else + prompt_segment green $CURRENT_FG + fi + echo -n "☿ $rev@$branch" $st + fi + fi +} + +# Dir: current working directory +prompt_dir() { + prompt_segment blue $CURRENT_FG '%~' +} + +# Virtualenv: current working virtualenv +prompt_virtualenv() { + local virtualenv_path="$VIRTUAL_ENV" + if [[ -n $virtualenv_path && -n $VIRTUAL_ENV_DISABLE_PROMPT ]]; then + prompt_segment blue black "(`basename $virtualenv_path`)" + fi +} + +# Status: +# - was there an error +# - am I root +# - are there background jobs? +prompt_status() { + local -a symbols + + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" + [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" + [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" + + [[ -n "$symbols" ]] && prompt_segment black default "$symbols" +} + +#AWS Profile: +# - display current AWS_PROFILE name +# - displays yellow on red if profile name contains 'production' or +# ends in '-prod' +# - displays black on green otherwise +prompt_aws() { + [[ -z "$AWS_PROFILE" || "$SHOW_AWS_PROMPT" = false ]] && return + case "$AWS_PROFILE" in + *-prod|*production*) prompt_segment red yellow "AWS: $AWS_PROFILE" ;; + *) prompt_segment green black "AWS: $AWS_PROFILE" ;; + esac +} + +## Main prompt +build_prompt() { + RETVAL=$? + prompt_status + prompt_virtualenv + prompt_aws + prompt_context + prompt_dir + prompt_git + prompt_bzr + prompt_hg + prompt_end +} + +PROMPT='%{%f%b%k%}$(build_prompt) ' diff --git a/themes/zsh-themes/tangoman.zsh-theme b/themes/zsh-themes/tangoman.zsh-theme new file mode 100644 index 0000000..873e56e --- /dev/null +++ b/themes/zsh-themes/tangoman.zsh-theme @@ -0,0 +1,383 @@ +# vim:ft=zsh ts=2 sw=2 sts=2 +# +# agnoster's Theme - https://gist.github.com/3712874 +# A Powerline-inspired theme for ZSH +# +# # README +# +# In order for this theme to render correctly, you will need a +# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). +# Make sure you have a recent version: the code points that Powerline +# uses changed in 2012, and older versions will display incorrectly, +# in confusing ways. +# +# In addition, I recommend the +# [Solarized theme](https://github.com/altercation/solarized/) and, if you're +# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app - +# it has significantly better color fidelity. +# +# # Goals +# +# The aim of this theme is to only show you *relevant* information. Like most +# prompts, it will only show git information when in a git working directory. +# However, it goes a step further: everything from the current user and +# hostname to whether the last call exited with an error to whether background +# jobs are running in this shell will all be displayed automatically when +# appropriate. + +### Segment drawing +# A few utility functions to make it easy and re-usable to draw segmented prompts + +CURRENT_BG='NONE' + +# Special Powerline characters + +() { + local LC_ALL="" LC_CTYPE="en_US.UTF-8" + # NOTE: This segment separator character is correct. In 2012, Powerline changed + # the code points they use for their special characters. This is the new code point. + # If this is not working for you, you probably have an old version of the + # Powerline-patched fonts installed. Download and install the new version. + # Do not submit PRs to change this unless you have reviewed the Powerline code point + # history and have new information. + # This is defined using a Unicode escape sequence so it is unambiguously readable, regardless of + # what font the user is viewing this source code in. Do not replace the + # escape sequence with a single literal character. + # SEGMENT_SEPARATOR=$'\ue0b0' #  + SEGMENT_SEPARATOR='' +} + +# Begin a segment +# Takes two arguments, background and foreground. Both can be omitted, +# rendering default background/foreground. +prompt_segment() { + local bg fg + [[ -n $1 ]] && bg="%K{$1}" || bg="%k" + [[ -n $2 ]] && fg="%F{$2}" || fg="%f" + if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then + echo -n " %{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%} " + else + echo -n "%{$bg%}%{$fg%} " + fi + CURRENT_BG=$1 + [[ -n $3 ]] && echo -n $3 +} + +# End the prompt, closing any open segments +prompt_end() { + if [[ -n $CURRENT_BG ]]; then + echo -n " %{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" + else + echo -n "%{%k%}" + fi + echo -n "%{%f%}" + CURRENT_BG='' +} + +### Prompt components +# Each component will draw itself, and hide itself if no information needs to be shown + +# Context: user@hostname (who am I and where am I) +prompt_context() { + if [[ -n "$SSH_CLIENT" ]]; then + prompt_segment magenta white "%{$fg_bold[white]%(!.%{%F{white}%}.)%}$USER@%m%{$fg_no_bold[white]%}" + elif [[ "$LOGNAME" = 'root' || "$LOGNAME" = 'vagrant' || "$HOST" = 'ubuntu-xenial' ]]; then + prompt_segment red white "%{$fg_bold[white]%(!.%{%F{white}%}.)%}$USER@%m%{$fg_no_bold[white]%}" + else + prompt_segment yellow black "%{$fg_bold[black]%(!.%{%F{black}%}.)%}$USER@$HOST%{$fg_no_bold[black]%}" + fi +} + +# Battery Level +prompt_battery() { + HEART='♥ ' + + if [[ $(uname) == "Darwin" ]] ; then + + function battery_is_charging() { + [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ] + } + + function battery_pct() { + local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" + typeset -F maxcapacity=$(echo $smart_battery_status | grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //') + typeset -F currentcapacity=$(echo $smart_battery_status | grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //') + integer i=$(((currentcapacity/maxcapacity) * 100)) + echo $i + } + + function battery_pct_remaining() { + if battery_is_charging ; then + battery_pct + else + echo "External Power" + fi + } + + function battery_time_remaining() { + local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" + if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then + timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //') + if [ $timeremaining -gt 720 ] ; then + echo "::" + else + echo "~$((timeremaining / 60)):$((timeremaining % 60))" + fi + fi + } + + b=$(battery_pct_remaining) + if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then + if [ $b -gt 50 ] ; then + prompt_segment green white + elif [ $b -gt 20 ] ; then + prompt_segment yellow white + else + prompt_segment red white + fi + echo -n "%{$fg_bold[white]%}$HEART$(battery_pct_remaining)%%%{$fg_no_bold[white]%}" + fi + fi + + if [[ $(uname) == "Linux" && -d /sys/module/battery ]] ; then + + function battery_is_charging() { + ! [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] + } + + function battery_pct() { + if (( $+commands[acpi] )) ; then + echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" + fi + } + + function battery_pct_remaining() { + if [ ! $(battery_is_charging) ] ; then + battery_pct + else + echo "External Power" + fi + } + + function battery_time_remaining() { + if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then + echo $(acpi | cut -f3 -d ',') + fi + } + + b=$(battery_pct_remaining) + if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then + if [ $b -gt 40 ] ; then + prompt_segment green white + elif [ $b -gt 20 ] ; then + prompt_segment yellow white + else + prompt_segment red white + fi + echo -n "%{$fg_bold[white]%}$HEART$(battery_pct_remaining)%%%{$fg_no_bold[white]%}" + fi + + fi +} + +# Git: branch/detached head, dirty status +prompt_git() { +#«»±˖˗‑‐‒ ━ ✚‐↔←↑↓→↭⇎⇔⋆━◂▸◄►◆☀★☗☊✔✖❮❯⚑⚙ + local PL_BRANCH_CHAR + () { + local LC_ALL="" LC_CTYPE="en_US.UTF-8" + PL_BRANCH_CHAR=$'\ue0a0' #  + } + local ref dirty mode repo_path clean has_upstream + local modified untracked added deleted tagged stashed + local ready_commit git_status bgclr fgclr + local commits_diff commits_ahead commits_behind has_diverged to_push to_pull + + repo_path=$(git rev-parse --git-dir 2>/dev/null) + + if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then + dirty=$(parse_git_dirty) + git_status=$(git status --porcelain 2> /dev/null) + ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)" + if [[ -n $dirty ]]; then + clean='' + bgclr='yellow' + fgclr='magenta' + else + clean=' ✔' + bgclr='green' + fgclr='white' + fi + + local upstream=$(git rev-parse --symbolic-full-name --abbrev-ref @{upstream} 2> /dev/null) + if [[ -n "${upstream}" && "${upstream}" != "@{upstream}" ]]; then has_upstream=true; fi + + local current_commit_hash=$(git rev-parse HEAD 2> /dev/null) + + local number_of_untracked_files=$(\grep -c "^??" <<< "${git_status}") + # if [[ $number_of_untracked_files -gt 0 ]]; then untracked=" $number_of_untracked_files◆"; fi + if [[ $number_of_untracked_files -gt 0 ]]; then untracked=" $number_of_untracked_files☀"; fi + + local number_added=$(\grep -c "^A" <<< "${git_status}") + if [[ $number_added -gt 0 ]]; then added=" $number_added✚"; fi + + local number_modified=$(\grep -c "^.M" <<< "${git_status}") + if [[ $number_modified -gt 0 ]]; then + modified=" $number_modified●" + bgclr='red' + fgclr='white' + fi + + local number_added_modified=$(\grep -c "^M" <<< "${git_status}") + local number_added_renamed=$(\grep -c "^R" <<< "${git_status}") + if [[ $number_modified -gt 0 && $number_added_modified -gt 0 ]]; then + modified="$modified$((number_added_modified+number_added_renamed))±" + elif [[ $number_added_modified -gt 0 ]]; then + modified=" ●$((number_added_modified+number_added_renamed))±" + fi + + local number_deleted=$(\grep -c "^.D" <<< "${git_status}") + if [[ $number_deleted -gt 0 ]]; then + deleted=" $number_deleted‒" + bgclr='red' + fgclr='white' + fi + + local number_added_deleted=$(\grep -c "^D" <<< "${git_status}") + if [[ $number_deleted -gt 0 && $number_added_deleted -gt 0 ]]; then + deleted="$deleted$number_added_deleted±" + elif [[ $number_added_deleted -gt 0 ]]; then + deleted=" ‒$number_added_deleted±" + fi + + local tag_at_current_commit=$(git describe --exact-match --tags $current_commit_hash 2> /dev/null) + if [[ -n $tag_at_current_commit ]]; then tagged=" ☗$tag_at_current_commit "; fi + + local number_of_stashes="$(git stash list -n1 2> /dev/null | wc -l)" + if [[ $number_of_stashes -gt 0 ]]; then + stashed=" ${number_of_stashes##*( )}⚙" + bgclr='magenta' + fgclr='white' + fi + + if [[ $number_added -gt 0 || $number_added_modified -gt 0 || $number_added_deleted -gt 0 ]]; then ready_commit=' ⚑'; fi + + local upstream_prompt='' + if [[ $has_upstream == true ]]; then + commits_diff="$(git log --pretty=oneline --topo-order --left-right ${current_commit_hash}...${upstream} 2> /dev/null)" + commits_ahead=$(\grep -c "^<" <<< "$commits_diff") + commits_behind=$(\grep -c "^>" <<< "$commits_diff") + upstream_prompt="$(git rev-parse --symbolic-full-name --abbrev-ref @{upstream} 2> /dev/null)" + upstream_prompt=$(sed -e 's/\/.*$/ ☊ /g' <<< "$upstream_prompt") + fi + + has_diverged=false + if [[ $commits_ahead -gt 0 && $commits_behind -gt 0 ]]; then has_diverged=true; fi + if [[ $has_diverged == false && $commits_ahead -gt 0 ]]; then + if [[ $bgclr == 'red' || $bgclr == 'magenta' ]] then + to_push=" $fg_bold[white]↑$commits_ahead$fg_bold[$fgclr]" + else + to_push=" $fg_bold[black]↑$commits_ahead$fg_bold[$fgclr]" + fi + fi + if [[ $has_diverged == false && $commits_behind -gt 0 ]]; then to_pull=" $fg_bold[magenta]↓$commits_behind$fg_bold[$fgclr]"; fi + + if [[ -e "${repo_path}/BISECT_LOG" ]]; then + mode=" " + elif [[ -e "${repo_path}/MERGE_HEAD" ]]; then + mode=" >M<" + elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then + mode=" >R>" + fi + + prompt_segment $bgclr $fgclr + + echo -n "%{$fg_bold[$fgclr]%}${ref/refs\/heads\//$PL_BRANCH_CHAR $upstream_prompt}${mode}$to_push$to_pull$clean$tagged$stashed$untracked$modified$deleted$added$ready_commit%{$fg_no_bold[$fgclr]%}" + fi +} + +prompt_hg() { + local rev status + if $(hg id >/dev/null 2>&1); then + if $(hg prompt >/dev/null 2>&1); then + if [[ $(hg prompt "{status|unknown}") = "?" ]]; then + # if files are not added + prompt_segment red white + st='±' + elif [[ -n $(hg prompt "{status|modified}") ]]; then + # if any modification + prompt_segment yellow black + st='±' + else + # if working copy is clean + prompt_segment green black + fi + echo -n $(hg prompt "☿ {rev}@{branch}") $st + else + st="" + rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g') + branch=$(hg id -b 2>/dev/null) + if `hg st | grep -q "^\?"`; then + prompt_segment red black + st='±' + elif `hg st | grep -q "^[MA]"`; then + prompt_segment yellow black + st='±' + else + prompt_segment green black + fi + echo -n "☿ $rev@$branch" $st + fi + fi +} + +# Dir: current working directory +prompt_dir() { + prompt_segment cyan white "%{$fg_bold[white]%}%~%{$fg_no_bold[white]%}" +} + +# Virtualenv: current working virtualenv +prompt_virtualenv() { + local virtualenv_path="$VIRTUAL_ENV" + if [[ -n $virtualenv_path && -n $VIRTUAL_ENV_DISABLE_PROMPT ]]; then + prompt_segment blue black "(`basename $virtualenv_path`)" + fi +} + +prompt_time() { + prompt_segment blue white "%{$fg_bold[white]%}%D{%a %e %b - %H:%M}%{$fg_no_bold[white]%}" +} + +# Status: +# - was there an error +# - am I root +# - are there background jobs? +prompt_status() { + local symbols + symbols=() + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" + [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" + [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" + + [[ -n "$symbols" ]] && prompt_segment black default "$symbols" +} + +## Main prompt +build_prompt() { + RETVAL=$? + echo -n "\n" + prompt_status + prompt_battery + prompt_time + prompt_virtualenv + prompt_dir + prompt_git + prompt_hg + prompt_end + CURRENT_BG='NONE' + echo -n "\n" + prompt_context + prompt_end +} + +PROMPT='%{%f%b%k%}$(build_prompt) ' diff --git a/tools/CHANGELOG.md b/tools/CHANGELOG.md new file mode 100644 index 0000000..1bca8df --- /dev/null +++ b/tools/CHANGELOG.md @@ -0,0 +1,12 @@ +Change Log +========== + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased] +- WIP + +## [0.1.0](https://github.com/TangoMan75/tools/releases/tag/0.1.0) diff --git a/tools/CODE_OF_CONDUCT.md b/tools/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..b480fb3 --- /dev/null +++ b/tools/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at mat@tangoman.io. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/tools/CONTRIBUTING.md b/tools/CONTRIBUTING.md new file mode 100644 index 0000000..707387a --- /dev/null +++ b/tools/CONTRIBUTING.md @@ -0,0 +1,242 @@ +# Contributing + +## How do I... + +* [Use This Guide](#introduction)? +* Ask or Say Something? 🤔🐛😱 + * [Request Support](#request-support) + * [Report an Error or Bug](#report-an-error-or-bug) + * [Request a Feature](#request-a-feature) +* Make Something? 🤓👩🏽‍💻📜🍳 + * [Project Setup](#project-setup) + * [Contribute Documentation](#contribute-documentation) + * [Contribute Code](#contribute-code) +* Manage Something ✅🙆🏼💃👔 + * [Provide Support on Issues](#provide-support-on-issues) + * [Label Issues](#label-issues) + * [Clean Up Issues and PRs](#clean-up-issues-and-prs) + * [Review Pull Requests](#review-pull-requests) + * [Merge Pull Requests](#merge-pull-requests) + * [Tag a Release](#tag-a-release) + * [Join the Project Team](#join-the-project-team) +* Add a Guide Like This One [To My Project](#attribution)? 🤖😻👻 + +## Introduction + +Thank you so much for your interest in contributing!. All types of contributions are encouraged and valued. See the [table of contents](#toc) for different ways to help and details about how this project handles them!📝 + +Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 + +## Request Support + +If you have a question about this project, how to use it, or just need clarification about something: + +* Open an Issue at https://github.com/TangoMan75/tools/issues +* Provide as much context as you can about what you're running into. +* Provide project and platform versions (bash, basher, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* Someone will try to have a response soon. +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). + If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. + +## Report an Error or Bug + +If you run into an error or bug with the project: + +* Open an Issue at https://github.com/TangoMan75/tools/issues +* Include *reproduction steps* that someone else can follow to recreate the bug or error on their own. +* Provide project and platform versions (OS, bash, basher, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* A team member will try to reproduce the issue with your provided steps. If there are no repro steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +* If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#contribute-code). +* If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made. +* `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline. + +## Request a Feature + +If the project doesn't do something you need or want it to do: + +* Open an Issue at https://github.com/TangoMan75/tools/issues +* Provide as much context as you can about what you're running into. +* Please be clear about why existing features and alternatives would not work for you. + +Once it's filed: + +* The project team will [label the issue](#label-issues). +* The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward. +* If the feature request is accepted, it will be marked for implementation with `feature-accepted`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](#contribute-code). + +Note: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no. + +## Project Setup + +So you want to contribute some code! That's great! This project uses GitHub Pull Requests to manage contributions, so [read up on how to fork a GitHub project and file a PR](https://guides.github.com/activities/forking) if you've never done it before. + +If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#contribute-code). + +If you want to go the usual route and run the project locally, though: + +* [Fork the project](https://guides.github.com/activities/forking/#fork) + +Then in your terminal: +* `cd path/to/your/clone` + +And you should be ready to go! + +## Contribute Documentation + +Documentation is a super important, critical part of this project. Docs are how we keep track of what we're doing, how, and why. It's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance. + +Documentation contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake! + +To contribute documentation: + +* [Set up the project](#project-setup). +* Edit or add any relevant documentation. +* Make sure your changes are formatted correctly and consistently with the rest of the documentation. +* Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). Documentation commits should use `docs(): `. +* Go to https://github.com/TangoMan75/tools/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Contribute Code + +We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. + +Code contributions of just about any size are acceptable! + +The main difference between code contributions and documentation contributions is that contributing code requires inclusion of relevant tests for the code being added or changed. Contributions without accompanying tests will be held off until a test is added, unless the maintainers consider the specific tests to be either impossible, or way too much of a burden for such a contribution. + +To contribute code: + +* [Set up the project](#project-setup). +* Make any necessary changes to the source code. +* Include any [additional documentation](#contribute-documentation) the changes might need. +* Write tests that verify that your contribution works as expected. +* Write clear, concise commit message(s) using [conventional-changelog format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md). +* Dependency updates, additions, or removals must be in individual commits, and the message must use the format: `(deps): PKG@VERSION`, where `` is any of the usual `conventional-changelog` prefixes, at your discretion. +* Go to https://github.com/TangoMan75/tools/pulls and open a new pull request with your changes. +* If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing. + +Once you've filed the PR: + +* Barring special circumstances, maintainers will not review PRs until all checks pass (Travis, AppVeyor, etc). +* One or more maintainers will use GitHub's review feature to review your PR. +* If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review. +* If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚 +* If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](#tag-a-release) + +## Provide Support on Issues + +Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on an open source projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug. + +Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `bug` or `feature`. If you can't do this yourself, @mention a maintainer so they can do it. + +In order to help other folks out with their questions: + +* Go to the issue tracker and [filter open issues by the `support` label](https://github.com/TangoMan75/tools/issues?q=is%3Aopen+is%3Aissue+label%3Asupport). +* Read through the list until you find something that you're familiar enough with to give an answer to. +* Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on. +* Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you. + +Some notes on picking up support issues: + +* Avoid responding to issues you don't know you can answer accurately. +* As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format. +* Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](CODE_OF_CONDUCT.md) to resolve the conflict). + +## Label Issues + +One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily. + +In order to label issues, [open up the list of unlabeled issues](https://github.com/TangoMan75/tools/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself! + +Label | Apply When | Notes +--- | --- | --- +`bug` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `enhancement` label. +`critical` | Added to `bug` issues if the problem described makes the code completely unusable in a common situation. | +`documentation` | Added to issues or pull requests that affect any of the documentation for the project. | Can be combined with other labels, such as `bug` or `enhancement`. +`duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`) +`enhancement` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. | +`help wanted` | Applied by [Committers](#join-the-project-team) to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling. +`in-progress` | Applied by [Committers](#join-the-project-team) to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete. +`performance` | This issue or PR is directly related to improving performance. | +`refactor` | Added to issues or PRs that deal with cleaning up or modifying the project for the betterment of it. | +`starter` | Applied by [Committers](#join-the-project-team) to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority. +`support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `bug` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes. +`tests` | This issue or PR either requests or adds primarily tests to the project. | If a PR is pending tests, that will be handled through the [PR review process](#review-pull-requests) +`wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not. + +## Clean Up Issues and PRs + +Issues and PRs can go stale after a while. Maybe they're abandoned. Maybe the team will just plain not have time to address them any time soon. + +In these cases, they should be closed until they're brought up again or the interaction starts over. + +To clean up issues and PRs: + +* Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today. +* Go through each issue *from oldest to newest*, and close them if **all of the following are true**: + * not opened by a maintainer + * not marked as `critical` + * not marked as `starter` or `help wanted` (these might stick around for a while, in general, as they're intended to be available) + * no explicit messages in the comments asking for it to be left open + * does not belong to a milestone +* Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/TangoMan75/tools/blob/latest/CONTRIBUTING.md#clean-up-issues-and-prs for more details." + +## Review Pull Requests + +While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Issue Tracker or higher permissions. + +PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration. + +Some notes: + +* You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments". +* *ALL PULL REQUESTS* should be covered by a test: either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests to verify any new/changed behavior. All tests must also pass and follow established conventions. Test coverage should not drop, unless the specific case is considered reasonable by maintainers. +* Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. +* Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either. Just don't be a jerk about it? + +## Merge Pull Requests + +Project Team will merge pull requests after review. + +## Tag A Release + +Project Team will bump tags/version with [setver](https://github.com/pforret/setver) as a patch or minor versionupdate. +Releases are done manually for important changes. + + +## Join the Project Team + +### Ways to Join + +There are many ways to contribute! Most of them don't require any official status unless otherwise noted. That said, there's a couple of positions that grant special repository abilities, and this section describes how they're granted and what they do. + +All of the below positions are granted based on the project team's needs, as well as their consensus opinion about whether they would like to work with the person and think that they would fit well into that position. The process is relatively informal, and it's likely that people who express interest in participating can just be granted the permissions they'd like. + +You can spot a collaborator on the repo by looking for the `[Collaborator]` or `[Owner]` tags next to their names. + +Permission | Description +--- | --- +Issue Tracker | Granted to contributors who express a strong interest in spending time on the project's issue tracker. These tasks are mainly [labeling issues](#label-issues), [cleaning up old ones](#clean-up-issues-and-prs), and [reviewing pull requests](#review-pull-requests), as well as all the usual things non-team-member contributors can do. Issue handlers should not merge pull requests, tag releases, or directly commit code themselves: that should still be done through the usual pull request process. Becoming an Issue Handler means the project team trusts you to understand enough of the team's process and context to implement it on the issue tracker. +Committer | Granted to contributors who want to handle the actual pull request merges, tagging new versions, etc. Committers should have a good level of familiarity with the codebase, and enough context to understand the implications of various changes, as well as a good sense of the will and expectations of the project team. +Admin/Owner | Granted to people ultimately responsible for the project, its community, etc. + +## Attribution + +This guide was generated using the WeAllJS `CONTRIBUTING.md` generator. [Make your own](https://npm.im/weallcontribute)! + diff --git a/tools/LICENSE b/tools/LICENSE new file mode 100644 index 0000000..d691851 --- /dev/null +++ b/tools/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Matthias Morin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000..6da4a45 --- /dev/null +++ b/tools/README.md @@ -0,0 +1,231 @@ +![GH language](https://img.shields.io/github/languages/top/TangoMan75/tools) +[![GH license](https://img.shields.io/github/license/TangoMan75/tools)]((https://github.com/TangoMan75/tools/blob/master/LICENSE)) +[![GH release](https://img.shields.io/github/v/release/TangoMan75/tools)](https://github.com/TangoMan75/tools/releases) +[![GH stars](https://img.shields.io/github/stars/TangoMan75/tools)](https://github.com/TangoMan75/tools/stargazers) +[![Bash CI](https://github.com/TangoMan75/tools/workflows/bash_unit%20CI/badge.svg)](https://github.com/TangoMan75/tools/actions/workflows/bash_unit.yml) +[![ShellCheck CI](https://github.com/TangoMan75/tools/workflows/ShellCheck%20CI/badge.svg)](https://github.com/TangoMan75/tools/actions/workflows/shellcheck.yml) +![visitors](https://visitor-badge.glitch.me/badge?page_id=TangoMan75.tools) + +TangoMan Bash Tool +================== + +![tools](./doc/images/tools.png) + +**TangoMan Bash Tools** is an awesome collection of small useful shell scripts. + +⏳ TL;DR +-------- + +1. Copy "tools" folder into your project. +2. Source desired script in your own script. + +```bash +source ./tools/src/colors/colors.sh +``` + +3. Call desired function. +```bash +echo_info "Hello World !" +``` + +🎯 Features +----------- + +**TangoMan Bash Tool** provides the following features: + +### ⚡ colors.sh + +A semantic set of colors for shell scripts. + +![print_colors](./doc/images/print_colors.png) + +Try this in your script : + +```bash +#!/bin/bash + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh + +echo_primary 'This is primary text (97m)' +echo_secondary 'This is secondary text (94m)' +echo_success 'This is a success (32m)' +echo_danger 'This is a danger (31m)' +echo_warning 'This is a warning (33m)' +echo_info 'This is an info (95m)' +echo_light 'This is light (47;90m)' +echo_dark 'This is dark (40;37m)' +echo +echo_label "${PADDING}" 'label (32m):'; echo_primary 'This is a label' +echo_error 'This is an error (31m)' +``` + +![echo_colors](./doc/images/echo_colors.png) + +```bash +#!/bin/bash + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh + +alert_primary 'This is a primary alert (1;104;97m)' +alert_secondary 'This is a secondary alert (1;45;97m)' +alert_success 'This is a success alert (1;42;97m)' +alert_danger 'This is a danger alert (1;41;97m)' +alert_warning 'This is a warning alert (1;43;97m)' +alert_info 'This is a info alert (1;44;97m)' +alert_light 'This is a light alert (1;47;90m)' +alert_dark 'This is a dark alert (1;40;37m)' +``` + +![alert_colors](./doc/images/alert_colors.png) + +If you want to use Symfony theme for alerts use this file instead: `/tools/src/colors/colors_sf.sh` + +![alert_colors_sf](./doc/images/alert_colors_sf.png) + +📝 NOTE: +- Version a is the same than default version without comments. +- Version b is the same than default version with line feed at the end of each string. +- Version c does not use variables (less clutter). +- Version d is the same than version c with line feed at the end of each string. + +### ⚡ get_latest_release.sh + +Get repository latest release from github. + +### ⚡ get_latest_tag.sh + +Get repository latest tag from github. + +### ⚡ download.sh + +Download file with either curl or wget. + +### ⚡ check_install.sh + +This script is meant to quickly check for common apps installation. + +![check_install](./doc/images/check_install.png) + +### ⚡ check_root.sh + +Throws error when user doesn't own root privileges. + +### ⚡ check_versions.sh + +Check version of some development tools. + +### ⚡ compare_versions.sh + +Compare two semantic versions. + +### ⚡ hosts.sh + +Edit your local `/etc/hosts` config from shell scripts. + +### ⚡ is_installed.sh + +Returns true when given application or command is available. + +### ⚡ is_ubuntu.sh + +Returns true when current operating system runs one of ubuntu version. + +### ⚡ prompt_user.sh + +Opens a user prompt for given value. + +### ⚡ update_grub.sh + +Updates GRUB on multiple patforms. + +### ⚡ get_parameter.sh + +Read parameter from .yaml file. + +### ⚡ set_parameter.sh + +Set parameter to .yaml file. + +🚀 Installation +--------------- + +Just copy this folder into your project or import this repository into your git project as a submodule. + +```bash +# with https +git submodule add https://github.com/TangoMan75/tools.git ./tools +# with ssh +git submodule add git@github.com:TangoMan75/tools.git ./tools +``` + +🔥 Usage +-------- + +Place following snippet in your code. + +```bash +#!/bin/bash + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/git/get_latest_release.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/git/get_latest_tag.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/network/download.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/check_install.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/check_root.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/check_versions.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/compare_versions.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/hosts.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/is_installed.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/is_root.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/is_ubuntu.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/prompt_user.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/system/update_grub.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/yaml/get_parameter.sh +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/yaml/set_parameter.sh +``` + +🤝 Contributing +--------------- + +Thank you for your interest in contributing to **TangoMan Bash Tools**. + +Please review the [code of conduct](./CODE_OF_CONDUCT.md) and [contribution guidelines](./CONTRIBUTING.md) before starting to work on any features. + +If you want to open an issue, please check first if it was not [reported already](https://github.com/TangoMan75/tools/issues) before creating a new one. + +📜 License +---------- + +Copyrights (c) 2021 "Matthias Morin" <mat@tangoman.io> + +[![License](https://img.shields.io/badge/Licence-MIT-green.svg)](LICENSE) +Distributed under the MIT license. + +If you like **TangoMan Bash Tools** please star, follow or tweet: + +[![GitHub stars](https://img.shields.io/github/stars/TangoMan75/tools?style=social)](https://github.com/TangoMan75/tools/stargazers) +[![GitHub followers](https://img.shields.io/github/followers/TangoMan75?style=social)](https://github.com/TangoMan75) +[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2FTangoMan75%2Ftools)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FTangoMan75%2Ftools) + +... And check my other cool projects. diff --git a/tools/doc/images/alert_colors.png b/tools/doc/images/alert_colors.png new file mode 100644 index 0000000..e541257 Binary files /dev/null and b/tools/doc/images/alert_colors.png differ diff --git a/tools/doc/images/alert_colors_sf.png b/tools/doc/images/alert_colors_sf.png new file mode 100644 index 0000000..7f7fec7 Binary files /dev/null and b/tools/doc/images/alert_colors_sf.png differ diff --git a/tools/doc/images/check_install.png b/tools/doc/images/check_install.png new file mode 100644 index 0000000..3d06147 Binary files /dev/null and b/tools/doc/images/check_install.png differ diff --git a/tools/doc/images/echo_colors.png b/tools/doc/images/echo_colors.png new file mode 100644 index 0000000..48396ff Binary files /dev/null and b/tools/doc/images/echo_colors.png differ diff --git a/tools/doc/images/print_colors.png b/tools/doc/images/print_colors.png new file mode 100644 index 0000000..d5c2705 Binary files /dev/null and b/tools/doc/images/print_colors.png differ diff --git a/tools/doc/images/tools.png b/tools/doc/images/tools.png new file mode 100644 index 0000000..6e04370 Binary files /dev/null and b/tools/doc/images/tools.png differ diff --git a/tools/entrypoint.sh b/tools/entrypoint.sh new file mode 100755 index 0000000..fac35fa --- /dev/null +++ b/tools/entrypoint.sh @@ -0,0 +1,310 @@ +#!/bin/sh +set -e + +#/* +# * This file is part of TangoMan Entrypoint package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan CI Manager +# * +# * Run Continuous Integration +# * +# * @license MIT +# * @author "Matthias Morin" +# * @version 2.4.1-light +# * @link https://github.com/TangoMan75/entrypoint +# */ + +## Return staged bash files +get_staged_bash_files() { + if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'\n" + exit 1 + fi + + if git rev-parse --verify HEAD >/dev/null 2>&1; then + against=HEAD + else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) + fi + + # --diff-filter + # A Added + # C Copied + # M Modified + # R Renamed + git diff-index --cached --name-only --diff-filter=ACMR "${against}" | grep \ + -e '\.bashrc' \ + -e '\.zshrc' \ + -e '\.bash_profile' \ + -e '\.sh$' || true +} + +## Return staged php files +get_staged_php_files() { + if [ ! -x "$(command -v git)" ]; then + echo_error "\"$(basename "${0}")\" requires git, try: 'sudo apt-get install -y git'\n" + exit 1 + fi + + if git rev-parse --verify HEAD >/dev/null 2>&1; then + against=HEAD + else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) + fi + + # --diff-filter + # A Added + # C Copied + # M Modified + # R Renamed + git diff-index --cached --name-only --diff-filter=ACMR "${against}" | grep -e '\.php$' +} + +## Install git hooks +hooks() { + echo_info 'rm -fr .git/hooks\n' + rm -fr .git/hooks + + echo_info 'cp -r .githooks .git/hooks\n' + cp -r .githooks .git/hooks + + echo_info 'chmod +x .git/hooks/*\n' + chmod +x .git/hooks/* +} + +## Install bash_unit framework +install() { + if [ ! -d ./tests ]; then + mkdir -p ./tests + + cat > "./tests/test_sample.sh" <3) printf "%s ", substr($0, 5)}' "$0" +} + +_get_docbloc() { + awk -v TAG="$1" '/^#\/\*\*$/,/^# \*\/$/{if($3=="@"TAG){for(i=4;i<=NF;++i){printf "%s ",$i}}}' "$0" +} + +_get_padding() { + awk -F '=' '/^[a-zA-Z0-9_]+=.+$/ { MATCH = $1 } + /^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); + MATCH = substr($0, 1, index($0, "{")); + sub("{$", "", MATCH); + } { if (substr(PREV, 1, 3) == "## " && substr(MATCH, 1, 1) != "_" && length(MATCH) > LENGTH) LENGTH = length(MATCH) } + { PREV = $0 } END { print LENGTH+1 }' "$0" +} + +#-------------------------------------------------- + +_get_functions() { + # this regular expression matches functions with either bash or sh syntax + awk '/^(function )? *[a-zA-Z0-9_]+ *\(\) *\{/ { + sub("^function ",""); gsub("[ ()]",""); # remove leading "function ", round brackets and extra spaces + FUNCTION = substr($0, 1, index($0, "{")); # truncate string after opening curly brace + sub("{$", "", FUNCTION); # remove trailing curly brace + if (substr(PREV, 1, 3) == "## " && substr($0, 1, 1) != "_") print FUNCTION + } { PREV = $0 }' "$0" +} + +#-------------------------------------------------- + +_main() { + if [ $# -lt 1 ]; then + help + exit 0 + fi + + _execute='' + for _argument in "$@"; do + _is_valid=false + for _function in $(_get_functions); do + # get shorthand character + _shorthand="$(echo "${_function}" | awk '{$0=substr($0, 1, 1); print}')" + if [ "${_argument}" = "${_function}" ] || [ "${_argument}" = "${_shorthand}" ]; then + # append argument to the execute stack + _execute="${_execute} ${_function}" + _is_valid=true + break + fi + done + if [ "${_is_valid}" = false ]; then + printf '\033[1;31merror:\t\033[0;91m"%s" is not a valid command\033[0m\n' "${_argument}" + help + exit 1 + fi + done + + for _function in ${_execute}; do + eval "${_function}" + done +} + +_main "$@" diff --git a/tools/src/colors/colors.sh b/tools/src/colors/colors.sh new file mode 100755 index 0000000..56e9f48 --- /dev/null +++ b/tools/src/colors/colors.sh @@ -0,0 +1,120 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0 +# */ + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[1;104;97m'; ALERT_SECONDARY='\033[1;45;97m'; ALERT_SUCCESS='\033[1;42;97m'; ALERT_DANGER='\033[1;41;97m'; ALERT_WARNING='\033[1;43;97m'; ALERT_INFO='\033[1;44;97m'; ALERT_LIGHT='\033[1;47;90m'; ALERT_DARK='\033[1;40;37m'; +} + +## Print primary (bright white text) +echo_primary() { + printf "%b%b${EOL}" "${PRIMARY}" "${*}" +} + +## Print secondary (bright blue text) +echo_secondary() { + printf "%b%b${EOL}" "${SECONDARY}" "${*}" +} + +## Print success (bright green text) +echo_success() { + printf "%b%b${EOL}" "${SUCCESS}" "${*}" +} + +## Print danger (red text) +echo_danger() { + printf "%b%b${EOL}" "${DANGER}" "${*}" +} + +## Print warning (orange text) +echo_warning() { + printf "%b%b${EOL}" "${WARNING}" "${*}" +} + +## Print info (bright purple text) +echo_info() { + printf "%b%b${EOL}" "${INFO}" "${*}" +} + +## Print light (black text over white background) +echo_light() { + printf "%b%b${EOL}" "${LIGHT}" "${*}" +} + +## Print dark (white text over black background) +echo_dark() { + printf "%b%b${EOL}" "${DARK}" "${*}" +} + +## Print label (green text with optional padding, no carriage return) +echo_label() { + if [ $# -eq 2 ]; then + printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2" + else + printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}" + fi +} + +## Print error (red text, prefixed 'error:') +echo_error() { + printf "%berror: %b${EOL}" "${DANGER}" "${*}" +} + +## Print primary alert (bold white text over bright blue background) +alert_primary() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" '' +} + +## Print secondary alert (bold white text over bright purple background) +alert_secondary() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" '' +} + +## Print success alert (bold white text over bright green background) +alert_success() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "${*}" "${ALERT_SUCCESS}" '' +} + +## Print danger alert (bold white text over bright red background) +alert_danger() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DANGER}" '' "${ALERT_DANGER}" "${*}" "${ALERT_DANGER}" '' +} + +## Print warning alert (bold white text over bright orange background) +alert_warning() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "${*}" "${ALERT_WARNING}" '' +} + +## Print info alert (bold white text over bright blue background) +alert_info() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "${*}" "${ALERT_INFO}" '' +} + +## Print light alert (black text over white background) +alert_light() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" '' +} + +## Print dark alert (bold white text over black background) +alert_dark() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" '' +} diff --git a/tools/src/colors/colors_a.sh b/tools/src/colors/colors_a.sh new file mode 100755 index 0000000..50e1e6e --- /dev/null +++ b/tools/src/colors/colors_a.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-a +# */ + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[1;104;97m'; ALERT_SECONDARY='\033[1;45;97m'; ALERT_SUCCESS='\033[1;42;97m'; ALERT_DANGER='\033[1;41;97m'; ALERT_WARNING='\033[1;43;97m'; ALERT_INFO='\033[1;44;97m'; ALERT_LIGHT='\033[1;47;90m'; ALERT_DARK='\033[1;40;37m'; +} + +echo_primary() { printf "%b%b${DEFAULT}" "${PRIMARY}" "${*}"; } +echo_secondary() { printf "%b%b${DEFAULT}" "${SECONDARY}" "${*}"; } +echo_success() { printf "%b%b${DEFAULT}" "${SUCCESS}" "${*}"; } +echo_danger() { printf "%b%b${DEFAULT}" "${DANGER}" "${*}"; } +echo_warning() { printf "%b%b${DEFAULT}" "${WARNING}" "${*}"; } +echo_info() { printf "%b%b${DEFAULT}" "${INFO}" "${*}"; } +echo_light() { printf "%b%b${DEFAULT}" "${LIGHT}" "${*}"; } +echo_dark() { printf "%b%b${DEFAULT}" "${DARK}" "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2"; else printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}"; fi } +echo_error() { printf "%berror: %b${DEFAULT}" "${DANGER}" "${*}"; } + +alert_primary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" ''; } +alert_secondary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" ''; } +alert_success() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "${*}" "${ALERT_SUCCESS}" ''; } +alert_danger() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DANGER}" '' "${ALERT_DANGER}" "${*}" "${ALERT_DANGER}" ''; } +alert_warning() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "${*}" "${ALERT_WARNING}" ''; } +alert_info() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "${*}" "${ALERT_INFO}" ''; } +alert_light() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" ''; } +alert_dark() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" ''; } diff --git a/tools/src/colors/colors_b.sh b/tools/src/colors/colors_b.sh new file mode 100755 index 0000000..5d533f3 --- /dev/null +++ b/tools/src/colors/colors_b.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-b +# */ + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[1;104;97m'; ALERT_SECONDARY='\033[1;45;97m'; ALERT_SUCCESS='\033[1;42;97m'; ALERT_DANGER='\033[1;41;97m'; ALERT_WARNING='\033[1;43;97m'; ALERT_INFO='\033[1;44;97m'; ALERT_LIGHT='\033[1;47;90m'; ALERT_DARK='\033[1;40;37m'; +} + +echo_primary() { printf "%b%b${EOL}" "${PRIMARY}" "${*}"; } +echo_secondary() { printf "%b%b${EOL}" "${SECONDARY}" "${*}"; } +echo_success() { printf "%b%b${EOL}" "${SUCCESS}" "${*}"; } +echo_danger() { printf "%b%b${EOL}" "${DANGER}" "${*}"; } +echo_warning() { printf "%b%b${EOL}" "${WARNING}" "${*}"; } +echo_info() { printf "%b%b${EOL}" "${INFO}" "${*}"; } +echo_light() { printf "%b%b${EOL}" "${LIGHT}" "${*}"; } +echo_dark() { printf "%b%b${EOL}" "${DARK}" "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2"; else printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}"; fi } +echo_error() { printf "%berror: %b${EOL}" "${DANGER}" "${*}"; } + +alert_primary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" ''; } +alert_secondary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" ''; } +alert_success() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "${*}" "${ALERT_SUCCESS}" ''; } +alert_danger() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DANGER}" '' "${ALERT_DANGER}" "${*}" "${ALERT_DANGER}" ''; } +alert_warning() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "${*}" "${ALERT_WARNING}" ''; } +alert_info() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "${*}" "${ALERT_INFO}" ''; } +alert_light() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" ''; } +alert_dark() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" ''; } diff --git a/tools/src/colors/colors_c.sh b/tools/src/colors/colors_c.sh new file mode 100755 index 0000000..418d435 --- /dev/null +++ b/tools/src/colors/colors_c.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-c +# */ + +echo_primary() { printf '%b%b\033[0m\n' '\033[97m' "${*}"; } +echo_secondary() { printf '%b%b\033[0m\n' '\033[94m' "${*}"; } +echo_success() { printf '%b%b\033[0m\n' '\033[32m' "${*}"; } +echo_danger() { printf '%b%b\033[0m\n' '\033[31m' "${*}"; } +echo_warning() { printf '%b%b\033[0m\n' '\033[33m' "${*}"; } +echo_info() { printf '%b%b\033[0m\n' '\033[95m' "${*}"; } +echo_light() { printf '%b%b\033[0m\n' '\033[47;90m' "${*}"; } +echo_dark() { printf '%b%b\033[0m\n' '\033[40;37m' "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s \033[0m" '\033[32m' "$2"; else printf "%b%b \033[0m" '\033[32m' "${*}"; fi } +echo_error() { printf '%berror: %b\033[0m\n' '\033[31m' "${*}"; } + +alert_primary() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;104;97m' '' '\033[1;104;97m' "${*}" '\033[1;104;97m' ''; } +alert_secondary() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;45;97m' '' '\033[1;45;97m' "${*}" '\033[1;45;97m' ''; } +alert_success() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;42;97m' '' '\033[1;42;97m' "${*}" '\033[1;42;97m' ''; } +alert_danger() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;41;97m' '' '\033[1;41;97m' "${*}" '\033[1;41;97m' ''; } +alert_warning() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;43;97m' '' '\033[1;43;97m' "${*}" '\033[1;43;97m' ''; } +alert_info() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;44;97m' '' '\033[1;44;97m' "${*}" '\033[1;44;97m' ''; } +alert_light() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;47;90m' '' '\033[1;47;90m' "${*}" '\033[1;47;90m' ''; } +alert_dark() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;40;37m' '' '\033[1;40;37m' "${*}" '\033[1;40;37m' ''; } diff --git a/tools/src/colors/colors_d.sh b/tools/src/colors/colors_d.sh new file mode 100755 index 0000000..9e6f7d6 --- /dev/null +++ b/tools/src/colors/colors_d.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-d +# */ + +echo_primary() { printf '%b%b\033[0m' '\033[97m' "${*}"; } +echo_secondary() { printf '%b%b\033[0m' '\033[94m' "${*}"; } +echo_success() { printf '%b%b\033[0m' '\033[32m' "${*}"; } +echo_danger() { printf '%b%b\033[0m' '\033[31m' "${*}"; } +echo_warning() { printf '%b%b\033[0m' '\033[33m' "${*}"; } +echo_info() { printf '%b%b\033[0m' '\033[95m' "${*}"; } +echo_light() { printf '%b%b\033[0m' '\033[47;90m' "${*}"; } +echo_dark() { printf '%b%b\033[0m' '\033[40;37m' "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s \033[0m" '\033[32m' "$2"; else printf "%b%b \033[0m" '\033[32m' "${*}"; fi } +echo_error() { printf '%berror: %b\033[0m' '\033[31m' "${*}"; } + +alert_primary() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;104;97m' '' '\033[1;104;97m' "${*}" '\033[1;104;97m' ''; } +alert_secondary() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;45;97m' '' '\033[1;45;97m' "${*}" '\033[1;45;97m' ''; } +alert_success() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;42;97m' '' '\033[1;42;97m' "${*}" '\033[1;42;97m' ''; } +alert_danger() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;41;97m' '' '\033[1;41;97m' "${*}" '\033[1;41;97m' ''; } +alert_warning() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;43;97m' '' '\033[1;43;97m' "${*}" '\033[1;43;97m' ''; } +alert_info() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;44;97m' '' '\033[1;44;97m' "${*}" '\033[1;44;97m' ''; } +alert_light() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;47;90m' '' '\033[1;47;90m' "${*}" '\033[1;47;90m' ''; } +alert_dark() { printf '\033[0m\n%b%64s\033[0m\n%b %-63s\033[0m\n%b%64s\033[0m\n\n' '\033[1;40;37m' '' '\033[1;40;37m' "${*}" '\033[1;40;37m' ''; } diff --git a/tools/src/colors/colors_demo.sh b/tools/src/colors/colors_demo.sh new file mode 100755 index 0000000..de0187e --- /dev/null +++ b/tools/src/colors/colors_demo.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Colors Demo +# * +# * A demo to test colors +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/colors.sh" + +PADDING=9 + +function demo_echo() { + echo_primary 'This is primary text (97m)' + echo_secondary 'This is secondary text (94m)' + echo_success 'This is a success (32m)' + echo_danger 'This is a danger (31m)' + echo_warning 'This is a warning (33m)' + echo_info 'This is an info (95m)' + echo_light 'This is light (47;90m)' + echo_dark 'This is dark (40;37m)' + echo + echo_label "${PADDING}" 'label (32m):'; echo_primary 'This is a label' + echo_error 'This is an error (31m)' + echo +} + +function demo_alert() { + alert_primary 'This is a primary alert (1;104;97m)' + alert_secondary 'This is a secondary alert (1;45;97m)' + alert_success 'This is a success alert (1;42;97m)' + alert_danger 'This is a danger alert (1;41;97m)' + alert_warning 'This is a warning alert (1;43;97m)' + alert_info 'This is a info alert (1;44;97m)' + alert_light 'This is a light alert (1;47;90m)' + alert_dark 'This is a dark alert (1;40;37m)' +} + +demo_echo +demo_alert + diff --git a/tools/src/colors/colors_demo_sf.sh b/tools/src/colors/colors_demo_sf.sh new file mode 100755 index 0000000..e03fcd6 --- /dev/null +++ b/tools/src/colors/colors_demo_sf.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Colors Demo +# * +# * A demo to test colors +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/colors_sf.sh" + +PADDING=9 + +function demo_echo() { + echo_primary 'This is primary text (97m)' + echo_secondary 'This is secondary text (94m)' + echo_success 'This is a success (32m)' + echo_danger 'This is a danger (31m)' + echo_warning 'This is a warning (33m)' + echo_info 'This is an info (95m)' + echo_light 'This is light (47;90m)' + echo_dark 'This is dark (40;37m)' + echo + echo_label "${PADDING}" 'label (32m):'; echo_primary 'This is a label' + echo_error 'This is an error (31m)' + echo +} + +function demo_alert() { + alert_primary 'This is a primary alert (104;37m)' + alert_secondary 'This is a secondary alert (45;37m)' + alert_success 'This is a success alert (42;30m)' + alert_danger 'This is a danger alert (41;37m)' + alert_warning 'This is a warning alert (43;30m)' + alert_info 'This is a info alert (44;37m)' + alert_light 'This is a light alert (47;90m)' + alert_dark 'This is a dark alert (40;37m)' +} + +demo_echo +demo_alert + diff --git a/tools/src/colors/colors_sf.sh b/tools/src/colors/colors_sf.sh new file mode 100755 index 0000000..c540c7c --- /dev/null +++ b/tools/src/colors/colors_sf.sh @@ -0,0 +1,121 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Symfony Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-sf +# */ + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[104;37m'; ALERT_SECONDARY='\033[45;37m'; ALERT_SUCCESS='\033[42;30m'; ALERT_DANGER='\033[41;37m'; ALERT_WARNING='\033[43;30m'; ALERT_INFO='\033[44;37m'; ALERT_LIGHT='\033[47;90m'; ALERT_DARK='\033[40;37m'; +} + +## Print primary (bright white text) +echo_primary() { + printf "%b%b${EOL}" "${PRIMARY}" "${*}" +} + +## Print secondary (bright blue text) +echo_secondary() { + printf "%b%b${EOL}" "${SECONDARY}" "${*}" +} + +## Print success (bright green text) +echo_success() { + printf "%b%b${EOL}" "${SUCCESS}" "${*}" +} + +## Print danger (red text) +echo_danger() { + printf "%b%b${EOL}" "${DANGER}" "${*}" +} + +## Print warning (orange text) +echo_warning() { + printf "%b%b${EOL}" "${WARNING}" "${*}" +} + +## Print info (bright purple text) +echo_info() { + printf "%b%b${EOL}" "${INFO}" "${*}" +} + +## Print light (black text over white background) +echo_light() { + printf "%b%b${EOL}" "${LIGHT}" "${*}" +} + +## Print dark (white text over black background) +echo_dark() { + printf "%b%b${EOL}" "${DARK}" "${*}" +} + +## Print label (green text with optional padding, no carriage return) +echo_label() { + if [ $# -eq 2 ]; then + printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2"; + else + printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}" + fi +} + +## Print error (red text, prefixed 'error:') +echo_error() { + printf "%berror: %b${EOL}" "${DANGER}" "${*}"; +} + +## Print primary alert (white text over bright blue background) +alert_primary() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" '' +} + +## Print secondary alert (white text over bright purple background) +alert_secondary() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" '' +} + +## Print success alert (black text over bright green background) +alert_success() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "[OK] ${*}" "${ALERT_SUCCESS}" '' +} + +## Print danger alert (white text over bright red background) +alert_danger() { + printf "${EOL}%b %-63s${EOL}%b %-63s${EOL}%b %-63s${EOL}\n" "${ALERT_DANGER}" '!' "${ALERT_DANGER}" "! [ERROR] ${*}" "${ALERT_DANGER}" '!' +} + +## Print warning alert (white text over bright orange background) +alert_warning() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "[WARNING] ${*}" "${ALERT_WARNING}" '' +} + +## Print info alert (white text over bright blue background) +alert_info() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "[INFO] ${*}" "${ALERT_INFO}" '' +} + +## Print light alert (black text over white background) +alert_light() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" '' +} + +## Print dark alert (white text over black background) +alert_dark() { + printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" '' +} + diff --git a/tools/src/colors/colors_sfa.sh b/tools/src/colors/colors_sfa.sh new file mode 100755 index 0000000..816128f --- /dev/null +++ b/tools/src/colors/colors_sfa.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Symfony Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-sfa +# */ + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[104;37m'; ALERT_SECONDARY='\033[45;37m'; ALERT_SUCCESS='\033[42;30m'; ALERT_DANGER='\033[41;37m'; ALERT_WARNING='\033[43;30m'; ALERT_INFO='\033[44;37m'; ALERT_LIGHT='\033[47;90m'; ALERT_DARK='\033[40;37m'; +} + +echo_primary() { printf "%b%b${EOL}" "${PRIMARY}" "${*}"; } +echo_secondary() { printf "%b%b${EOL}" "${SECONDARY}" "${*}"; } +echo_success() { printf "%b%b${EOL}" "${SUCCESS}" "${*}"; } +echo_danger() { printf "%b%b${EOL}" "${DANGER}" "${*}"; } +echo_warning() { printf "%b%b${EOL}" "${WARNING}" "${*}"; } +echo_info() { printf "%b%b${EOL}" "${INFO}" "${*}"; } +echo_light() { printf "%b%b${EOL}" "${LIGHT}" "${*}"; } +echo_dark() { printf "%b%b${EOL}" "${DARK}" "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2"; else printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}"; fi } +echo_error() { printf "%berror: %b${EOL}" "${DANGER}" "${*}"; } + +alert_primary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" '' ; } +alert_secondary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" '' ; } +alert_success() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "[OK] ${*}" "${ALERT_SUCCESS}" '' ; } +alert_danger() { printf "${EOL}%b %-63s${EOL}%b %-63s${EOL}%b %-63s${EOL}\n" "${ALERT_DANGER}" '!' "${ALERT_DANGER}" "! [ERROR] ${*}" "${ALERT_DANGER}" '!'; } +alert_warning() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "[WARNING] ${*}" "${ALERT_WARNING}" '' ; } +alert_info() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "[INFO] ${*}" "${ALERT_INFO}" '' ; } +alert_light() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" '' ; } +alert_dark() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" '' ; } diff --git a/tools/src/colors/colors_sfb.sh b/tools/src/colors/colors_sfb.sh new file mode 100755 index 0000000..8d4b78c --- /dev/null +++ b/tools/src/colors/colors_sfb.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Symfony Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-sfb +# */ + +# shellcheck disable=SC2034 +{ + PRIMARY='\033[97m'; SECONDARY='\033[94m'; SUCCESS='\033[32m'; DANGER='\033[31m'; WARNING='\033[33m'; INFO='\033[95m'; LIGHT='\033[47;90m'; DARK='\033[40;37m'; DEFAULT='\033[0m'; EOL='\033[0m\n'; + ALERT_PRIMARY='\033[104;37m'; ALERT_SECONDARY='\033[45;37m'; ALERT_SUCCESS='\033[42;30m'; ALERT_DANGER='\033[41;37m'; ALERT_WARNING='\033[43;30m'; ALERT_INFO='\033[44;37m'; ALERT_LIGHT='\033[47;90m'; ALERT_DARK='\033[40;37m'; +} + +echo_primary() { printf "%b%b${DEFAULT}" "${PRIMARY}" "${*}"; } +echo_secondary() { printf "%b%b${DEFAULT}" "${SECONDARY}" "${*}"; } +echo_success() { printf "%b%b${DEFAULT}" "${SUCCESS}" "${*}"; } +echo_danger() { printf "%b%b${DEFAULT}" "${DANGER}" "${*}"; } +echo_warning() { printf "%b%b${DEFAULT}" "${WARNING}" "${*}"; } +echo_info() { printf "%b%b${DEFAULT}" "${INFO}" "${*}"; } +echo_light() { printf "%b%b${DEFAULT}" "${LIGHT}" "${*}"; } +echo_dark() { printf "%b%b${DEFAULT}" "${DARK}" "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s ${DEFAULT}" "${SUCCESS}" "$2"; else printf "%b%b ${DEFAULT}" "${SUCCESS}" "${*}"; fi } +echo_error() { printf "%berror: %b${DEFAULT}" "${DANGER}" "${*}"; } + +alert_primary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_PRIMARY}" '' "${ALERT_PRIMARY}" "${*}" "${ALERT_PRIMARY}" '' ; } +alert_secondary() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SECONDARY}" '' "${ALERT_SECONDARY}" "${*}" "${ALERT_SECONDARY}" '' ; } +alert_success() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_SUCCESS}" '' "${ALERT_SUCCESS}" "[OK] ${*}" "${ALERT_SUCCESS}" '' ; } +alert_danger() { printf "${EOL}%b %-63s${EOL}%b %-63s${EOL}%b %-63s${EOL}\n" "${ALERT_DANGER}" '!' "${ALERT_DANGER}" "! [ERROR] ${*}" "${ALERT_DANGER}" '!'; } +alert_warning() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_WARNING}" '' "${ALERT_WARNING}" "[WARNING] ${*}" "${ALERT_WARNING}" '' ; } +alert_info() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_INFO}" '' "${ALERT_INFO}" "[INFO] ${*}" "${ALERT_INFO}" '' ; } +alert_light() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_LIGHT}" '' "${ALERT_LIGHT}" "${*}" "${ALERT_LIGHT}" '' ; } +alert_dark() { printf "${EOL}%b%64s${EOL}%b %-63s${EOL}%b%64s${EOL}\n" "${ALERT_DARK}" '' "${ALERT_DARK}" "${*}" "${ALERT_DARK}" '' ; } diff --git a/tools/src/colors/colors_sfc.sh b/tools/src/colors/colors_sfc.sh new file mode 100755 index 0000000..1eed5a6 --- /dev/null +++ b/tools/src/colors/colors_sfc.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Symfony Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony (minified) +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-sfc +# */ + +echo_primary() { printf '\033[97m%b\033[0m\n' "${*}"; } +echo_secondary() { printf '\033[94m%b\033[0m\n' "${*}"; } +echo_success() { printf '\033[32m%b\033[0m\n' "${*}"; } +echo_danger() { printf '\033[31m%b\033[0m\n' "${*}"; } +echo_warning() { printf '\033[33m%b\033[0m\n' "${*}"; } +echo_info() { printf '\033[95m%b\033[0m\n' "${*}"; } +echo_light() { printf '\033[47;90m%b\033[0m\n' "${*}"; } +echo_dark() { printf '\033[40;37m%b\033[0m\n' "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s \033[0m" '\033[32m' "$2"; else printf "%b%b \033[0m" '\033[32m' "${*}"; fi } +echo_error() { printf '%berror: %b\033[0m\n' '\033[31m' "${*}"; } + +alert_primary() { printf "\033[0m\n\033[104;37m%64s\033[0m\n\033[104;37m %-63s\033[0m\n\033[104;37m%64s\033[0m\n\n" '' "${*}" ''; } +alert_secondary() { printf "\033[0m\n\033[45;37m%64s\033[0m\n\033[45;37m %-63s\033[0m\n\033[45;37m%64s\033[0m\n\n" '' "${*}" ''; } +alert_success() { printf "\033[0m\n\033[42;30m%64s\033[0m\n\033[42;30m %-63s\033[0m\n\033[42;30m%64s\033[0m\n\n" '' "[OK] ${*}" ''; } +alert_danger() { printf "\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\n" '!' "! [ERROR] ${*}" '!'; } +alert_warning() { printf "\033[0m\n\033[43;30m%64s\033[0m\n\033[43;30m %-63s\033[0m\n\033[43;30m%64s\033[0m\n\n" '' "[WARNING] ${*}" ''; } +alert_info() { printf "\033[0m\n\033[44;37m%64s\033[0m\n\033[44;37m %-63s\033[0m\n\033[44;37m%64s\033[0m\n\n" '' "[INFO] ${*}" ''; } +alert_light() { printf "\033[0m\n\033[47;90m%64s\033[0m\n\033[47;90m %-63s\033[0m\n\033[47;90m%64s\033[0m\n\n" '' "${*}" ''; } +alert_dark() { printf "\033[0m\n\033[40;37m%64s\033[0m\n\033[40;37m %-63s\033[0m\n\033[40;37m%64s\033[0m\n\n" '' "${*}" ''; } diff --git a/tools/src/colors/colors_sfd.sh b/tools/src/colors/colors_sfd.sh new file mode 100755 index 0000000..1ba84a6 --- /dev/null +++ b/tools/src/colors/colors_sfd.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Symfony Colors +# * +# * A semantic set of colors for shell scripts inspired by Bootstrap and Symfony (minified) +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# * @version 0.1.0-sfd +# */ + +echo_primary() { printf '\033[97m%b\033[0m' "${*}"; } +echo_secondary() { printf '\033[94m%b\033[0m' "${*}"; } +echo_success() { printf '\033[32m%b\033[0m' "${*}"; } +echo_danger() { printf '\033[31m%b\033[0m' "${*}"; } +echo_warning() { printf '\033[33m%b\033[0m' "${*}"; } +echo_info() { printf '\033[95m%b\033[0m' "${*}"; } +echo_light() { printf '\033[47;90m%b\033[0m' "${*}"; } +echo_dark() { printf '\033[40;37m%b\033[0m' "${*}"; } + +echo_label() { if [ $# -eq 2 ]; then printf "%b%-${1}s \033[0m" '\033[32m' "$2"; else printf "%b%b \033[0m" '\033[32m' "${*}"; fi } +echo_error() { printf '%berror: %b\033[0m' '\033[31m' "${*}"; } + +alert_primary() { printf "\033[0m\n\033[104;37m%64s\033[0m\n\033[104;37m %-63s\033[0m\n\033[104;37m%64s\033[0m\n\n" '' "${*}" ''; } +alert_secondary() { printf "\033[0m\n\033[45;37m%64s\033[0m\n\033[45;37m %-63s\033[0m\n\033[45;37m%64s\033[0m\n\n" '' "${*}" ''; } +alert_success() { printf "\033[0m\n\033[42;30m%64s\033[0m\n\033[42;30m %-63s\033[0m\n\033[42;30m%64s\033[0m\n\n" '' "[OK] ${*}" ''; } +alert_danger() { printf "\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\n" '!' "! [ERROR] ${*}" '!'; } +alert_warning() { printf "\033[0m\n\033[43;30m%64s\033[0m\n\033[43;30m %-63s\033[0m\n\033[43;30m%64s\033[0m\n\n" '' "[WARNING] ${*}" ''; } +alert_info() { printf "\033[0m\n\033[44;37m%64s\033[0m\n\033[44;37m %-63s\033[0m\n\033[44;37m%64s\033[0m\n\n" '' "[INFO] ${*}" ''; } +alert_light() { printf "\033[0m\n\033[47;90m%64s\033[0m\n\033[47;90m %-63s\033[0m\n\033[47;90m%64s\033[0m\n\n" '' "${*}" ''; } +alert_dark() { printf "\033[0m\n\033[40;37m%64s\033[0m\n\033[40;37m %-63s\033[0m\n\033[40;37m%64s\033[0m\n\n" '' "${*}" ''; } diff --git a/tools/src/colors/print_colors.sh b/tools/src/colors/print_colors.sh new file mode 100755 index 0000000..99d4725 --- /dev/null +++ b/tools/src/colors/print_colors.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Colors Demo +# * +# * A demo to test colors +# * +# * colors: {30..37} +# * high intensity foreground: {90..97} +# * bold: 1 +# * underline: 4 +# * background: {40..47} +# * high intensity background: {100..107} +# * +# * @author "Matthias Morin" +# * @link https://github.com/TangoMan75/tools +# */ + +## Print color range table +function print_colors() { + for foreground in {30..37} {90..97}; do + for attr in 0 1 4; do + for background in 0 {40..47} {100..107}; do + if [ "${background}" -eq 0 ] && [ "${attr}" -eq 0 ]; then + echo -en "\033[${foreground}m" + printf "%11s" "[${foreground}m " + echo -en "\033[0m" + elif [ "${attr}" -eq 0 ]; then + echo -en "\033[${background};${foreground}m" + printf "%11s" "[${background};${foreground}m " + echo -en "\033[0m" + elif [ "${background}" -eq 0 ]; then + echo -en "\033[${attr};${foreground}m" + printf "%11s" "[${attr};${foreground}m " + echo -en "\033[0m" + else + echo -en "\033[$attr;${background};${foreground}m" + printf "%11s" "[${attr};${background};${foreground}m " + echo -en "\033[0m" + fi + done + echo + done + done +} + +print_colors diff --git a/tools/src/git/get_latest_release.sh b/tools/src/git/get_latest_release.sh new file mode 100755 index 0000000..24675c7 --- /dev/null +++ b/tools/src/git/get_latest_release.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Get repository latest release from github +function get_latest_release() { + if [ ! -x "$(command -v curl)" ]; then + echo_error "\"${FUNCNAME[0]}\" requires curl, try: 'sudo apt-get install -y curl'" + + return 1 + fi + + local REPOSITORY=$1 + + OPTIND=0 + while getopts :h OPTION; do + case "${OPTION}" in + h|*) echo_warning "${FUNCNAME[0]}"; + echo_label 16 'description:'; echo_primary 'Get repository latest release' + echo_label 16 'usage:'; echo_primary "${FUNCNAME[0]} [owner/repository] -h (help)" + return 0;; + esac + done + + if [ "$#" -lt 1 ]; then + echo_error 'some mandatory parameter is missing' + echo_label 8 'usage:'; echo_primary "${FUNCNAME[0]} [owner/repository] -h (help)" + return 1 + fi + + if [ "$#" -gt 1 ]; then + echo_error "too many arguments ($#)" + echo_label 8 'usage:'; echo_primary "${FUNCNAME[0]} [owner/repository] -h (help)" + return 1 + fi + + curl --silent "https://api.github.com/repos/${REPOSITORY}/releases/latest" | + grep '"tag_name":' | # find tag name + sed -E 's/.*"[vV]?([^"]+)".*/\1/' # remove quotes and leading v if any +} diff --git a/tools/src/git/get_latest_tag.sh b/tools/src/git/get_latest_tag.sh new file mode 100755 index 0000000..c2bfec0 --- /dev/null +++ b/tools/src/git/get_latest_tag.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Get repository latest tag from github +function get_latest_tag() { + if [ ! -x "$(command -v curl)" ]; then + echo_error "\"${FUNCNAME[0]}\" requires curl, try: 'sudo apt-get install -y curl'" + + return 1 + fi + + local REPOSITORY=$1 + + OPTIND=0 + while getopts :h OPTION; do + case "${OPTION}" in + h|*) echo_warning "${FUNCNAME[0]}"; + echo_label 16 'description:'; echo_primary 'Get repository latest tag' + echo_label 16 'usage:'; echo_primary "${FUNCNAME[0]} [owner/repository] -h (help)" + return 0;; + esac + done + + if [ "$#" -lt 1 ]; then + echo_error 'some mandatory parameter is missing' + echo_label 8 'usage:'; echo_primary "${FUNCNAME[0]} [owner/repository] -h (help)" + return 1 + fi + + if [ "$#" -gt 1 ]; then + echo_error "too many arguments ($#)" + echo_label 8 'usage:'; echo_primary "${FUNCNAME[0]} [owner/repository] -h (help)" + return 1 + fi + + curl --silent "https://api.github.com/repos/${REPOSITORY}/tags" | + grep -m 1 '"name":' | # find first tag name + sed -E 's/.*"[vV]?([^"]+)".*/\1/' # remove quotes and leading v if any +} diff --git a/tools/src/network/download.sh b/tools/src/network/download.sh new file mode 100755 index 0000000..9e0592b --- /dev/null +++ b/tools/src/network/download.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Download file with either curl or wget +function download() { + local DOWNLOADER + + if [ ! -x "$(command -v curl)" ]; then + DOWNLOADER="curl" + elif [ ! -x "$(command -v wget)" ]; then + DOWNLOADER="wget" + else + echo_error "\"$(basename "${0}")\" requires curl or wget, try: 'sudo apt-get install -y curl'" + + return 1 + fi + + case ${DOWNLOADER} in + 'curl') + # -s sient -S show errors -L follow redirects + echo_info "curl -sSL \"$1\"" + curl -sSL "$1" + ;; + 'wget') + # -q sient + echo_info "wget -q \"$1\"" + wget -q "$1" + ;; + esac +} + diff --git a/tools/src/system/check_install.sh b/tools/src/system/check_install.sh new file mode 100755 index 0000000..752749c --- /dev/null +++ b/tools/src/system/check_install.sh @@ -0,0 +1,153 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Check Install +# * +# * This script is meant to quickly check for common apps installation +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}"/../colors/colors.sh +# shellcheck source=/dev/null +. "${CURDIR}"/is_installed.sh + +## Check availability of some development tools +check_install() { + alert_primary 'Check Install' + + echo_label 17 'ansible' + is_installed 'ansible' + + echo_label 17 'apache2' + is_installed 'apache2' + + echo_label 17 'aws' + is_installed 'aws' + + echo_label 17 'bundle' + is_installed 'bundle' + + echo_label 17 'chef' + is_installed 'chef' + + echo_label 17 'curl' + is_installed 'curl' + + echo_label 17 'docker' + is_installed 'docker' + + echo_label 17 'docker-compose' + is_installed 'docker-compose' + + echo_label 17 'gawk' + is_installed 'gawk' + + echo_label 17 'gem' + is_installed 'gem' + + echo_label 17 'git' + is_installed 'git' + + echo_label 17 'iptables' + is_installed 'iptables' + + echo_label 17 'make' + is_installed 'make' + + echo_label 17 'mokutil' + is_installed 'mokutil' + + echo_label 17 'mysql' + is_installed 'mysql' + + echo_label 17 'nfs-common' + is_installed 'nfs-common' + + echo_label 17 'nfs-kernel-server' + is_installed 'nfs-kernel-server' + + echo_label 17 'netstat' + is_installed 'netstat' + + echo_label 17 'nginx' + is_installed 'nginx' + + echo_label 17 'nmap' + is_installed 'nmap' + + echo_label 17 'nodejs' + is_installed 'nodejs' + + echo_label 17 'npm' + is_installed 'npm' + + echo_label 17 'openssl' + is_installed 'openssl' + + echo_label 17 'perl' + is_installed 'perl' + + echo_label 17 'psql' + is_installed 'psql' + + echo_label 17 'php' + is_installed 'php' + + echo_label 17 'pip' + is_installed 'pip' + + echo_label 17 'pip3' + is_installed 'pip3' + + echo_label 17 'python' + is_installed 'python' + + echo_label 17 'python3' + is_installed 'python3' + + echo_label 17 'ruby' + is_installed 'ruby' + + echo_label 17 'rvm' + is_installed 'rvm' + + echo_label 17 'shellcheck' + is_installed 'shellcheck' + + echo_label 17 'sqlite3' + is_installed 'sqlite3' + + echo_label 17 'ufw' + is_installed 'ufw' + + echo_label 17 'vagrant' + is_installed 'vagrant' + + echo_label 17 'vboxmanage' + is_installed 'vboxmanage' + + echo_label 17 'wine' + is_installed 'wine' + + echo_label 17 'wget' + is_installed 'wget' + + echo_label 17 'yarn' + is_installed 'yarn' + + echo_label 17 'zsh' + is_installed 'zsh' +} diff --git a/tools/src/system/check_root.sh b/tools/src/system/check_root.sh new file mode 100755 index 0000000..1ea122d --- /dev/null +++ b/tools/src/system/check_root.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Throws error when user doesn't own root privileges +function check_root() { + if [ "$(id | awk '{print $1}')" != 'uid=0(root)' ];then + echo_error "user \"${USER}\" does not own root privileges." + + return 1 + fi +} + diff --git a/tools/src/system/check_versions.sh b/tools/src/system/check_versions.sh new file mode 100755 index 0000000..4090d91 --- /dev/null +++ b/tools/src/system/check_versions.sh @@ -0,0 +1,314 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Check Install +# * +# * This script is meant to quickly check for common apps installation +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}"/../colors/colors.sh +# shellcheck source=/dev/null +. "${CURDIR}"/is_installed.sh + +## Check version of some development tools +check_versions() { + alert_primary 'Check Versions' + + echo_info 'ansible\n' + if [ "$(is_installed 'ansible')" = true ]; then + ansible --version | head -n 1 + else + echo_danger 'ansible is not installed on your system\n' + fi + + echo_info 'apache2\n' + if [ "$(is_installed 'apache2')" = true ] && [ -n "$(apache2 --version 2>/dev/null)" ]; then + apache2 --version 2>/dev/null + else + echo_danger 'apache2 is not installed on your system\n' + fi + + echo_info 'aws\n' + if [ "$(is_installed 'aws')" = true ]; then + aws --version + else + echo_danger 'aws is not installed on your system\n' + fi + + echo_info 'bundle\n' + if [ "$(is_installed 'bundle')" = true ]; then + bundle --version + else + echo_danger 'bundle is not installed on your system\n' + fi + + echo_info 'chef\n' + if [ "$(is_installed 'chef')" = true ]; then + chef --version + else + echo_danger 'chef is not installed on your system\n' + fi + + echo_info 'composer\n' + if [ "$(is_installed 'php')" = true ]; then + if [ -n "$(command -v composer)" ]; then + $(command -v composer) --version + else + echo_danger 'composer is not installed on your system\n' + fi + else + echo_danger 'unable to show composer version, php not installed\n' + fi + + echo_info 'curl\n' + if [ "$(is_installed 'curl')" = true ]; then + curl --version | head -n1 + else + echo_danger 'curl is not installed on your system\n' + fi + + echo_info 'docker\n' + if [ "$(is_installed 'docker')" = true ]; then + docker --version + else + echo_danger 'docker is not installed on your system\n' + fi + + echo_info 'docker-compose\n' + if [ "$(is_installed 'compose')" = true ]; then + docker-compose --version + else + echo_danger 'docker-compose is not installed on your system\n' + fi + + echo_info 'gem\n' + if [ "$(is_installed 'gem')" = true ]; then + gem --version + else + echo_danger 'gem is not installed on your system\n' + fi + + echo_info 'git\n' + if [ "$(is_installed 'git')" = true ]; then + git --version + else + echo_danger 'git is not installed on your system\n' + fi + + echo_info 'iptables\n' + if [ "$(is_installed 'iptables')" = true ]; then + iptables --version + else + echo_danger 'iptables is not installed on your system\n' + fi + + echo_info 'make\n' + if [ "$(is_installed 'make')" = true ]; then + make --version | head -n1 + else + echo_danger 'make is not installed on your system\n' + fi + + echo_info 'mysql\n' + if [ "$(is_installed 'mysql')" = true ]; then + mysql --version + else + echo_danger 'mysql is not installed on your system\n' + fi + + echo_info 'nfs-common\n' + if [ "$(is_installed 'nfs-common')" = true ]; then + dpkg -la | grep 'nfs-common' + else + echo_danger 'nfs-common is not installed on your system\n' + fi + + echo_info 'nfs-kernel-server\n' + if [ "$(is_installed 'nfs-kernel-server')" = true ]; then + dpkg -la | grep 'nfs-kernel-server' + else + echo_danger 'nfs-kernel-server is not installed on your system\n' + fi + + echo_info 'netstat\n' + if [ "$(is_installed 'netstat')" = true ]; then + netstat --version | head -n1 + else + echo_danger 'netstat is not installed on your system\n' + fi + + echo_info 'nginx\n' + if [ "$(is_installed 'nginx')" = true ]; then + nginx --version + else + echo_danger 'nginx is not installed on your system\n' + fi + + echo_info 'node\n' + if [ "$(is_installed 'node')" = true ]; then + node --version + else + echo_danger 'node is not installed on your system\n' + fi + + echo_info 'npm\n' + if [ "$(is_installed 'npm')" = true ]; then + npm --version + else + echo_danger 'npm is not installed on your system\n' + fi + + echo_info 'perl\n' + if [ "$(is_installed 'perl')" = true ]; then + perl --version | head -n2 | tail -n1 + else + echo_danger 'perl is not installed on your system\n' + fi + + echo_info 'openssl\n' + if [ "$(is_installed 'openssl')" = true ]; then + openssl version + else + echo_danger 'openssl is not installed on your system\n' + fi + + echo_info 'php\n' + if [ "$(is_installed 'php')" = true ]; then + php --version + else + echo_danger 'php is not installed on your system\n' + fi + + echo_info 'php-modules\n' + if [ "$(is_installed 'php')" = true ]; then + php -m + else + echo_danger 'unable to show php-modules, php not installed\n' + fi + + echo_info 'pip\n' + if [ "$(is_installed 'pip')" = true ]; then + pip --version + else + echo_danger 'pip is not installed on your system\n' + fi + + echo_info 'pip3\n' + if [ "$(is_installed 'pip3')" = true ]; then + pip3 --version + else + echo_danger 'pip3 is not installed on your system\n' + fi + + echo_info 'psql\n' + if [ "$(is_installed 'psql')" = true ]; then + psql --version + else + echo_danger 'PostgreSQL is not installed on your system\n' + fi + + echo_info 'python\n' + if [ "$(is_installed 'python')" = true ]; then + python --version + else + echo_danger 'python is not installed on your system\n' + fi + + echo_info 'python3\n' + if [ "$(is_installed 'python3')" = true ]; then + python3 --version + else + echo_danger 'python3 is not installed on your system\n' + fi + + echo_info 'ruby\n' + if [ "$(is_installed 'ruby')" = true ]; then + ruby --version + else + echo_danger 'ruby is not installed on your system\n' + fi + + echo_info 'rvm\n' + if [ "$(is_installed 'rvm')" = true ]; then + rvm version + else + echo_danger 'rvm is not installed on your system\n' + fi + + echo_info 'shellcheck\n' + if [ "$(is_installed 'shellcheck')" = true ]; then + shellcheck --version | head -2 | tail -1 + else + echo_danger 'shellcheck is not installed on your system\n' + fi + + echo_info 'sqlite3\n' + if [ "$(is_installed 'sqlite3')" = true ]; then + sqlite3 --version + else + echo_danger 'sqlite3 is not installed on your system\n' + fi + + echo_info 'ufw\n' + if [ "$(is_installed 'ufw')" = true ]; then + ufw --version | head -n1 + else + echo_danger 'ufw is not installed on your system\n' + fi + + echo_info 'vagrant\n' + if [ "$(is_installed 'vagrant')" = true ]; then + vagrant --version + else + echo_danger 'vagrant is not installed on your system\n' + fi + + echo_info 'virtual box\n' + if [ "$(is_installed 'VBoxManage')" = true ]; then + VBoxManage --version + else + echo_danger 'virtual box is not installed on your system\n' + fi + + echo_info 'wget\n' + if [ "$(is_installed 'wget')" = true ]; then + wget --version | head -n1 + else + echo_danger 'wget is not installed on your system\n' + fi + + echo_info 'wine\n' + if [ "$(is_installed 'wine')" = true ]; then + wine --version + else + echo_danger 'wine is not installed on your system\n' + fi + + echo_info 'yarn\n' + if [ "$(is_installed 'yarn')" = true ]; then + yarn --version + else + echo_danger 'yarn is not installed on your system\n' + fi + + echo_info 'zsh\n' + if [ "$(is_installed 'zsh')" = true ]; then + zsh --version + else + echo_danger 'zsh is not installed on your system\n' + fi +} diff --git a/tools/src/system/compare_versions.sh b/tools/src/system/compare_versions.sh new file mode 100755 index 0000000..25f57d3 --- /dev/null +++ b/tools/src/system/compare_versions.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Compare two semantic versions +compare_versions() { + local INPUT + + for INPUT in "$1" "$2"; do + if [[ ! "${INPUT}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo -ne "\033[1;31merror:\t\033[0;31minvalid version (${INPUT})\033[0m\n" + return 1 + fi + done + + local VERSION_1=() + local VERSION_2=() + + # # split each version string with dot character (option 1, not zsh compliant) + # BKP=${IFS} + # IFS='.' + # read -r -a VERSION_1 <<< "$1" + # read -r -a VERSION_2 <<< "$2" + # IFS=${BKP} + + # # zsh handles arrays in a weird fashion (option 2, not bash compliant) + # VERSION_1=("${(@s/./)1}") + # VERSION_2=("${(@s/./)2}") + + # # split each version string with dot character (option 3, non working option) + # BKP="${IFS}" + # IFS="." + # while read -r ITEM; do VERSION_1+=("${ITEM}"); done < <(echo "$1") + # while read -r ITEM; do VERSION_2+=("${ITEM}"); done < <(echo "$2") + # IFS="${BKP}" + + # split each version string with dot character (option 4, short syntax but not shellcheck valid) + # shellcheck disable=2207 + VERSION_1=($(echo "$1" | tr '.' ' ')) + # shellcheck disable=2207 + VERSION_2=($(echo "$2" | tr '.' ' ')) + + # compare each number + for KEY in {0..2}; do + if [ "${VERSION_1[$KEY]}" -eq "${VERSION_2[$KEY]}" ]; then + continue + fi + if [ "${VERSION_1[$KEY]}" -gt "${VERSION_2[$KEY]}" ]; then + echo '>' + return 0 + elif [ "${VERSION_1[$KEY]}" -lt "${VERSION_2[$KEY]}" ]; then + echo '<' + return 0 + fi + done + + echo '=' + return 0 +} \ No newline at end of file diff --git a/tools/src/system/hosts.sh b/tools/src/system/hosts.sh new file mode 100755 index 0000000..6c91d14 --- /dev/null +++ b/tools/src/system/hosts.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * Tangoman Hosts +# * +# * Edit hosts config from shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## set your /etc/hosts +function set_hosts() { + local HOST_NAME + local IP_ADDRESS=127.0.0.1 + local DELETE=false + + local ARGUMENTS=() + local OPTARG + local OPTION + while [ "${#}" -gt 0 ]; do + OPTIND=0 + while getopts :i:dh OPTION; do + case "${OPTION}" in + d) DELETE=true;; + i) IP_ADDRESS="${OPTARG}";; + h) echo_warning 'set_hosts' + echo_label 'description'; echo_primary 'Create / delete hosts in /etc/hosts' + echo_label 'usage'; echo_primary 'set-hosts [hosts] -i (ip) -d (delete) -h (help)' + return 0;; + :) echo_error "\"${OPTARG}\" requires value" + return 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + return 1;; + esac + done + if [ "${OPTIND}" -gt 1 ]; then + shift $(( OPTIND-1 )) + fi + if [ "${OPTIND}" -eq 1 ]; then + ARGUMENTS+=("${1}") + shift + fi + done + + if [ "${#ARGUMENTS[@]}" -eq 0 ]; then + echo_error 'some mandatory parameter is missing' + echo_label 'usage'; echo_primary 'set-hosts [hosts] -i (ip) -d (delete) -h (help)' + return 1 + fi + + for HOST_NAME in "${ARGUMENTS[@]}"; do + + # find "hostname" + if < /etc/hosts grep -q -P "\s+${HOST_NAME}$";then + # remove every occurence + # shellcheck disable=SC2002 + cat /etc/hosts | grep -vP "\s+${HOST_NAME}$" | sudo tee /etc/hosts >/dev/null + + if [ "${DELETE}" = true ];then + echo_danger "Deleting host: \"${IP_ADDRESS} ${HOST_NAME}\"" + else + echo_warning "Updating host: \"${IP_ADDRESS} ${HOST_NAME}\"" + sudo /bin/sh -c "echo \"${IP_ADDRESS} ${HOST_NAME}\">> /etc/hosts" + fi + else + if [ "${DELETE}" = true ];then + echo_error "\"${HOST_NAME}\" not found" + else + echo_success "Creating host: \"${IP_ADDRESS} ${HOST_NAME}\"" + sudo /bin/sh -c "echo \"${IP_ADDRESS} ${HOST_NAME}\">> /etc/hosts" + fi + fi + done +} diff --git a/tools/src/system/is_installed.sh b/tools/src/system/is_installed.sh new file mode 100755 index 0000000..35755f2 --- /dev/null +++ b/tools/src/system/is_installed.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Check app installed +function is_installed() { + + if [ -x "$(command -v "$1")" ]; then + echo true + + return 0 + fi + + # maybe it's a debian package + if dpkg -s "$1" 2>/dev/null | grep -q 'Status: install ok installed'; then + echo true + + return 0 + fi + + # or maybe it's a linuxbrew package + if [ -x /home/linuxbrew/.linuxbrew/bin/"$1" ]; then + echo true + + return 0 + fi + + echo false +} diff --git a/tools/src/system/is_root.sh b/tools/src/system/is_root.sh new file mode 100644 index 0000000..3883ad0 --- /dev/null +++ b/tools/src/system/is_root.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Check user is root +is_root() { + if [ "$(id | awk '{print $1}')" = 'uid=0(root)' ];then + echo true + return 0 + fi + + echo false +} + diff --git a/tools/src/system/is_ubuntu.sh b/tools/src/system/is_ubuntu.sh new file mode 100755 index 0000000..dae8048 --- /dev/null +++ b/tools/src/system/is_ubuntu.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Check system is ubuntu +function is_ubuntu() { + local RELEASE + RELEASE="$(lsb_release -cs 2>/dev/null)" + + for CODENAME in edgy feisty gutsy hardy intrepid jaunty karmic lucid maverick natty oneiric precise quantal raring saucy trusty utopic vivid wily xenial yakkety zesty artful bionic cosmic disco eoan focal groovy hirsute impish jammy + do + if [ "${RELEASE}" = "${CODENAME}" ]; then + echo true + return 0 + fi + done + echo false +} diff --git a/tools/src/system/prompt_user.sh b/tools/src/system/prompt_user.sh new file mode 100755 index 0000000..056f4f9 --- /dev/null +++ b/tools/src/system/prompt_user.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Prompt user for parameter +function prompt_user() { + local ARGUMENTS=() + local PARAMETER + local BOOLEAN=false + local YES_NO=false + + local OPTARG + local OPTION + while [ "${#}" -gt 0 ]; do + OPTIND=0 + while getopts :d:byh OPTION; do + case "${OPTION}" in + d) DEFAULT_VALUE="${OPTARG}";; + b) BOOLEAN=true;; + y) YES_NO=true;; + h) echo_warning 'promt_user' + echo_label 'description:'; echo_primary 'Prompt user for parameter value' + echo_label 'usage'; echo_primary 'promt_user [parameter] -b (boolean) -y (yes no) -d [default_value] -h (help)' + return 0;; + :) echo_error "\"${OPTARG}\" requires value" + return 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + return 1;; + esac + done + if [ "${OPTIND}" -gt 1 ]; then + shift $(( OPTIND-1 )) + fi + if [ "${OPTIND}" -eq 1 ]; then + ARGUMENTS+=("${1}") + shift + fi + done + + if [ "${#ARGUMENTS[@]}" -eq 0 ]; then + echo_error 'some mandatory parameter is missing' + echo_label 'usage'; echo_primary 'promt_user [parameter] -b (boolean) -y (yes no) -d [default_value] -h (help)' + return 1 + fi + + if [ "${#ARGUMENTS[@]}" -gt 1 ]; then + echo_error "too many arguments (${#ARGUMENTS[@]})" + echo_label 'usage'; echo_primary 'promt_user [parameter] -d [default_value] -h (help)' + return 1 + fi + + PARAMETER="${ARGUMENTS[0]}" + + if [ "${BOOLEAN}" == true ]; then + if [ -n "${DEFAULT_VALUE}" ]; then + read -rp "${PARAMETER} (true/false) [${DEFAULT_VALUE}]: " NEW_VALUE + if [[ "${NEW_VALUE}" =~ ^[Tt][Rr]?[Uu]?[Ee]?$ ]]; then + echo true + elif [[ "${NEW_VALUE}" =~ ^[Ff][Aa]?[Ll]?[Ss]?[Ee]?$ ]]; then + echo false + else + echo "${DEFAULT_VALUE}" + fi + else + read -rp "${PARAMETER}: (true/false) [false]" NEW_VALUE + if [[ "${NEW_VALUE}" =~ ^[Tt][Rr]?[Uu]?[Ee]?$ ]]; then + echo true + else + echo false + fi + fi + return 0 + fi + + if [ "${YES_NO}" == true ]; then + if [ -n "${DEFAULT_VALUE}" ]; then + read -rp "${PARAMETER} (yes/no) [${DEFAULT_VALUE}]: " NEW_VALUE + if [[ "${NEW_VALUE}" =~ ^[Yy][Ee]?[Ss]?$ ]]; then + echo 'yes' + elif [[ "${NEW_VALUE}" =~ ^[Nn][Oo]?$ ]]; then + echo 'no' + else + echo "${DEFAULT_VALUE}" + fi + else + read -rp "${PARAMETER}: (yes/no) [no]" NEW_VALUE + if [[ "${NEW_VALUE}" =~ ^[Yy][Ee]?[Ss]?$ ]]; then + echo 'yes' + else + echo 'no' + fi + fi + return 0 + fi + + if [ -n "${DEFAULT_VALUE}" ]; then + read -rp "${PARAMETER} [${DEFAULT_VALUE}]: " NEW_VALUE + if [ -n "${NEW_VALUE}" ]; then + echo "${NEW_VALUE}" + else + echo "${DEFAULT_VALUE}" + fi + else + read -rp "${PARAMETER}: " NEW_VALUE + echo "${NEW_VALUE}" + fi +} diff --git a/tools/src/system/update_grub.sh b/tools/src/system/update_grub.sh new file mode 100755 index 0000000..43594ca --- /dev/null +++ b/tools/src/system/update_grub.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Bash Tools +# * +# * A set of tools for shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Updates GRUB on multiple patforms +function update_grub() { + # Update grub config + echo_primary 'Updating grub config...' + if [ -x "$(command -v update-grub)" ]; then + echo_info 'update-grub' + update-grub + + elif [ -x "$(command -v grub-mkconfig)" ]; then + echo_info 'grub-mkconfig -o /boot/grub/grub.cfg' + grub-mkconfig -o /boot/grub/grub.cfg + + elif [ -x "$(command -v grub2-mkconfig)" ]; then + if [ -x "$(command -v zypper)" ]; then + echo_info 'grub2-mkconfig -o /boot/grub2/grub.cfg' + grub2-mkconfig -o /boot/grub2/grub.cfg + + elif [ -x "$(command -v dnf)" ]; then + echo_info 'grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg' + grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg + fi + fi +} diff --git a/tools/src/yaml/get_parameter.sh b/tools/src/yaml/get_parameter.sh new file mode 100755 index 0000000..dbf16ad --- /dev/null +++ b/tools/src/yaml/get_parameter.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Yaml +# * +# * A light tool to roughly parse yaml files from shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Read parameter from .yaml file +get_parameter() { + local ARGUMENTS=() + local FILE_PATH + local PARAMETER + local SEPARATOR=':' + + local OPTARG + local OPTION + while [ "${#}" -gt 0 ]; do + OPTIND=0 + while getopts :f:s:h OPTION; do + case "${OPTION}" in + f) FILE_PATH="${OPTARG}";; + s) SEPARATOR="$(echo "${OPTARG}"|sed -E 's/^[[:space:]]*//'|sed -E 's/[[:space:]]*$//'|tr -d "\t")";; + h) echo_warning 'get_parameter' + echo_label 'description:'; echo_primary 'Return parameter value from given yml file' + echo_label 'usage'; echo_primary 'get_parameter [parameter] -f [file_path] -s [separator] -h (help)' + return 0;; + :) echo_error "\"${OPTARG}\" requires value" + return 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + return 1;; + esac + done + if [ "${OPTIND}" -gt 1 ]; then + shift $(( OPTIND-1 )) + fi + if [ "${OPTIND}" -eq 1 ]; then + ARGUMENTS+=("${1}") + shift + fi + done + + if [ "${#ARGUMENTS[@]}" -eq 0 ]; then + echo_error 'some mandatory parameter is missing' + echo_label 'usage'; echo_primary 'get_parameter [parameter] -f [file_path] -s [separator] -h (help)' + return 1 + fi + + if [ "${#ARGUMENTS[@]}" -gt 1 ]; then + echo_error "too many arguments (${#ARGUMENTS[@]})" + echo_label 'usage'; echo_primary 'get_parameter [parameter] -f [file_path] -s [separator] -h (help)' + return 1 + fi + + # check file exists + if [ ! -f "${FILE_PATH}" ]; then + echo_error "Could not find \"${FILE_PATH}\"" + return 1 + fi + + PARAMETER="${ARGUMENTS[0]}" + + # 1. `grep -v '#'`: ignore comments + # 2. `grep -m1`: return first match only + # 3. `sed`: remove parameter from match + # 4. trim leading and trailing whitespaces and remove all tabulations + # sed -E 's/^[[:space:]]*//' | sed -E 's/[[:space:]]*$//' | tr -d "\t" + < "${FILE_PATH}" grep -v '#' | grep -E -m1 "^\s*${PARAMETER}\s*${SEPARATOR}" | sed "s/${PARAMETER}${SEPARATOR}//g" | sed -E 's/^[[:space:]]*//' | sed -E 's/[[:space:]]*$//' | tr -d "\t" +} diff --git a/tools/src/yaml/set_parameter.sh b/tools/src/yaml/set_parameter.sh new file mode 100755 index 0000000..5f62650 --- /dev/null +++ b/tools/src/yaml/set_parameter.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * TangoMan Yaml +# * +# * A light tool to roughly parse yaml files from shell scripts +# * +# * @licence MIT +# * @author "Matthias Morin" +# */ + +## Set parameter to .yaml file +set_parameter() { + local ARGUMENTS=() + local FILE_PATH + local PARAMETER + local SEPARATOR=':' + local SPACE=' ' + local VALUE + + local OPTARG + local OPTION + while [ "${#}" -gt 0 ]; do + OPTIND=0 + while getopts :f:s:nh OPTION; do + case "${OPTION}" in + f) FILE_PATH="${OPTARG}";; + s) SEPARATOR="$(echo "${OPTARG}"|sed -E 's/^[[:space:]]*//'|sed -E 's/[[:space:]]*$//'|tr -d "\t")";; + n) SPACE='';; + h) echo_warning 'set_parameter' + echo_label 'description:'; echo_primary 'Return parameter value from given yml file' + echo_label 'usage'; echo_primary 'set_parameter [parameter] [value] -f [file_path] -s [separator] -n (no_space) -h (help)' + return 0;; + :) echo_error "\"${OPTARG}\" requires value" + return 1;; + \?) echo_error "invalid option \"${OPTARG}\"" + return 1;; + esac + done + if [ "${OPTIND}" -gt 1 ]; then + shift $(( OPTIND-1 )) + fi + if [ "${OPTIND}" -eq 1 ]; then + ARGUMENTS+=("${1}") + shift + fi + done + + if [ "${#ARGUMENTS[@]}" -eq 0 ]; then + echo_error 'some mandatory parameter is missing' + echo_label 'usage'; echo_primary 'set_parameter [parameter] [value] -f [file_path] -s [separator] -n (no_space) -h (help)' + return 1 + fi + + if [ "${#ARGUMENTS[@]}" -gt 2 ]; then + echo_error "too many arguments (${#ARGUMENTS[@]})" + echo_label 'usage'; echo_primary 'set_parameter [parameter] [value] -f [file_path] -s [separator] -n (no_space) -h (help)' + return 1 + fi + + if [ ! -f "${FILE_PATH}" ]; then + if [ ! -f "${FILE_PATH}.dist" ]; then + echo_error "file not found: ${FILE_PATH}" + return 1 + else + echo_info "cp \"${FILE_PATH}.dist\" \"${FILE_PATH}\"" + cp "${FILE_PATH}.dist" "${FILE_PATH}" + fi + fi + + PARAMETER="${ARGUMENTS[0]}" + + # shellcheck disable=SC2143 + if [ -z "$(< "${FILE_PATH}" grep -v "#" | grep "${PARAMETER}${SEPARATOR}")" ]; then + echo_error "invalid parameter \"${PARAMETER}${SEPARATOR}\"" + return 1 + fi + + # escape forward slashes if any + VALUE=$(echo "${ARGUMENTS[1]}" | sed "s/\//\\\\\//g") + REGEXP="${PARAMETER}${SEPARATOR}.+\$" + sed -i -E s/"${REGEXP}/${PARAMETER}${SEPARATOR}${SPACE}${VALUE}"/ "${FILE_PATH}" +} diff --git a/tools/tests/bash_unit b/tools/tests/bash_unit new file mode 100755 index 0000000..75b3b01 --- /dev/null +++ b/tools/tests/bash_unit @@ -0,0 +1,445 @@ +#!/usr/bin/env bash +# +# bash unit testing enterprise edition framework for professionals +# Copyright (C) 2011-2016 Pascal Grange +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# https://github.com/pgrange/bash_unit + +VERSION=v1.7.1 + +ESCAPE=$(printf "\033") +NOCOLOR="${ESCAPE}[0m" +RED="${ESCAPE}[91m" +GREEN="${ESCAPE}[92m" +YELLOW="${ESCAPE}[93m" +BLUE="${ESCAPE}[94m" + +# Make bash_unit immune to some basic unix commands faking +CAT="$(command -v cat)" +SED="$(command -v sed)" +GREP="$(command -v grep)" +RM="$(command -v rm)" + +fail() { + local message + local stdout + local stderr + + message=${1:-} + stdout=${2:-} + stderr=${3:-} + + # shellcheck disable=SC2154 + notify_test_failed "$__bash_unit_current_test__" "$message" + [[ -n $stdout ]] && [ -s "$stdout" ] && notify_stdout < "$stdout" + [[ -n $stderr ]] && [ -s "$stderr" ] && notify_stderr < "$stderr" + + stacktrace | notify_stack + exit 1 +} + +assert() { + local assertion + local message + + assertion=$1 + message=${2:-} + + _assert_expression \ + "$assertion" \ + "[ \$status == 0 ]" \ + "\"$message\"" +} + +assert_fails() { + local assertion + local message + + assertion=$1 + message=${2:-} + + _assert_expression \ + "$assertion" \ + "[ \$status != 0 ]" \ + "\"$message\"" +} + +assert_fail() { + #deprecated, use assert_fails instead + assert_fails "$@" +} + +assert_status_code() { + local expected_status + local assertion + local message + + expected_status=$1 + assertion="$2" + message="${3:-}" + + _assert_expression \ + "$assertion" \ + "[ \$status == $expected_status ]" \ + "\"$message\" expected status code $expected_status but was \$status" +} + +_assert_expression() { + local assertion + local condition + local message + + assertion=$1 + condition=$2 + message=$3 + + ( + local stdout + local stderr + + stdout=$(mktemp) + stderr=$(mktemp) + + trap '$RM -f \"$stdout\" \"$stderr\"' EXIT + + local status + + eval "($assertion)" >"$stdout" 2>"$stderr" && status=$? || status=$? + if ! eval "$condition" + then + fail "$(eval echo "$message")" "$stdout" "$stderr" + fi + ) || exit $? +} + +assert_equals() { + local expected + local actual + local message + + expected=$1 + actual=$2 + message=${3:-} + + [[ -z $message ]] || message="$message\n" + + if [ "$expected" != "$actual" ] + then + fail "$message expected [$expected] but was [$actual]" + fi +} + +assert_not_equals() { + local unexpected + local actual + local message + + unexpected=$1 + actual=$2 + message=${3:-} + + [[ -z $message ]] || message="$message\n" + + [ "$unexpected" != "$actual" ] || \ + fail "$message expected different value than [$unexpected] but was the same" +} + +fake() { + local command + + command=$1 + + shift + if [ $# -gt 0 ] + then + eval "function $command() { export FAKE_PARAMS=\"\$@\" ; $* ; }" + else + eval "function $command() { echo \"$($CAT)\" ; }" + fi + export -f "${command?}" +} + +stacktrace() { + local i + + i=1 + + # shellcheck disable=SC2128 + while [ -n "${BASH_SOURCE[$i]:-}" ] + do + echo "${BASH_SOURCE[$i]}":${BASH_LINENO[$((i-1))]}:"${FUNCNAME[$i]}"\(\) + i=$((i + 1)) + done | "$GREP" -v "^$BASH_SOURCE" +} + +run_test_suite() { + local failure + + failure=0 + + declare -F | "$GREP" ' setup_suite$' >/dev/null && setup_suite + + for pending_test in $(set | "$GREP" -E '^(pending|todo).* \(\)' | "$GREP" -E "$test_pattern" | "$SED" -e 's: .*::') + do + notify_test_starting "$pending_test" + notify_test_pending "$pending_test" + done + + for test in $(set | "$GREP" -E '^test.* \(\)' | "$GREP" -E "$test_pattern" | "$SED" -e 's: .*::') + do + ( + local status + status=0 + declare -F | "$GREP" ' setup$' >/dev/null && setup + (__bash_unit_current_test__="$test" run_test) || status=$? + declare -F | "$GREP" ' teardown$' >/dev/null && teardown + exit $status + ) + failure=$(( $? || failure)) + done + + declare -F | "$GREP" ' teardown_suite$' >/dev/null && teardown_suite + + return $failure +} + +run_test() { + set -e + notify_test_starting "$__bash_unit_current_test__" + "$__bash_unit_current_test__" && notify_test_succeeded "$__bash_unit_current_test__" +} + +usage() { + echo "$1" >&2 + echo "$0 [-f ] [-p ] [-p ]... ..." >&2 + echo >&2 + echo "Runs tests in test files that match s" >&2 + echo " is optional only supported value is tap" >&2 + echo "-v to get current version information" >&2 + echo "See https://github.com/pgrange/bash_unit" >&2 + exit 1 +} + +# Formating + +pretty_success() { + pretty_format "$GREEN" "\u2713" "${1:-}" +} + +pretty_warning() { + pretty_format "$YELLOW" "\u2717" "$1" +} + +pretty_failure() { + pretty_format "$RED" "\u2717" "${1:-}" +} + +pretty_format() { + local color + local pretty_symbol + local alt_symbol + local term_utf8 + + color="$1" + pretty_symbol="$2" + alt_symbol="$3" + term_utf8=false + + if is_terminal && [[ "$LANG" =~ .*UTF-8.* ]] + then + term_utf8=true + fi + ( + $CAT + if $term_utf8 + then + echo -en " $pretty_symbol " + else + [[ -n "$alt_symbol" ]] && echo -en " $alt_symbol " + fi + ) | color "$color" +} + +color() { + _start_color() { + if is_terminal ; then echo -en "$color" ; fi + } + _stop_color() { + if is_terminal ; then echo -en "$NOCOLOR" ; fi + } + local color + + color=$1 + + shift + _start_color + if [ $# -gt 0 ] + then + echo "$@" + else + $CAT + fi + _stop_color +} + +is_terminal() { + [ -t 1 ] || [[ "${FORCE_COLOR}" == true ]] +} + +text_format() { + notify_suite_starting() { + local test_file + test_file="$1" + echo "Running tests in $test_file" + } + notify_test_starting() { + local test + test="$1" + echo -n "Running $test... " | color "$BLUE" + } + notify_test_pending() { + echo -n "PENDING" | pretty_warning + echo + } + + notify_test_succeeded() { + echo -n "SUCCESS" | pretty_success + echo + } + notify_test_failed() { + local message + message="$2" + echo -n "FAILURE" | pretty_failure + echo + [[ -z $message ]] || printf "%s\n" "$message" + } + notify_stdout() { + "$SED" 's:^:out> :' | color "$GREEN" + } + notify_stderr() { + "$SED" 's:^:err> :' | color "$RED" + } + notify_stack() { + color "$YELLOW" + } +} + +tap_format() { + notify_suite_starting() { + local test_file + test_file="$1" + echo "# Running tests in $test_file" + } + notify_test_starting() { + echo -n + } + notify_test_pending() { + local test + test="$1" + echo -n "ok" | pretty_warning - + echo -n "$test" | color "$BLUE" + echo " # skip test to be written" | color "$YELLOW" + } + notify_test_succeeded() { + local test + test="$1" + echo -n "ok" | pretty_success - + echo "$test" | color "$BLUE" + } + notify_test_failed() { + local test + local message + test="$1" + message="$2" + echo -n "not ok" | pretty_failure - + echo "$test" | color "$BLUE" + [[ -z $message ]] || printf "%s\n" "$(echo "$message" | "$SED" -u -e 's/^/# /')" + } + notify_stdout() { + "$SED" 's:^:# out> :' | color "$GREEN" + } + notify_stderr() { + "$SED" 's:^:# err> :' | color "$RED" + } + notify_stack() { + "$SED" 's:^:# :' | color "$YELLOW" + } +} + +output_format=text +test_pattern="" +separator="" +while getopts "vp:f:" option +do + case "$option" in + p) + test_pattern="${test_pattern}${separator}${OPTARG}" + separator="|" + ;; + f) + output_format="${OPTARG}" + ;; + v) + echo "bash_unit $VERSION" + exit + ;; + ?) + usage + ;; + esac +done +shift $((OPTIND-1)) + +for test_file in "$@" +do + test -e "$test_file" || usage "file does not exist: $test_file" + test -r "$test_file" || usage "can not read file: $test_file" +done + +case "$output_format" in + text) + text_format + ;; + tap) + tap_format + ;; + *) + usage "unsupproted output format: $output_format" + ;; +esac + +#run tests received as parameters +failure=0 +for test_file in "$@" +do + notify_suite_starting "$test_file" + ( + set -e # Ensure bash_unit with exit with failure + # in case of syntax error. + if [[ "${STICK_TO_CWD}" != true ]] + then + cd "$(dirname "$test_file")" + # shellcheck source=/dev/null + source "$(basename "$test_file")" + else + # shellcheck source=/dev/null + source "$test_file" + fi + set +e + run_test_suite + ) + failure=$(( $? || failure)) +done + +exit $failure diff --git a/tools/tests/fixtures/fixture.yaml b/tools/tests/fixtures/fixture.yaml new file mode 100644 index 0000000..a20eeb1 --- /dev/null +++ b/tools/tests/fixtures/fixture.yaml @@ -0,0 +1,4 @@ +# comment +foobar: + foo: bar + bar: baz diff --git a/tools/tests/test_check_install.sh b/tools/tests/test_check_install.sh new file mode 100644 index 0000000..50ec09a --- /dev/null +++ b/tools/tests/test_check_install.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/system/check_install.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_check_install_returns_expected_result() { + assert_status_code 127 "$(check_install)" +} diff --git a/tools/tests/test_check_root.sh b/tools/tests/test_check_root.sh new file mode 100644 index 0000000..fb52dbc --- /dev/null +++ b/tools/tests/test_check_root.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/system/check_root.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} diff --git a/tools/tests/test_check_versions.sh b/tools/tests/test_check_versions.sh new file mode 100644 index 0000000..610eabe --- /dev/null +++ b/tools/tests/test_check_versions.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/system/check_versions.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +# test_check_versions_returns_expected_result() { +# assert_status_code 127 "$(check_versions)" +# } diff --git a/tools/tests/test_colors.sh b/tools/tests/test_colors.sh new file mode 100644 index 0000000..e5503cb --- /dev/null +++ b/tools/tests/test_colors.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[1;104;97m%64s\033[0m\n\033[1;104;97m %-63s\033[0m\n\033[1;104;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[1;45;97m%64s\033[0m\n\033[1;45;97m %-63s\033[0m\n\033[1;45;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[1;42;97m%64s\033[0m\n\033[1;42;97m %-63s\033[0m\n\033[1;42;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[1;41;97m%64s\033[0m\n\033[1;41;97m %-63s\033[0m\n\033[1;41;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[1;43;97m%64s\033[0m\n\033[1;43;97m %-63s\033[0m\n\033[1;43;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[1;44;97m%64s\033[0m\n\033[1;44;97m %-63s\033[0m\n\033[1;44;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[1;47;90m%64s\033[0m\n\033[1;47;90m %-63s\033[0m\n\033[1;47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[1;40;37m%64s\033[0m\n\033[1;40;37m %-63s\033[0m\n\033[1;40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_a.sh b/tools/tests/test_colors_a.sh new file mode 100644 index 0000000..496b788 --- /dev/null +++ b/tools/tests/test_colors_a.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_a.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[1;104;97m%64s\033[0m\n\033[1;104;97m %-63s\033[0m\n\033[1;104;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[1;45;97m%64s\033[0m\n\033[1;45;97m %-63s\033[0m\n\033[1;45;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[1;42;97m%64s\033[0m\n\033[1;42;97m %-63s\033[0m\n\033[1;42;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[1;41;97m%64s\033[0m\n\033[1;41;97m %-63s\033[0m\n\033[1;41;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[1;43;97m%64s\033[0m\n\033[1;43;97m %-63s\033[0m\n\033[1;43;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[1;44;97m%64s\033[0m\n\033[1;44;97m %-63s\033[0m\n\033[1;44;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[1;47;90m%64s\033[0m\n\033[1;47;90m %-63s\033[0m\n\033[1;47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[1;40;37m%64s\033[0m\n\033[1;40;37m %-63s\033[0m\n\033[1;40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_b.sh b/tools/tests/test_colors_b.sh new file mode 100644 index 0000000..ea1addc --- /dev/null +++ b/tools/tests/test_colors_b.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_b.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[1;104;97m%64s\033[0m\n\033[1;104;97m %-63s\033[0m\n\033[1;104;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[1;45;97m%64s\033[0m\n\033[1;45;97m %-63s\033[0m\n\033[1;45;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[1;42;97m%64s\033[0m\n\033[1;42;97m %-63s\033[0m\n\033[1;42;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[1;41;97m%64s\033[0m\n\033[1;41;97m %-63s\033[0m\n\033[1;41;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[1;43;97m%64s\033[0m\n\033[1;43;97m %-63s\033[0m\n\033[1;43;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[1;44;97m%64s\033[0m\n\033[1;44;97m %-63s\033[0m\n\033[1;44;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[1;47;90m%64s\033[0m\n\033[1;47;90m %-63s\033[0m\n\033[1;47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[1;40;37m%64s\033[0m\n\033[1;40;37m %-63s\033[0m\n\033[1;40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_c.sh b/tools/tests/test_colors_c.sh new file mode 100644 index 0000000..b553606 --- /dev/null +++ b/tools/tests/test_colors_c.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_c.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[1;104;97m%64s\033[0m\n\033[1;104;97m %-63s\033[0m\n\033[1;104;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[1;45;97m%64s\033[0m\n\033[1;45;97m %-63s\033[0m\n\033[1;45;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[1;42;97m%64s\033[0m\n\033[1;42;97m %-63s\033[0m\n\033[1;42;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[1;41;97m%64s\033[0m\n\033[1;41;97m %-63s\033[0m\n\033[1;41;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[1;43;97m%64s\033[0m\n\033[1;43;97m %-63s\033[0m\n\033[1;43;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[1;44;97m%64s\033[0m\n\033[1;44;97m %-63s\033[0m\n\033[1;44;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[1;47;90m%64s\033[0m\n\033[1;47;90m %-63s\033[0m\n\033[1;47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[1;40;37m%64s\033[0m\n\033[1;40;37m %-63s\033[0m\n\033[1;40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_d.sh b/tools/tests/test_colors_d.sh new file mode 100644 index 0000000..edcc571 --- /dev/null +++ b/tools/tests/test_colors_d.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_d.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[1;104;97m%64s\033[0m\n\033[1;104;97m %-63s\033[0m\n\033[1;104;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[1;45;97m%64s\033[0m\n\033[1;45;97m %-63s\033[0m\n\033[1;45;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[1;42;97m%64s\033[0m\n\033[1;42;97m %-63s\033[0m\n\033[1;42;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[1;41;97m%64s\033[0m\n\033[1;41;97m %-63s\033[0m\n\033[1;41;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[1;43;97m%64s\033[0m\n\033[1;43;97m %-63s\033[0m\n\033[1;43;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[1;44;97m%64s\033[0m\n\033[1;44;97m %-63s\033[0m\n\033[1;44;97m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[1;47;90m%64s\033[0m\n\033[1;47;90m %-63s\033[0m\n\033[1;47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[1;40;37m%64s\033[0m\n\033[1;40;37m %-63s\033[0m\n\033[1;40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_sf.sh b/tools/tests/test_colors_sf.sh new file mode 100644 index 0000000..c0da13d --- /dev/null +++ b/tools/tests/test_colors_sf.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_sf.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[104;37m%64s\033[0m\n\033[104;37m %-63s\033[0m\n\033[104;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[45;37m%64s\033[0m\n\033[45;37m %-63s\033[0m\n\033[45;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[42;30m%64s\033[0m\n\033[42;30m %-63s\033[0m\n\033[42;30m%64s\033[0m\n\n" '' "[OK] foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\n" '!' "! [ERROR] foobar" '!';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[43;30m%64s\033[0m\n\033[43;30m %-63s\033[0m\n\033[43;30m%64s\033[0m\n\n" '' "[WARNING] foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[44;37m%64s\033[0m\n\033[44;37m %-63s\033[0m\n\033[44;37m%64s\033[0m\n\n" '' "[INFO] foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[47;90m%64s\033[0m\n\033[47;90m %-63s\033[0m\n\033[47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[40;37m%64s\033[0m\n\033[40;37m %-63s\033[0m\n\033[40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_sfa.sh b/tools/tests/test_colors_sfa.sh new file mode 100644 index 0000000..61c268e --- /dev/null +++ b/tools/tests/test_colors_sfa.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_sfa.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[104;37m%64s\033[0m\n\033[104;37m %-63s\033[0m\n\033[104;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[45;37m%64s\033[0m\n\033[45;37m %-63s\033[0m\n\033[45;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[42;30m%64s\033[0m\n\033[42;30m %-63s\033[0m\n\033[42;30m%64s\033[0m\n\n" '' "[OK] foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\n" '!' "! [ERROR] foobar" '!';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[43;30m%64s\033[0m\n\033[43;30m %-63s\033[0m\n\033[43;30m%64s\033[0m\n\n" '' "[WARNING] foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[44;37m%64s\033[0m\n\033[44;37m %-63s\033[0m\n\033[44;37m%64s\033[0m\n\n" '' "[INFO] foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[47;90m%64s\033[0m\n\033[47;90m %-63s\033[0m\n\033[47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[40;37m%64s\033[0m\n\033[40;37m %-63s\033[0m\n\033[40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_sfb.sh b/tools/tests/test_colors_sfb.sh new file mode 100644 index 0000000..f5af5a9 --- /dev/null +++ b/tools/tests/test_colors_sfb.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_sfb.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[104;37m%64s\033[0m\n\033[104;37m %-63s\033[0m\n\033[104;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[45;37m%64s\033[0m\n\033[45;37m %-63s\033[0m\n\033[45;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[42;30m%64s\033[0m\n\033[42;30m %-63s\033[0m\n\033[42;30m%64s\033[0m\n\n" '' "[OK] foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\n" '!' "! [ERROR] foobar" '!';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[43;30m%64s\033[0m\n\033[43;30m %-63s\033[0m\n\033[43;30m%64s\033[0m\n\n" '' "[WARNING] foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[44;37m%64s\033[0m\n\033[44;37m %-63s\033[0m\n\033[44;37m%64s\033[0m\n\n" '' "[INFO] foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[47;90m%64s\033[0m\n\033[47;90m %-63s\033[0m\n\033[47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[40;37m%64s\033[0m\n\033[40;37m %-63s\033[0m\n\033[40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_sfc.sh b/tools/tests/test_colors_sfc.sh new file mode 100644 index 0000000..9b35302 --- /dev/null +++ b/tools/tests/test_colors_sfc.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_sfc.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[104;37m%64s\033[0m\n\033[104;37m %-63s\033[0m\n\033[104;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[45;37m%64s\033[0m\n\033[45;37m %-63s\033[0m\n\033[45;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[42;30m%64s\033[0m\n\033[42;30m %-63s\033[0m\n\033[42;30m%64s\033[0m\n\n" '' "[OK] foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\n" '!' "! [ERROR] foobar" '!';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[43;30m%64s\033[0m\n\033[43;30m %-63s\033[0m\n\033[43;30m%64s\033[0m\n\n" '' "[WARNING] foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[44;37m%64s\033[0m\n\033[44;37m %-63s\033[0m\n\033[44;37m%64s\033[0m\n\n" '' "[INFO] foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[47;90m%64s\033[0m\n\033[47;90m %-63s\033[0m\n\033[47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[40;37m%64s\033[0m\n\033[40;37m %-63s\033[0m\n\033[40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_colors_sfd.sh b/tools/tests/test_colors_sfd.sh new file mode 100644 index 0000000..b79eeef --- /dev/null +++ b/tools/tests/test_colors_sfd.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/colors/colors_sfd.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_echo_primary_should_return_expected_string() { + assert_status_code 127 "$(echo_primary foobar)" + assert_equals "$(printf '\033[97m%b\033[0m' foobar)" "$(echo_primary foobar)" +} + +test_echo_secondary_should_return_expected_string() { + assert_status_code 127 "$(echo_secondary foobar)" + assert_equals "$(printf '\033[94m%b\033[0m' foobar)" "$(echo_secondary foobar)" +} + +test_echo_success_should_return_expected_string() { + assert_status_code 127 "$(echo_success foobar)" + assert_equals "$(printf '\033[32m%b\033[0m' foobar)" "$(echo_success foobar)" +} + +test_echo_danger_should_return_expected_string() { + assert_status_code 127 "$(echo_danger foobar)" + assert_equals "$(printf '\033[31m%b\033[0m' foobar)" "$(echo_danger foobar)" +} + +test_echo_warning_should_return_expected_string() { + assert_status_code 127 "$(echo_warning foobar)" + assert_equals "$(printf '\033[33m%b\033[0m' foobar)" "$(echo_warning foobar)" +} + +test_echo_info_should_return_expected_string() { + assert_status_code 127 "$(echo_info foobar)" + assert_equals "$(printf '\033[95m%b\033[0m' foobar)" "$(echo_info foobar)" +} + +test_echo_light_should_return_expected_string() { + assert_status_code 127 "$(echo_light foobar)" + assert_equals "$(printf '\033[47;90m%b\033[0m' foobar)" "$(echo_light foobar)" +} + +test_echo_dark_should_return_expected_string() { + assert_status_code 127 "$(echo_dark foobar)" + assert_equals "$(printf '\033[40;37m%b\033[0m' foobar)" "$(echo_dark foobar)" +} + +test_echo_label_should_return_expected_string() { + assert_status_code 127 "$(echo_label 10 foobar)" + assert_equals "$(printf '\033[32m%-10s \033[0m' foobar)" "$(echo_label 10 foobar)" +} + +test_echo_label_without_padding_should_return_expected_string() { + assert_status_code 127 "$(echo_label foobar)" + assert_equals "$(printf '\033[32m%b \033[0m' foobar)" "$(echo_label foobar)" +} + +test_echo_error_should_return_expected_string() { + assert_status_code 127 "$(echo_error foobar)" + assert_equals "$(printf '\033[31merror: %b\033[0m' foobar)" "$(echo_error foobar)" +} + +test_alert_primary_should_return_expected_string() { + assert_status_code 127 "$(alert_primary)" + assert_equals "$(printf "\033[0m\n\033[104;37m%64s\033[0m\n\033[104;37m %-63s\033[0m\n\033[104;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_primary foobar)" +} + +test_alert_secondary_should_return_expected_string() { + assert_status_code 127 "$(alert_secondary)" + assert_equals "$(printf "\033[0m\n\033[45;37m%64s\033[0m\n\033[45;37m %-63s\033[0m\n\033[45;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_secondary foobar)" +} + +test_alert_success_should_return_expected_string() { + assert_status_code 127 "$(alert_success)" + assert_equals "$(printf "\033[0m\n\033[42;30m%64s\033[0m\n\033[42;30m %-63s\033[0m\n\033[42;30m%64s\033[0m\n\n" '' "[OK] foobar" '';)" "$(alert_success foobar)" +} + +test_alert_danger_should_return_expected_string() { + assert_status_code 127 "$(alert_danger)" + assert_equals "$(printf "\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\033[41;37m %-63s\033[0m\n\n" '!' "! [ERROR] foobar" '!';)" "$(alert_danger foobar)" +} + +test_alert_warning_should_return_expected_string() { + assert_status_code 127 "$(alert_warning)" + assert_equals "$(printf "\033[0m\n\033[43;30m%64s\033[0m\n\033[43;30m %-63s\033[0m\n\033[43;30m%64s\033[0m\n\n" '' "[WARNING] foobar" '';)" "$(alert_warning foobar)" +} + +test_alert_info_should_return_expected_string() { + assert_status_code 127 "$(alert_info)" + assert_equals "$(printf "\033[0m\n\033[44;37m%64s\033[0m\n\033[44;37m %-63s\033[0m\n\033[44;37m%64s\033[0m\n\n" '' "[INFO] foobar" '';)" "$(alert_info foobar)" +} + +test_alert_light_should_return_expected_string() { + assert_status_code 127 "$(alert_light)" + assert_equals "$(printf "\033[0m\n\033[47;90m%64s\033[0m\n\033[47;90m %-63s\033[0m\n\033[47;90m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_light foobar)" +} + +test_alert_dark_should_return_expected_string() { + assert_status_code 127 "$(alert_dark)" + assert_equals "$(printf "\033[0m\n\033[40;37m%64s\033[0m\n\033[40;37m %-63s\033[0m\n\033[40;37m%64s\033[0m\n\n" '' "foobar" '';)" "$(alert_dark foobar)" +} diff --git a/tools/tests/test_compare_versions.sh b/tools/tests/test_compare_versions.sh new file mode 100644 index 0000000..4bc1f44 --- /dev/null +++ b/tools/tests/test_compare_versions.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +parent_directory="$(dirname "$(pwd)")" +src_file="../src/system/compare_versions.sh" + +# shellcheck source=/dev/null +. "${src_file}" +# shellcheck source=/dev/null +. "${parent_directory}/src/colors/colors.sh" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_missing_arguments_should_return_expected_error() { + assert_fails "$(compare_versions)" +} + +test_empty_arguments_should_return_expected_error() { + assert_fails "$(compare_versions '' '')" +} + +test_invalid_argument_should_return_expected_error() { + assert_fails "$(compare_versions foobar 1.0.0)" +} + +test_invalid_second_argument_should_return_expected_error() { + assert_fails "$(compare_versions 1.0.0 foobar)" +} + +test_missing_second_argument_should_return_expected_error() { + assert_fails "$(compare_versions 0.1.0)" +} + +test_empty_second_argument_should_return_expected_error() { + assert_fails "$(compare_versions 0.1.0 '')" +} + +test_compare_versions_should_return_equal() { + assert_equals '=' "$(compare_versions 0.1.0 0.1.0)" +} + +test_check_major_version_should_return_lower_than() { + assert_equals '<' "$(compare_versions 1.0.0 2.0.0)" +} + +test_check_major_version_should_return_greater_than() { + assert_equals '>' "$(compare_versions 2.0.0 1.0.0)" +} + +test_check_minor_version_should_return_lower_than() { + # shellcheck disable=SC2317 + assert_equals '<' "$(compare_versions 2.0.0 2.1.0)" +} + +test_check_minor_version_should_return_greater_than() { + # shellcheck disable=SC2317 + assert_equals '>' "$(compare_versions 2.1.0 2.0.0)" +} + +test_check_minor_version_should_return_greater_than_alt() { + # shellcheck disable=SC2317 + assert_equals '>' "$(compare_versions 2.1.0 2.0.1)" +} + +test_check_minor_version_should_return_lower_than() { + assert_equals '<' "$(compare_versions 2.0.0 2.1.0)" +} + +test_check_minor_version_should_return_lower_than_alt() { + assert_equals '<' "$(compare_versions 2.0.1 2.1.0)" +} + +test_check_minor_version_should_return_greater_than() { + assert_equals '>' "$(compare_versions 2.1.0 2.0.0)" +} + +test_check_minor_version_should_return_greater_than_alt() { + assert_equals '>' "$(compare_versions 2.1.0 2.0.1)" +} + +test_check_patch_version_should_return_lower_than() { + assert_equals '<' "$(compare_versions 2.0.0 2.1.0)" +} + +test_check_patch_version_should_return_lower_than_alt() { + assert_equals '<' "$(compare_versions 2.0.1 2.1.0)" +} + +test_check_patch_version_should_return_greater_than() { + assert_equals '>' "$(compare_versions 2.1.0 2.0.0)" +} + +test_check_patch_version_should_return_greater_than_alt() { + assert_equals '>' "$(compare_versions 2.1.0 2.0.1)" +} + diff --git a/tools/tests/test_get_latest_release.sh b/tools/tests/test_get_latest_release.sh new file mode 100644 index 0000000..62c653a --- /dev/null +++ b/tools/tests/test_get_latest_release.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +parent_directory="$(dirname "$(pwd)")" +src_file="../src/git/get_latest_release.sh" + +# shellcheck source=/dev/null +. "${src_file}" +# shellcheck source=/dev/null +. "${parent_directory}/src/colors/colors.sh" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_get_latest_release_missing_arguments_should_return_expected_error() { + assert_fails "$(get_latest_release)" +} diff --git a/tools/tests/test_get_latest_tag.sh b/tools/tests/test_get_latest_tag.sh new file mode 100644 index 0000000..8940292 --- /dev/null +++ b/tools/tests/test_get_latest_tag.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +parent_directory="$(dirname "$(pwd)")" +src_file="../src/git/get_latest_tag.sh" + +# shellcheck source=/dev/null +. "${src_file}" +# shellcheck source=/dev/null +. "${parent_directory}/src/colors/colors.sh" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_get_latest_tag_missing_arguments_should_return_expected_error() { + assert_fails "$(get_latest_tag)" +} diff --git a/tools/tests/test_get_parameter.sh b/tools/tests/test_get_parameter.sh new file mode 100644 index 0000000..173c996 --- /dev/null +++ b/tools/tests/test_get_parameter.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +fixtures_directory="$(pwd)/fixtures" +parent_directory="$(dirname "$(pwd)")" +src_file="../src/yaml/get_parameter.sh" + +# shellcheck source=/dev/null +. "${src_file}" +# shellcheck source=/dev/null +. "${parent_directory}/src/colors/colors.sh" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_get_parameter_should_return_expected_result() { + assert_equals 'bar' "$(get_parameter foo -f "${fixtures_directory}/fixture.yaml")" +} diff --git a/tools/tests/test_hosts.sh b/tools/tests/test_hosts.sh new file mode 100644 index 0000000..35ee839 --- /dev/null +++ b/tools/tests/test_hosts.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/system/hosts.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + diff --git a/tools/tests/test_is_installed.sh b/tools/tests/test_is_installed.sh new file mode 100644 index 0000000..0df372b --- /dev/null +++ b/tools/tests/test_is_installed.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/system/is_installed.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_is_installed_should_return_false() { + assert_equals false "$(is_installed foobar)" +} diff --git a/tools/tests/test_is_ubuntu.sh b/tools/tests/test_is_ubuntu.sh new file mode 100644 index 0000000..f3289fa --- /dev/null +++ b/tools/tests/test_is_ubuntu.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/system/is_ubuntu.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + diff --git a/tools/tests/test_prompt_user.sh b/tools/tests/test_prompt_user.sh new file mode 100644 index 0000000..6fae5d2 --- /dev/null +++ b/tools/tests/test_prompt_user.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/system/prompt_user.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + diff --git a/tools/tests/test_set_parameter.sh b/tools/tests/test_set_parameter.sh new file mode 100644 index 0000000..a2c8e6e --- /dev/null +++ b/tools/tests/test_set_parameter.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +fixtures_directory="$(pwd)/fixtures" +parent_directory="$(dirname "$(pwd)")" +src_file="../src/yaml/set_parameter.sh" +# shellcheck source=/dev/null +. "${src_file}" + +# shellcheck source=/dev/null +. "${parent_directory}/src/yaml/get_parameter.sh" +# shellcheck source=/dev/null +. "${parent_directory}/src/colors/colors.sh" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} + +test_set_parameter_should_return_expected_error() { + assert_fails "$(set_parameter baz tango -f "${fixtures_directory}/fixture.yaml")" +} + +test_set_parameter_should_return_expected_result() { + set_parameter bar tango -f "${fixtures_directory}/fixture.yaml" + assert_equals 'tango' "$(get_parameter bar -f "${fixtures_directory}/fixture.yaml")" + + set_parameter bar baz -f "${fixtures_directory}/fixture.yaml" + assert_equals 'baz' "$(get_parameter bar -f "${fixtures_directory}/fixture.yaml")" +} diff --git a/tools/tests/test_update_grub.sh b/tools/tests/test_update_grub.sh new file mode 100644 index 0000000..5d35aac --- /dev/null +++ b/tools/tests/test_update_grub.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Bash Tools package. +# * +# * Copyright (c) 2023 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +# https://github.com/pgrange/bash_unit +# +# assert "test -e /tmp/the_file" +# assert_fails "grep this /tmp/the_file" "should not write 'this' in /tmp/the_file" +# assert_status_code 25 code +# assert_equals "a string" "another string" "a string should be another string" +# assert_not_equals "a string" "a string" "a string should be different from another string" +# fake ps echo hello world + +src_file="../src/system/update_grub.sh" + +# shellcheck source=/dev/null +. "${src_file}" + +test_script_execution_should_return_expected_status_code() { + assert_status_code 0 "${src_file}" +} diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..515aa5c --- /dev/null +++ b/update.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * update repositories +# * +# * /etc/apt/sources.list +# * /etc/apt/sources.list.d +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") + +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh + +alert_secondary 'Update' + +# update repositories +echo_info 'sudo apt-get update' +sudo apt-get update diff --git a/update_drivers.sh b/update_drivers.sh new file mode 100755 index 0000000..318a9ea --- /dev/null +++ b/update_drivers.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * update repositories +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") + +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh + +alert_secondary 'Update drivers' + +echo_info 'sudo ubuntu-drivers autoinstall' +sudo ubuntu-drivers autoinstall diff --git a/update_snaps.sh b/update_snaps.sh new file mode 100755 index 0000000..aa076db --- /dev/null +++ b/update_snaps.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * update repositories +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") + +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh + +alert_secondary 'Update snaps' + +# close all running apps +echo_info 'sudo killall snap-store' +sudo killall snap-store + +# update snaps +echo_info 'sudo snap refresh' +sudo snap refresh diff --git a/upgrade.sh b/upgrade.sh new file mode 100755 index 0000000..0463bf5 --- /dev/null +++ b/upgrade.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * upgrade & dist-upgrade +# * +# * @license MIT +# * @author "Matthias Morin" +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") + +# shellcheck source=/dev/null +. "${CURDIR}"/tools/src/colors/colors.sh + +alert_secondary 'Upgrade' + +# upgrade packages +echo_info 'sudo apt-get upgrade -y' +sudo apt-get upgrade -y + +# # upgrade operating system +# echo_info 'sudo apt-get dist-upgrade -y' +# sudo apt-get dist-upgrade -y diff --git a/utils/install_ncal.sh b/utils/install_ncal.sh new file mode 100755 index 0000000..8b7547d --- /dev/null +++ b/utils/install_ncal.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * ncal +# * command line calendar +# * +# * @category utils +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install ncal' + +echo_info 'sudo apt-get install --assume-yes ncal' +sudo apt-get install --assume-yes ncal + diff --git a/utils/install_p7zip-full.sh b/utils/install_p7zip-full.sh new file mode 100755 index 0000000..884ee15 --- /dev/null +++ b/utils/install_p7zip-full.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * p7zip-full +# * file compression +# * +# * @category utils +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install p7zip-full' + +echo_info 'sudo apt-get install --assume-yes p7zip-full' +sudo apt-get install --assume-yes p7zip-full diff --git a/utils/install_renameutils.sh b/utils/install_renameutils.sh new file mode 100755 index 0000000..649e57a --- /dev/null +++ b/utils/install_renameutils.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * renameutils +# * batch renamer +# * +# * @category utils +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes renameutils' +sudo apt-get install --assume-yes renameutils diff --git a/utils/install_thunar.sh b/utils/install_thunar.sh new file mode 100755 index 0000000..9c7f3b8 --- /dev/null +++ b/utils/install_thunar.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * thunar +# * bulk rename +# * +# * @category utils +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +echo_info 'sudo apt-get install --assume-yes --no-install-recommends thunar' +sudo apt-get install --assume-yes --no-install-recommends thunar + +echo_info 'sudo apt-get install --assume-yes thunar-media-tags-plugin' +sudo apt-get install --assume-yes thunar-media-tags-plugin diff --git a/utils/install_unrar.sh b/utils/install_unrar.sh new file mode 100755 index 0000000..f2fb580 --- /dev/null +++ b/utils/install_unrar.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#/* +# * This file is part of TangoMan Provisions package. +# * +# * Copyright (c) 2024 "Matthias Morin" +# * +# * This source file is subject to the MIT license that is bundled +# * with this source code in the file LICENSE. +# */ + +#/** +# * unrar +# * file compression +# * +# * Avoids "Parsing filters unsupported" error during extraction of RAR file +# * +# * @category utils +# */ + +CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +# shellcheck source=/dev/null +. "${CURDIR}/../tools/src/colors/colors.sh" + +alert_primary 'Install unrar' + +echo_info 'sudo apt-get install --assume-yes unrar' +sudo apt-get install --assume-yes unrar +