Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into auto-cpufreq
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Nov 6, 2024
2 parents 2ec4186 + f0734f3 commit c62e53f
Show file tree
Hide file tree
Showing 18 changed files with 206 additions and 156 deletions.
24 changes: 24 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 25 additions & 31 deletions core/src/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,18 @@ pub fn get_tabs(validate: bool) -> (TempDir, Vec<Tab>) {

let tabs: Vec<Tab> = tabs
.into_iter()
.map(
|(
TabEntry {
name,
data,
multi_selectable,
},
directory,
)| {
let mut tree = Tree::new(Rc::new(ListNode {
name: "root".to_string(),
description: String::new(),
command: Command::None,
task_list: String::new(),
}));
let mut root = tree.root_mut();
create_directory(data, &mut root, &directory, validate);
Tab {
name,
tree,
multi_selectable,
}
},
)
.map(|(TabEntry { name, data }, directory)| {
let mut tree = Tree::new(Rc::new(ListNode {
name: "root".to_string(),
description: String::new(),
command: Command::None,
task_list: String::new(),
multi_select: false,
}));
let mut root = tree.root_mut();
create_directory(data, &mut root, &directory, validate, true);
Tab { name, tree }
})
.collect();

if tabs.is_empty() {
Expand All @@ -74,12 +62,6 @@ 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 All @@ -94,6 +76,12 @@ struct Entry {
entry_type: EntryType,
#[serde(default)]
task_list: String,
#[serde(default = "default_true")]
multi_select: bool,
}

fn default_true() -> bool {
true
}

#[derive(Deserialize)]
Expand Down Expand Up @@ -174,24 +162,29 @@ fn create_directory(
node: &mut NodeMut<Rc<ListNode>>,
command_dir: &Path,
validate: bool,
parent_multi_select: bool,
) {
for entry in data {
let multi_select = parent_multi_select && entry.multi_select;

match entry.entry_type {
EntryType::Entries(entries) => {
let mut node = node.append(Rc::new(ListNode {
name: entry.name,
description: entry.description,
command: Command::None,
task_list: String::new(),
multi_select,
}));
create_directory(entries, &mut node, command_dir, validate);
create_directory(entries, &mut node, command_dir, validate, multi_select);
}
EntryType::Command(command) => {
node.append(Rc::new(ListNode {
name: entry.name,
description: entry.description,
command: Command::Raw(command),
task_list: String::new(),
multi_select,
}));
}
EntryType::Script(script) => {
Expand All @@ -210,6 +203,7 @@ fn create_directory(
file: script,
},
task_list: entry.task_list,
multi_select,
}));
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub enum Command {
pub struct Tab {
pub name: String,
pub tree: Tree<Rc<ListNode>>,
pub multi_selectable: bool,
}

#[derive(Clone, Hash, Eq, PartialEq)]
Expand All @@ -32,4 +31,5 @@ pub struct ListNode {
pub description: String,
pub command: Command,
pub task_list: String,
pub multi_select: bool,
}
3 changes: 3 additions & 0 deletions core/tabs/applications-setup/dwmtitus-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ setupDisplayManager() {
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM"
if [ "$DM" = "lightdm" ]; then
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lightdm-gtk-greeter
fi
;;
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
Expand Down
16 changes: 8 additions & 8 deletions core/tabs/applications-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ task_list = "FI"

[[data]]
name = "Alacritty"
description = "Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance. The supported platforms currently consist of BSD, Linux, macOS and Windows.\nThis command installs and condifures alacritty terminal emulator."
description = "Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance. The supported platforms currently consist of BSD, Linux, macOS and Windows. This command installs and configures alacritty terminal emulator."
script = "alacritty-setup.sh"
task_list = "I FM"

Expand All @@ -218,13 +218,13 @@ task_list = "I SS"

[[data]]
name = "Bash Prompt"
description = "The .bashrc file is a script that runs every time a new terminal session is started in Unix-like operating systems.\nIt is used to configure the shell session, set up aliases, define functions, and more, making the terminal easier to use and more powerful.\nThis command configures the key sections and functionalities defined in the .bashrc file from CTT's mybash repository.\nhttps://github.com/ChrisTitusTech/mybash"
description = "The .bashrc file is a script that runs every time a new terminal session is started in Unix-like operating systems. It is used to configure the shell session, set up aliases, define functions, and more, making the terminal easier to use and more powerful. This command configures the key sections and functionalities defined in the .bashrc file from CTT's mybash repository. https://github.com/ChrisTitusTech/mybash"
script = "mybash-setup.sh"
task_list = "I FM"

[[data]]
name = "Bottles"
description = "Bottles allows Windows software, like applications and games, to run on Linux.\nBottles also provides tools to categorize, organize and optimize your applications."
description = "Bottles allows Windows software, like applications and games, to run on Linux. Bottles also provides tools to categorize, organize and optimize your applications."
script = "bottles-setup.sh"
task_list = "FI"

Expand All @@ -242,13 +242,13 @@ task_list = "I PFM SS"

[[data]]
name = "Fastfetch"
description = "Fastfetch is a neofetch-like tool for fetching system information and displaying it prettily.\nIt is written mainly in C, with performance and customizability in mind.\nThis command installs fastfetch and configures from CTT's mybash repository.\nhttps://github.com/ChrisTitusTech/mybash"
description = "Fastfetch is a neofetch-like tool for fetching system information and displaying it prettily. It is written mainly in C, with performance and customizability in mind. This command installs fastfetch and configures from CTT's mybash repository. https://github.com/ChrisTitusTech/mybash"
script = "fastfetch-setup.sh"
task_list = "I FM"

[[data]]
name = "Flatpak / Flathub"
description = "Flatpak is a universal application sandbox for Linux that uses isolated packages from Flathub to prevent conflicts and system alterations, while alleviating dependency concerns.\nThis command installs Flatpak and adds the Flathub repository"
description = "Flatpak is a universal application sandbox for Linux that uses isolated packages from Flathub to prevent conflicts and system alterations, while alleviating dependency concerns. This command installs Flatpak and adds the Flathub repository"
script = "setup-flatpak.sh"
task_list = "I"

Expand All @@ -260,7 +260,7 @@ task_list = "PFM"

[[data]]
name = "Kitty"
description = "kitty is a free and open-source GPU-accelerated terminal emulator for Linux, macOS, and some BSD distributions, focused on performance and features.\nkitty is written in a mix of C and Python programming languages.\n This command installs and configures kitty."
description = "kitty is a free and open-source GPU-accelerated terminal emulator for Linux, macOS, and some BSD distributions, focused on performance and features. kitty is written in a mix of C and Python programming languages. This command installs and configures kitty."
script = "kitty-setup.sh"
task_list = "I FM"

Expand Down Expand Up @@ -288,7 +288,7 @@ values = [ "linutil" ]

[[data]]
name = "Rofi"
description = "Rofi is a window switcher, run dialog, ssh-launcher and dmenu replacement that started as a clone of simpleswitcher, written by Sean Pringle and later expanded by Dave Davenport.\nThis command installs and configures rofi with configuration from CTT's DWM repo.\nhttps://github.com/ChrisTitusTech/dwm-titus"
description = "Rofi is a window switcher, run dialog, ssh-launcher and dmenu replacement that started as a clone of simpleswitcher, written by Sean Pringle and later expanded by Dave Davenport. This command installs and configures rofi with configuration from CTT's DWM repo. https://github.com/ChrisTitusTech/dwm-titus"
script = "rofi-setup.sh"
task_list = "I FM"

Expand All @@ -304,6 +304,6 @@ values = [ "wayland", "Wayland" ]

[[data]]
name = "ZSH Prompt"
description = "The Z shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.\nThis command installs ZSH prompt and provides basic configuration."
description = "The Z shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh. This command installs ZSH prompt and provides basic configuration."
script = "zsh-setup.sh"
task_list = "I FM"
2 changes: 1 addition & 1 deletion core/tabs/common-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GREEN='\033[32m'

command_exists() {
for cmd in "$@"; do
export PATH=/home/jeeva/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH
export PATH="$HOME/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH"
command -v "$cmd" >/dev/null 2>&1 || return 1
done
return 0
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/gaming/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ name = "Diablo II Resurrected"

[[data.entries]]
name = "Loot Filter"
description = "This is a loot filter for Diablo II Resurrected.\nIt's designed to be a simple, clean, and easy to read loot filter that highlights the most important items.\nWorks on battle.net and single player.\nNo frills, no config, just highlights high runes and other valuable items.\nFor more information visit: https://github.com/ChrisTitusTech/d2r-loot-filter"
description = "This is a loot filter for Diablo II Resurrected. It's designed to be a simple, clean, and easy to read loot filter that highlights the most important items. Works on battle.net and single player. No frills, no config, just highlights high runes and other valuable items. For more information visit: https://github.com/ChrisTitusTech/d2r-loot-filter"
script = "diablo-ii/d2r-loot-filters.sh"
task_list = "FM"
2 changes: 1 addition & 1 deletion core/tabs/security/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name = "Security"

[[data]]
name = "Firewall Baselines (CTT)"
description = "Developed to ease iptables firewall configuration, UFW provides a user friendly way to create an IPv4 or IPv6 host-based firewall.\nThis command installs UFW and configures UFW based on CTT's recommended rules.\nFor more information visit: https://christitus.com/linux-security-mistakes"
description = "Developed to ease iptables firewall configuration, UFW provides a user friendly way to create an IPv4 or IPv6 host-based firewall. This command installs UFW and configures UFW based on CTT's recommended rules. For more information visit: https://christitus.com/linux-security-mistakes"
script = "firewall-baselines.sh"
task_list = "I SS"
8 changes: 4 additions & 4 deletions core/tabs/system-setup/gaming-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ installDepend() {
alsa-utils alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib giflib lib32-giflib libpng lib32-libpng \
libldap lib32-libldap openal lib32-openal libxcomposite lib32-libxcomposite libxinerama lib32-libxinerama \
ncurses lib32-ncurses vulkan-icd-loader lib32-vulkan-icd-loader ocl-icd lib32-ocl-icd libva lib32-libva \
gst-plugins-base-libs lib32-gst-plugins-base-libs sdl2"
gst-plugins-base-libs lib32-gst-plugins-base-libs sdl2 lib32-sdl2 v4l-utils lib32-v4l-utils sqlite lib32-sqlite"

$AUR_HELPER -S --needed --noconfirm $DEPENDENCIES $DISTRO_DEPS
;;
apt-get|nala)
DISTRO_DEPS="libasound2 libsdl2 wine64 wine32"
DISTRO_DEPS="libasound2-plugins:i386 libsdl2-2.0-0:i386 libdbus-1-3:i386 libsqlite3-0:i386 wine64 wine32"

"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" dpkg --add-architecture i386
Expand All @@ -36,7 +36,7 @@ installDepend() {
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $DISTRO_DEPS
;;
dnf)
if [ "$(rpm -E %fedora)" -le 41 ]; then
if [ "$(rpm -E %fedora)" -le 41 ]; then
"$ESCALATION_TOOL" "$PACKAGER" install ffmpeg ffmpeg-libs -y
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
else
Expand Down Expand Up @@ -69,7 +69,7 @@ installAdditionalDepend() {

version_no_v=$(echo "$version" | tr -d v)
curl -sSLo "lutris_${version_no_v}_all.deb" "https://github.com/lutris/lutris/releases/download/${version}/lutris_${version_no_v}_all.deb"

printf "%b\n" "${YELLOW}Installing Lutris...${RC}"
"$ESCALATION_TOOL" "$PACKAGER" install ./lutris_"${version_no_v}"_all.deb

Expand Down
10 changes: 6 additions & 4 deletions core/tabs/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name = "System Setup"
multi_selectable = false

[[data]]
name = "Arch Linux"
Expand All @@ -14,16 +13,17 @@ name = "Arch Server Setup"
description = "This command installs a minimal arch server setup under 5 minutes."
script = "arch/server-setup.sh"
task_list = "SI D"
multi_select = false

[[data.entries]]
name = "Paru AUR Helper"
description = "Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction.\nTo know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers"
description = "Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction. To know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers"
script = "arch/paru-setup.sh"
task_list = "I"

[[data.entries]]
name = "Yay AUR Helper"
description = "Yet Another Yogurt - An AUR Helper Written in Go.\nTo know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers"
description = "Yet Another Yogurt - An AUR Helper Written in Go. To know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers"
script = "arch/yay-setup.sh"
task_list = "I"

Expand Down Expand Up @@ -55,7 +55,7 @@ task_list = "I"

[[data.entries]]
name = "RPM Fusion"
description = "RPM Fusion provides software that the Fedora Project or Red Hat doesn't want to ship.\nThat software is provided as precompiled RPMs for all current Fedora versions and current Red Hat Enterprise Linux or clones versions; you can use the RPM Fusion repositories with tools like yum and PackageKit.\nFor more information visit: https://rpmfusion.org/"
description = "RPM Fusion provides software that the Fedora Project or Red Hat doesn't want to ship. That software is provided as precompiled RPMs for all current Fedora versions and current Red Hat Enterprise Linux or clones versions; you can use the RPM Fusion repositories with tools like yum and PackageKit. For more information visit: https://rpmfusion.org/"
script = "fedora/rpm-fusion-setup.sh"
task_list = "MP"

Expand All @@ -82,12 +82,14 @@ name = "Full System Cleanup"
description = "This script is designed to remove unnecessary packages, clean old cache files, remove temporary files, and to empty the trash."
script = "system-cleanup.sh"
task_list = "RP PFM"
multi_select = false

[[data]]
name = "Full System Update"
description = "This command updates your system to the latest packages available for your distro"
script = "system-update.sh"
task_list = "PFM"
multi_select = false

[[data]]
name = "Gaming Dependencies"
Expand Down
5 changes: 4 additions & 1 deletion core/tabs/utils/tab_data.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name = "Utilities"
multi_selectable = false

[[data]]
name = "Monitor Control"
multi_select = false

[[data.preconditions]]
matches = true
Expand Down Expand Up @@ -78,6 +78,7 @@ script = "monitor-control/set_resolutions.sh"

[[data]]
name = "User Account Manager"
multi_select = false

[[data.entries]]
name = "Add User"
Expand All @@ -104,6 +105,7 @@ name = "Auto Mount Drive"
description = "This utility is designed to help with automating the process of mounting a drive on to your system."
script = "auto-mount.sh"
task_list = "PFM"
multi_select = false

[[data]]
name = "Auto Login"
Expand All @@ -115,6 +117,7 @@ name = "Bluetooth Manager"
description = "This utility is designed to manage bluetooth in your system"
script = "bluetooth-control.sh"
task_list = "I SS"
multi_select = false

[[data]]
name = "Bootable USB Creator"
Expand Down
Loading

0 comments on commit c62e53f

Please sign in to comment.