Skip to content

Commit

Permalink
Merge branch 'main' into various_refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTitusTech authored Sep 19, 2024
2 parents de8653c + a747f80 commit 1c31508
Show file tree
Hide file tree
Showing 53 changed files with 1,583 additions and 298 deletions.
File renamed without changes.
21 changes: 13 additions & 8 deletions .github/workflows/bashisms.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Check for bashisms

on:
push:
paths:
- tabs/**
branches: [ "main" ]
# push:
# paths:
# - tabs/**
# branches: [ "main" ]
pull_request:
paths:
- tabs/**
Expand All @@ -16,11 +16,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: git fetch origin ${{ github.base_ref }}

- 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
- name: Check for bashisms in changed files
run: |
for file in $(git diff --name-only origin/${{ github.base_ref }} HEAD tabs); do
if [[ "$file" == *.sh ]]; then
checkbashisms "$file"
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/issue-slash-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
id: check_user
if: env.comment == 'true'
run: |
ALLOWED_USERS=("ChrisTitusTech" "afonsofrancof" "Marterich" "MyDrift-user" "Real-MullaC")
ALLOWED_USERS=("ChrisTitusTech" "afonsofrancof" "Marterich" "MyDrift-user" "Real-MullaC" "nnyyxxxx" "adamperkowski" "lj3954" "jeevithakannan2")
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
echo "user=true" >> $GITHUB_ENV
else
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/linutil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ jobs:
- name: Build x86_64 binary
run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl

- name: Build aarch64 binary
run: cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl

- name: Move binaries to build directory
run: |
mv build/x86_64-unknown-linux-musl/release/linutil build/linutil
mv build/aarch64-unknown-linux-musl/release/linutil build/linutil-aarch64
- name: Pull latest changes
run: |
Expand All @@ -57,7 +61,7 @@ jobs:
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Commit Linutil
file_pattern: "build/linutil"
file_pattern: "build/linutil build/linutil-aarch64"
add_options: '--force'
if: success()

Expand Down Expand Up @@ -87,9 +91,12 @@ jobs:
${{ steps.generate_notes.outputs.body }}
![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/${{ env.version }}/linutil)
![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/${{ env.version }}/linutil-aarch64)
append_body: false
files: |
./build/linutil
./build/linutil-aarch64
./start.sh
./startdev.sh
prerelease: true
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 }
39 changes: 29 additions & 10 deletions core/src/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,29 @@ pub fn get_tabs(validate: bool) -> Vec<Tab> {
});

let tabs: Vec<Tab> = tabs
.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();
create_directory(data, &mut root, &directory);
Tab { name, tree }
})
.map(
|(
TabEntry {
name,
data,
multi_selectable,
},
directory,
)| {
let mut tree = Tree::new(ListNode {
name: "root".to_string(),
description: String::new(),
command: Command::None,
});
let mut root = tree.root_mut();
create_directory(data, &mut root, &directory);
Tab {
name,
tree,
multi_selectable,
}
},
)
.collect();

if tabs.is_empty() {
Expand All @@ -48,6 +61,12 @@ struct TabList {
struct TabEntry {
name: String,
data: Vec<Entry>,
#[serde(default = "default_multi_selectable")]
multi_selectable: bool,
}

fn default_multi_selectable() -> bool {
true
}

#[derive(Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub enum Command {
pub struct Tab {
pub name: String,
pub tree: Tree<ListNode>,
pub multi_selectable: bool,
}

#[derive(Clone, Hash, Eq, PartialEq)]
Expand Down
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.
3 changes: 3 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/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
3 changes: 3 additions & 0 deletions startdev.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh -e

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

Expand Down Expand Up @@ -73,3 +75,4 @@ check $? "Executing linutil"

rm -f $TMPFILE
check $? "Deleting the temporary file"
} # End of wrapping
3 changes: 2 additions & 1 deletion tabs/applications-setup/alacritty-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ setupAlacrittyConfig() {
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/keybinds.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/keybinds.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
installAlacritty
setupAlacrittyConfig
setupAlacrittyConfig
14 changes: 14 additions & 0 deletions tabs/applications-setup/bottles-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -e

. ../common-script.sh

install_bottles() {
printf "%b\n" "${YELLOW}Installing Bottles...${RC}"
. ./setup-flatpak.sh
flatpak install -y flathub com.usebottles.bottles
printf "%b\n" "${GREEN}Bottles installed successfully. Restart the system to apply changes...${RC}"
}

checkEnv
checkEscalationTool
install_bottles2
Loading

0 comments on commit 1c31508

Please sign in to comment.