Skip to content

Commit

Permalink
Merge branch 'main' into bottles-install-script
Browse files Browse the repository at this point in the history
  • Loading branch information
guruswarupa authored Sep 19, 2024
2 parents 4471ebb + 596f278 commit ee6b604
Show file tree
Hide file tree
Showing 79 changed files with 2,725 additions and 719 deletions.
14 changes: 10 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,28 @@ cd linutil
- **Make small, targeted PRs**: Focus on one feature or fix per pull request. This makes it easier to review and increases the likelihood of acceptance.
- **Avoid combining unrelated changes**: PRs that tackle multiple unrelated issues are harder to review and might be rejected because of a single problem.

## 8. Code Review and Feedback
## 8. Understand and Test the Code You Write

- **Review your code**: Before submitting your changes, take the time to review your code for readability, efficiency and performance. Consider how your changes affect the project.
- **Avoid using LLMs**: Don't submit AI-generated code without reviewing and testing it first. Ensure that any code you submit is thoroughly understood and meets the project's standards.
- **Testing Requirements**: Failure to conduct testing after multiple requests may result in the closure of your Pull Request.

## 9. Code Review and Feedback

- **Expect feedback**: PRs will undergo code review. Be open to feedback and willing to make adjustments as needed.
- **Participate in reviews**: If you feel comfortable, review other contributors' PRs as well. Peer review is a great way to learn and ensure high-quality contributions.

## 9. Contributing Is More Than Just Code
## 10. Contributing Is More Than Just Code

- **Test the tool**: Running tests and providing feedback on how the tool works in different environments is a valuable contribution.
- **Write well-formed issues**: Clearly describe bugs or problems you encounter, providing as much detail as possible, including steps to reproduce the issue.
- **Propose reasonable feature requests**: When suggesting new features, ensure they fit within the scope, style, and design of the project. Provide clear reasoning and use cases.

## 10. Documentation
## 11. Documentation

- **Update the documentation**: If your change affects the functionality, please update the relevant documentation files to reflect this.

## 11. License
## 12. License

- **Agree to the license**: By contributing to Linutil, you agree that your contributions will be licensed under the project's MIT license.

Expand Down
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ If applicable, add screenshots to help explain your problem.

## Additional context
Add any other context about the problem here.

## Checklist
- [ ] I checked for duplicate issues.
- [ ] I checked already existing discussions.
- [ ] This issue is not included in the roadmap.
- [ ] This issue is present on both stable and development branches.
14 changes: 9 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ about: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
## 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**
## Describe the solution you'd like
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
## Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
## Additional context
Add any other context or screenshots about the feature request here.

## Checklist
- [ ] I checked for duplicate issues.
- [ ] I checked already existing discussions.
- [ ] This feature is not included in the roadmap.
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Pull Request

## Title
<!--[Provide a succinct and descriptive title for the pull request.]-->
<!--
Read Contributing Guidelines before opening a PR.
https://github.com/ChrisTitusTech/linutil/blob/main/.github/CONTRIBUTING.md
-->

## Type of Change
- [ ] New feature
- [ ] Bug fix
- [ ] Documentation Update
- [ ] Documentation update
- [ ] Refactoring
- [ ] Hotfix
- [ ] Security patch
Expand All @@ -21,7 +21,7 @@
## Impact
<!--[Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.]-->

## Issue related to PR
## Issues / other PRs related
<!--[What issue/discussion is related to this PR (if any)]-->
- Resolves #

Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/bashisms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check for bashisms

on:
push:
paths:
- tabs/**
branches: [ "main" ]
pull_request:
paths:
- tabs/**
merge_group:
workflow_dispatch:

jobs:
check-bashisms:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install devscripts
run: sudo apt-get update && sudo apt-get install devscripts

- name: Check for bashisms
working-directory: tabs
run: find . -name '*.sh' | xargs -P 4 -n 1 checkbashisms
50 changes: 0 additions & 50 deletions .github/workflows/pr-labels.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Rust Checks
on:
pull_request:
branches: ["main"]
paths:
- '**/*.rs'
- 'Cargo.toml'
- 'Cargo.lock'

env:
CARGO_TERM_COLOR: always
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/linutil?label=Total%20Downloads&style=for-the-badge)
[![](https://dcbadge.limes.pink/api/server/https://discord.gg/bujFYKAHSp)](https://discord.gg/bujFYKAHSp)

<!-- TODO: crates.io package here + <br> -->
[![linutil AUR Version](https://img.shields.io/aur/version/linutil?style=for-the-badge&label=%5BAUR%5D%20linutil&color=%23230567ff)](https://aur.archlinux.org/packages/linutil) [![linutil-bin AUR Version](https://img.shields.io/aur/version/linutil-bin?style=for-the-badge&label=%5BAUR%5D%20linutil-bin&color=%23230567ff)](https://aur.archlinux.org/packages/linutil-bin)

![Preview](docs/assets/preview.png)

**Linutil** is a distro-agnostic toolbox designed to simplify everyday Linux tasks. It helps you set up applications and optimize your system for specific use cases. The utility is actively developed in Rust 🦀, providing performance and reliability.
Expand Down
4 changes: 2 additions & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true
[dependencies]
include_dir = "0.7.4"
tempdir = "0.3.7"
serde = { version = "1.0.205", features = ["derive"] }
toml = "0.8.19"
serde = { version = "1.0.205", features = ["derive"], default-features = false }
toml = { version = "0.8.19", features = ["parse"], default-features = false }
which = "6.0.3"
ego-tree = { workspace = true }
4 changes: 4 additions & 0 deletions core/src/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub fn get_tabs(validate: bool) -> Vec<Tab> {
.map(|(TabEntry { name, data }, directory)| {
let mut tree = Tree::new(ListNode {
name: "root".to_string(),
description: "".to_string(),
command: Command::None,
});
let mut root = tree.root_mut();
Expand Down Expand Up @@ -146,12 +147,14 @@ fn create_directory(data: Vec<Entry>, node: &mut NodeMut<ListNode>, command_dir:
if let Some(entries) = entry.entries {
let mut node = node.append(ListNode {
name: entry.name,
description: entry.description,
command: Command::None,
});
create_directory(entries, &mut node, command_dir);
} else if let Some(command) = entry.command {
node.append(ListNode {
name: entry.name,
description: entry.description,
command: Command::Raw(command),
});
} else if let Some(script) = entry.script {
Expand All @@ -161,6 +164,7 @@ fn create_directory(data: Vec<Entry>, node: &mut NodeMut<ListNode>, command_dir:
}
node.append(ListNode {
name: entry.name,
description: entry.description,
command: Command::LocalFile(dir),
});
} else {
Expand Down
1 change: 1 addition & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ pub struct Tab {
#[derive(Clone, Hash, Eq, PartialEq)]
pub struct ListNode {
pub name: String,
pub description: String,
pub command: Command,
}
Binary file modified docs/assets/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/userguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

## Applications Setup

- **Flathub**: Installs / Uninstalls Flatpak and Flathub.
- **Alacritty Setup**: Installs and configures Alacritty for you.
- **DwmTitus Setup**: Sets up the Dwm window manager.
- **Kitty Setup**: Installs and configures Kitty for you.
Expand All @@ -30,3 +31,11 @@
## Security Features

- **Firewall Baselines**: Sets up firewall rules.

## Utilities

- **Monitor Control**: Controls monitor settings on X11.
- **Bluetooth Control**: Controls Bluetooth settings.
- **Wifi Control**: Controls WiFi settings.
- **Numlock Control**: Sets up Numlock on boot.
- **User Account Manager**: Manage users and groups.
5 changes: 4 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh
#!/bin/sh -e

# Prevent execution if this script was only partially downloaded
{
rc='\033[0m'
red='\033[0;31m'

Expand Down Expand Up @@ -46,3 +48,4 @@ check $? "Executing linutil"

rm -f "$temp_file"
check $? "Deleting the temporary file"
} # End of wrapping
7 changes: 5 additions & 2 deletions startdev.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh
#!/bin/sh -e

# Prevent execution if this script was only partially downloaded
{
RC='\033[0m'
RED='\033[0;31m'

Expand Down Expand Up @@ -35,7 +37,7 @@ check() {
local message=$2

if [ $exit_code -ne 0 ]; then
echo -e "${RED}ERROR: $message${RC}"
printf "%b\n" "${RED}ERROR: $message${RC}"
exit 1
fi
}
Expand Down Expand Up @@ -73,3 +75,4 @@ check $? "Executing linutil"

rm -f $TMPFILE
check $? "Deleting the temporary file"
} # End of wrapping
17 changes: 9 additions & 8 deletions tabs/applications-setup/alacritty-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@

. ../common-script.sh

setupAlacritty() {
echo "Install Alacritty if not already installed..."
installAlacritty() {
printf "%b\n" "${YELLOW}Installing Alacritty...${RC}"
if ! command_exists alacritty; then
case ${PACKAGER} in
case "$PACKAGER" in
pacman)
$ESCALATION_TOOL ${PACKAGER} -S --needed --noconfirm alacritty
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
;;
*)
$ESCALATION_TOOL ${PACKAGER} install -y alacritty
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
;;
esac
else
echo "alacritty is already installed."
printf "%b\n" "${GREEN}Alacritty is already installed.${RC}"
fi
}

setupAlacrittyConfig() {
echo "Copy alacritty config files"
printf "%b\n" "${YELLOW}Copy alacritty config files${RC}"
if [ -d "${HOME}/.config/alacritty" ] && [ ! -d "${HOME}/.config/alacritty-bak" ]; then
cp -r "${HOME}/.config/alacritty" "${HOME}/.config/alacritty-bak"
fi
mkdir -p "${HOME}/.config/alacritty/"
curl -sSLo "${HOME}/.config/alacritty/alacritty.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/alacritty.toml"
curl -sSLo "${HOME}/.config/alacritty/nordic.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/nordic.toml"
printf "%b\n" "${GREEN}Alacritty configuration files copied.${RC}"
}

checkEnv
checkEscalationTool
setupAlacritty
installAlacritty
setupAlacrittyConfig
Loading

0 comments on commit ee6b604

Please sign in to comment.