mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-21 21:09:42 +00:00
Compare commits
8 Commits
88c37e7528
...
65e37a848a
Author | SHA1 | Date | |
---|---|---|---|
|
65e37a848a | ||
|
e3688e9b3d | ||
|
51631a16cb | ||
|
d39ffad527 | ||
|
c0982a787f | ||
|
4f7de594a6 | ||
|
fa2f838b63 | ||
|
b759a1f323 |
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
|
@ -16,6 +16,7 @@ cd linutil
|
|||
```
|
||||
|
||||
## 3. Make your changes
|
||||
|
||||
- **Edit the files you want to change**: Make your changes to the relevant files.
|
||||
- **Test your changes**: Run `cargo run` to test your modifications in a local environment and ensure everything works as expected.
|
||||
|
||||
|
@ -60,6 +61,7 @@ cd linutil
|
|||
## 11. Documentation
|
||||
|
||||
- **Update the documentation**: If your change affects the functionality, please update the relevant documentation files to reflect this.
|
||||
- **Automatic generation**: If you decide to add functionality through a new shell script, make sure to fill out all fields in `tab_data.toml` and run `cargo xtask docgen`.
|
||||
|
||||
## 12. License
|
||||
|
||||
|
|
2
.github/workflows/github-pages.yml
vendored
2
.github/workflows/github-pages.yml
vendored
|
@ -22,7 +22,7 @@ jobs:
|
|||
|
||||
- name: Copy Contributing Guidelines
|
||||
run: |
|
||||
echo "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md'
|
||||
echo -e "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md'
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
|
|
|
@ -35,10 +35,10 @@ installLinutil() {
|
|||
printf "%b\n" "${YELLOW}Installing rustup...${RC}"
|
||||
case "$PACKAGER" in
|
||||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm curl rustup man-db
|
||||
;;
|
||||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y curl rustup man-pages man-db man
|
||||
;;
|
||||
zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
||||
|
@ -54,12 +54,23 @@ installLinutil() {
|
|||
rustup default stable
|
||||
cargo install --force linutil_tui
|
||||
printf "%b\n" "${GREEN}Installed successfully.${RC}"
|
||||
installExtra
|
||||
;;
|
||||
*) printf "%b\n" "${RED}Linutil not installed.${RC}" ;;
|
||||
esac
|
||||
esac
|
||||
}
|
||||
|
||||
installExtra() {
|
||||
printf "%b\n" "${YELLOW}Installing the manpage...${RC}"
|
||||
"$ESCALATION_TOOL" mkdir -p /usr/share/man/man1
|
||||
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/man/linutil.1' | "$ESCALATION_TOOL" tee '/usr/share/man/man1/linutil.1' > /dev/null
|
||||
printf "%b\n" "${YELLOW}Creating a Desktop Entry...${RC}"
|
||||
"$ESCALATION_TOOL" mkdir -p /usr/share/applications
|
||||
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/linutil.desktop' | "$ESCALATION_TOOL" tee /usr/share/applications/linutil.desktop > /dev/null
|
||||
printf "%b\n" "${GREEN}Done.${RC}"
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
checkAURHelper
|
||||
|
|
|
@ -1,50 +1,5 @@
|
|||
name = "Applications Setup"
|
||||
|
||||
[[data]]
|
||||
name = "Developer Tools"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Github Desktop"
|
||||
description = "GitHub Desktop is a user-friendly application that simplifies the process of managing Git repositories and interacting with GitHub, providing a graphical interface for tasks like committing, branching, and syncing changes."
|
||||
script = "Developer-tools/githubdesktop-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Neovim"
|
||||
description = "Neovim is a refactor, and sometimes redactor, in the tradition of Vim.\nIt is not a rewrite but a continuation and extension of Vim.\nThis command configures neovim from CTT's neovim configuration.\nhttps://github.com/ChrisTitusTech/neovim"
|
||||
script = "Developer-tools/neovim-setup.sh"
|
||||
task_list = "I FM"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Sublime Text"
|
||||
description = "Sublime Text is a fast, lightweight, and customizable text editor known for its simplicity, powerful features, and wide range of plugins for various programming languages."
|
||||
script = "Developer-tools/sublime-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "VS Code"
|
||||
description = "Visual Studio Code (VS Code) is a lightweight, open-source code editor with built-in support for debugging, version control, and extensions for various programming languages and frameworks."
|
||||
script = "Developer-tools/vscode-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "VS Codium"
|
||||
description = "VSCodium is a free, open-source version of Visual Studio Code (VS Code) that removes Microsoft-specific telemetry and branding."
|
||||
script = "Developer-tools/vscodium-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Meld"
|
||||
description = "Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects."
|
||||
script = "Developer-tools/meld-setup.sh"
|
||||
task_list = "I FI"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Ngrok"
|
||||
description = "Ngrok is a tool that creates secure, temporary tunnels to expose local servers to the internet for testing and development."
|
||||
script = "Developer-tools/ngrok-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data]]
|
||||
name = "Communication Apps"
|
||||
|
||||
|
@ -78,21 +33,71 @@ description = "Telegram is a cloud-based messaging app known for its speed and s
|
|||
script = "communication-apps/telegram-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Zoom"
|
||||
description = "Zoom is a widely-used video conferencing platform that allows users to host virtual meetings, webinars, and online collaboration with features like screen sharing and recording."
|
||||
script = "communication-apps/zoom-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Thunderbird"
|
||||
description = "Thunderbird is a free, open-source email client that offers powerful features like customizable email management, a built-in calendar, and extensive add-ons for enhanced functionality."
|
||||
script = "communication-apps/thunderbird-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Zoom"
|
||||
description = "Zoom is a widely-used video conferencing platform that allows users to host virtual meetings, webinars, and online collaboration with features like screen sharing and recording."
|
||||
script = "communication-apps/zoom-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data]]
|
||||
name = "Developer Tools"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Github Desktop"
|
||||
description = "GitHub Desktop is a user-friendly application that simplifies the process of managing Git repositories and interacting with GitHub, providing a graphical interface for tasks like committing, branching, and syncing changes."
|
||||
script = "Developer-tools/githubdesktop-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Meld"
|
||||
description = "Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects."
|
||||
script = "Developer-tools/meld-setup.sh"
|
||||
task_list = "I FI"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Neovim"
|
||||
description = "Neovim is a refactor, and sometimes redactor, in the tradition of Vim.\nIt is not a rewrite but a continuation and extension of Vim.\nThis command configures neovim from CTT's neovim configuration.\nhttps://github.com/ChrisTitusTech/neovim"
|
||||
script = "Developer-tools/neovim-setup.sh"
|
||||
task_list = "I FM"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Ngrok"
|
||||
description = "Ngrok is a tool that creates secure, temporary tunnels to expose local servers to the internet for testing and development."
|
||||
script = "Developer-tools/ngrok-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Sublime Text"
|
||||
description = "Sublime Text is a fast, lightweight, and customizable text editor known for its simplicity, powerful features, and wide range of plugins for various programming languages."
|
||||
script = "Developer-tools/sublime-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "VS Code"
|
||||
description = "Visual Studio Code (VS Code) is a lightweight, open-source code editor with built-in support for debugging, version control, and extensions for various programming languages and frameworks."
|
||||
script = "Developer-tools/vscode-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "VS Codium"
|
||||
description = "VSCodium is a free, open-source version of Visual Studio Code (VS Code) that removes Microsoft-specific telemetry and branding."
|
||||
script = "Developer-tools/vscodium-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data]]
|
||||
name = "Office Suites"
|
||||
|
||||
[[data.entries]]
|
||||
name = "FreeOffice"
|
||||
script = "office-suites/freeoffice.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "LibreOffice"
|
||||
script = "office-suites/libreoffice.sh"
|
||||
|
@ -103,11 +108,6 @@ name = "OnlyOffice"
|
|||
script = "office-suites/onlyoffice.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "FreeOffice"
|
||||
script = "office-suites/freeoffice.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "WPS Office"
|
||||
script = "office-suites/wpsoffice.sh"
|
||||
|
@ -210,18 +210,18 @@ description = "Bottles allows Windows software, like applications and games, to
|
|||
script = "bottles-setup.sh"
|
||||
task_list = "FI"
|
||||
|
||||
[[data]]
|
||||
name = "DWM-Titus"
|
||||
description = "DWM is a dynamic window manager for X.\nIt manages windows in tiled, monocle and floating layouts.\nAll of the layouts can be applied dynamically, optimising the environment for the application in use and the task performed.\nThis command installs and configures DWM and a desktop manager.\nThe list of patches applied can be found in CTT's DWM repository\nhttps://github.com/ChrisTitusTech/dwm-titus"
|
||||
script = "dwmtitus-setup.sh"
|
||||
task_list = "I PFM SS"
|
||||
|
||||
[[data]]
|
||||
name = "Docker"
|
||||
description = "Docker is an open platform that uses OS-level virtualization to deliver software in packages called containers."
|
||||
script = "docker-setup.sh"
|
||||
task_list = "I SS"
|
||||
|
||||
[[data]]
|
||||
name = "DWM-Titus"
|
||||
description = "DWM is a dynamic window manager for X.\nIt manages windows in tiled, monocle and floating layouts.\nAll of the layouts can be applied dynamically, optimising the environment for the application in use and the task performed.\nThis command installs and configures DWM and a desktop manager.\nThe list of patches applied can be found in CTT's DWM repository\nhttps://github.com/ChrisTitusTech/dwm-titus"
|
||||
script = "dwmtitus-setup.sh"
|
||||
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"
|
||||
|
@ -288,4 +288,4 @@ values = [ "wayland", "Wayland" ]
|
|||
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."
|
||||
script = "zsh-setup.sh"
|
||||
task_list = "I FM"
|
||||
task_list = "I FM"
|
23
core/tabs/system-setup/system-cleanup.sh
Normal file → Executable file
23
core/tabs/system-setup/system-cleanup.sh
Normal file → Executable file
|
@ -26,16 +26,21 @@ cleanup_system() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
return 1
|
||||
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
common_cleanup() {
|
||||
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete
|
||||
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete
|
||||
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
|
||||
if [ -d /var/tmp ]; then
|
||||
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete
|
||||
fi
|
||||
if [ -d /tmp ]; then
|
||||
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete
|
||||
fi
|
||||
if [ -d /var/log ]; then
|
||||
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
|
||||
fi
|
||||
"$ESCALATION_TOOL" journalctl --vacuum-time=3d
|
||||
}
|
||||
|
||||
|
@ -45,8 +50,12 @@ clean_data() {
|
|||
case $clean_response in
|
||||
y|Y)
|
||||
printf "%b\n" "${YELLOW}Cleaning up old cache files and emptying trash...${RC}"
|
||||
find "$HOME/.cache/" -type f -atime +5 -delete
|
||||
find "$HOME/.local/share/Trash" -mindepth 1 -delete
|
||||
if [ -d "$HOME/.cache" ]; then
|
||||
find "$HOME/.cache/" -type f -atime +5 -delete
|
||||
fi
|
||||
if [ -d "$HOME/.local/share/Trash" ]; then
|
||||
find "$HOME/.local/share/Trash" -mindepth 1 -delete
|
||||
fi
|
||||
printf "%b\n" "${GREEN}Cache and trash cleanup completed.${RC}"
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -13,7 +13,7 @@ change_orientation() {
|
|||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||
printf "%b\n" "${YELLOW} Change Monitor Orientation${RC}"
|
||||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||
printf "%b" "${YELLOW}Choose a monitor to configure: ${RC}"
|
||||
printf "%b\n" "${YELLOW}Choose a monitor to configure: ${RC}"
|
||||
i=1
|
||||
for monitor in $monitor_array; do
|
||||
printf "%b\n" "$i. ${GREEN}$monitor${RC}"
|
||||
|
|
|
@ -13,7 +13,7 @@ disable_monitor() {
|
|||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||
printf "%b\n" "${YELLOW} Disable Monitor${RC}"
|
||||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||
printf "%b" "Choose a monitor to disable: "
|
||||
printf "%b\n" "Choose a monitor to disable: "
|
||||
i=1
|
||||
for monitor in $monitor_array; do
|
||||
printf "%b\n" "$i. ${GREEN}$monitor${RC}"
|
||||
|
|
|
@ -13,7 +13,7 @@ enable_monitor() {
|
|||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||
printf "%b\n" "${YELLOW} Enable Monitor${RC}"
|
||||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||
printf "%b" "${YELLOW}Choose a monitor to enable: ${RC}"
|
||||
printf "%b\n" "${YELLOW}Choose a monitor to enable: ${RC}"
|
||||
|
||||
i=1
|
||||
for monitor in $monitor_array; do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ./utility_functions.sh
|
||||
. ../utility_functions.sh
|
||||
|
||||
. ../../common-script.sh
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@ manage_arrangement() {
|
|||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||
printf "%b\n" "${YELLOW} Manage Monitor Arrangement${RC}"
|
||||
printf "%b\n" "${YELLOW}=========================================${RC}"
|
||||
printf "%b" "${YELLOW}Choose the monitor to arrange: ${RC}"
|
||||
printf "%b\n" "${YELLOW}Choose the monitor to arrange: ${RC}"
|
||||
i=1
|
||||
for monitor in $monitor_array; do
|
||||
printf "%b\n" "$i. ${YELLOW}$monitor${RC}"
|
||||
printf "%b\n" "$i. ${GREEN}$monitor${RC}"
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ set_primary_monitor() {
|
|||
printf "%b\n" "${YELLOW}Choose a monitor to set as primary:${RC}"
|
||||
i=1
|
||||
for monitor in $monitor_array; do
|
||||
printf "%b\n" "$i. ${YELLOW}$monitor${RC}"
|
||||
printf "%b\n" "$i. ${GREEN}$monitor${RC}"
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n# Contributing Guidelines for Linutil
|
||||
<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->
|
||||
|
||||
# Contributing Guidelines for Linutil
|
||||
|
||||
Thank you for considering contributing to Linutil! We appreciate your effort in helping improve this project. To ensure that your contributions align with the goals and quality standards of Linutil, please follow these guidelines:
|
||||
|
||||
|
@ -16,6 +18,7 @@ cd linutil
|
|||
```
|
||||
|
||||
## 3. Make your changes
|
||||
|
||||
- **Edit the files you want to change**: Make your changes to the relevant files.
|
||||
- **Test your changes**: Run `cargo run` to test your modifications in a local environment and ensure everything works as expected.
|
||||
|
||||
|
@ -60,6 +63,7 @@ cd linutil
|
|||
## 11. Documentation
|
||||
|
||||
- **Update the documentation**: If your change affects the functionality, please update the relevant documentation files to reflect this.
|
||||
- **Automatic generation**: If you decide to add functionality through a new shell script, make sure to fill out all fields in `tab_data.toml` and run `cargo xtask docgen`.
|
||||
|
||||
## 12. License
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::{state::ListEntry, theme::Theme};
|
||||
use crossterm::event::{KeyCode, KeyEvent};
|
||||
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
||||
use ego_tree::NodeId;
|
||||
use linutil_core::Tab;
|
||||
use ratatui::{
|
||||
|
@ -116,21 +116,27 @@ impl Filter {
|
|||
pub fn handle_key(&mut self, event: &KeyEvent) -> SearchAction {
|
||||
//Insert user input into the search bar
|
||||
match event.code {
|
||||
KeyCode::Char('c') if event.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
return self.exit_search()
|
||||
}
|
||||
KeyCode::Char(c) => self.insert_char(c),
|
||||
KeyCode::Backspace => self.remove_previous(),
|
||||
KeyCode::Delete => self.remove_next(),
|
||||
KeyCode::Left => return self.cursor_left(),
|
||||
KeyCode::Right => return self.cursor_right(),
|
||||
KeyCode::Esc => {
|
||||
self.input_position = 0;
|
||||
self.search_input.clear();
|
||||
return SearchAction::Exit;
|
||||
}
|
||||
KeyCode::Enter => return SearchAction::Exit,
|
||||
KeyCode::Esc => return self.exit_search(),
|
||||
_ => return SearchAction::None,
|
||||
};
|
||||
SearchAction::Update
|
||||
}
|
||||
|
||||
fn exit_search(&mut self) -> SearchAction {
|
||||
self.input_position = 0;
|
||||
self.search_input.clear();
|
||||
SearchAction::Exit
|
||||
}
|
||||
|
||||
fn cursor_left(&mut self) -> SearchAction {
|
||||
self.input_position = self.input_position.saturating_sub(1);
|
||||
SearchAction::None
|
||||
|
|
|
@ -119,7 +119,10 @@ impl AppState {
|
|||
match self.focus {
|
||||
Focus::Search => (
|
||||
"Search bar",
|
||||
Box::new([Shortcut::new("Finish search", ["Enter"])]),
|
||||
Box::new([
|
||||
Shortcut::new("Abort search", ["Esc", "CTRL-c"]),
|
||||
Shortcut::new("Search", ["Enter"]),
|
||||
]),
|
||||
),
|
||||
|
||||
Focus::List => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user