This commit is contained in:
Chris Titus 2024-07-25 17:01:13 -05:00
commit 8ce935c110
19 changed files with 167 additions and 26 deletions

View File

@ -1,13 +1,23 @@
## Chris Titus Tech's Linux Utility
# Chris Titus Tech's Linux Utility
[![Version](https://img.shields.io/github/v/release/ChrisTitusTech/linutil?color=%230567ff&label=Latest%20Release&style=for-the-badge)](https://github.com/ChrisTitusTech/linutil/releases/latest)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/linutil?label=Total%20Downloads&style=for-the-badge)
![pv](https://i.imgur.com/quoAwXf.png)
![Preview](docs/assets/preview.png)
## Usage
## 💡 Usage
Open your terminal and paste this command
```bash
curl -fsSL https://christitus.com/linux | sh
```
## 💖 Support
- To morally and mentally support the project, make sure to leave a ⭐️!
## 🏅 Thanks to all Contributors
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
[![Contributors](https://contrib.rocks/image?repo=ChrisTitusTech/linutil)](https://github.com/ChrisTitusTech/linutil/graphs/contributors)
## Credits
Rust Shell written by [@JustLinuxUser](https://github.com/JustLinuxUser)

Binary file not shown.

1
docs/KnownIssues.md Normal file
View File

@ -0,0 +1 @@
# Known Issues

BIN
docs/assets/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
docs/assets/mainpage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/assets/preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

2
docs/contribute.md Normal file
View File

@ -0,0 +1,2 @@
# How to Contribute?

4
docs/faq.md Normal file
View File

@ -0,0 +1,4 @@
# FAQ's
## How do I uninstall LinUtil?
* You do not have to uninstall LinUtil. As it is a script you run from your terminal it only loads into your RAM. This means as soon as you close LinUtil it will be deleted off your system.

16
docs/index.md Normal file
View File

@ -0,0 +1,16 @@
# Welcome to the LinUtil Documentation!
[![Version](https://img.shields.io/github/v/release/ChrisTitusTech/linutil?color=%230567ff&label=Latest%20Release&style=for-the-badge)](https://github.com/ChrisTitusTech/linutil/releases/latest)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/start.sh?label=Total%20Downloads&style=for-the-badge)
## Running latest release of LinUtil
* You will first need to start a Terminal on your linux machine.
* Now you will need to run following command:
```
curl -fsSL https://christitus.com/linux | sh
```
!!! info
LinUtil is updated weekly as of the time of writing. Consequently, features and functionalities may evolve, and the documentation may not always reflect the most current images or information.

3
docs/updates.md Normal file
View File

@ -0,0 +1,3 @@
# Update Log
#

9
docs/userguide.md Normal file
View File

@ -0,0 +1,9 @@
# Walkthrough
## How to run LinUtil?
Run the following command in a terminal on your Linux System:
```
curl -fsSL https://christitus.com/linux | sh
```
Once you have run that command you will see the following GUI show on your screen:
![Main Page](assets/mainpage.png)

66
mkdocs.yml Normal file
View File

@ -0,0 +1,66 @@
site_name: Chris Titus LinUtil Official Documentation
repo_url: https://github.com/ChrisTitusTech/linutil
nav:
- Introduction: 'index.md'
- User Guide: 'userguide.md'
- Contribute: 'contribute.md'
- Updates: 'updates.md'
- Known Issues: 'KnownIssues.md'
- FAQ: 'faq.md'
theme:
name: material
custom_dir: 'overrides'
features:
- navigation.tabs
- navigation.sections
- toc.integrate
- navigation.top
- search.suggest
- search.highlight
- content.tabs.link
- content.code.annotation
- content.code.copy
language: en
logo: assets/favicon.png
favicon: assets/favicon.png
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
primary: black
accent: purple
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to light mode
primary: teal
accent: lime
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- abbr
- attr_list
- pymdownx.snippets
- md_in_html
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- def_list
- pymdownx.tasklist:
custom_checkbox: true

12
overrides/main.html Normal file
View File

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block header %}
{{ super() }}
<div style="color: red; text-align: center; padding: 10px; font-size: 20px;">
<strong>Announcement:</strong> This documentation is still in progress.
</div>
{% endblock %}
{% block footer %}
{# Empty block to override the footer #}
{% endblock %}

View File

@ -64,7 +64,22 @@ install_additional_dependencies() {
echo "Lutris Installation complete."
echo "Installing steam..."
sudo apt-get install -y steam
#Install steam on Debian
if (lsb_release -i | grep -qi Debian); then
#Enable i386 repos
sudo dpkg --add-architecture i386
# Install software-properties-common to be able to add repos
sudo apt-get install -y software-properties-common
# Add repos necessary for installing steam
sudo apt-add-repository contrib -y
sudo apt-add-repository non-free -y
#Install steam
sudo apt-get install steam-installer -y
else
#Install steam on Ubuntu
sudo apt-get install -y steam
fi
;;
*zypper)

View File

@ -1,5 +1,3 @@
use std::usize;
use crate::{float::floating_window, theme::*};
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind};
use ego_tree::{tree, NodeId};
@ -169,7 +167,10 @@ impl CustomList {
// node
let list = List::new(items)
.highlight_style(Style::default().reversed())
.block(Block::default().borders(Borders::ALL).title(format!("Linux Toolbox - {}", chrono::Local::now().format("%Y-%m-%d"))))
.block(Block::default().borders(Borders::ALL).title(format!(
"Linux Toolbox - {}",
chrono::Local::now().format("%Y-%m-%d")
)))
.scroll_padding(1);
// Render it
@ -251,7 +252,7 @@ impl CustomList {
// Get the selected command
if let Some(selected_command) = self.get_selected_command() {
// If command is a folder, we don't display a preview
if selected_command == "" {
if selected_command.is_empty() {
return;
}

View File

@ -95,6 +95,5 @@ fn run<B: Backend>(terminal: &mut Terminal<B>) -> io::Result<()> {
}
}
}
}
}

View File

@ -31,9 +31,9 @@ pub const THEMES: [Theme; 2] = [
];
pub fn get_theme() -> &'static Theme {
&THEMES[unsafe { THEME_IDX } ]
&THEMES[unsafe { THEME_IDX }]
}
pub fn set_theme(idx: usize){
pub fn set_theme(idx: usize) {
unsafe { THEME_IDX = idx };
}

View File

@ -1,31 +1,34 @@
#!/bin/sh
RC='\033[0m'
RED='\033[0;31m'
rc='\033[0m'
red='\033[0;31m'
linutil="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
binary_url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
check() {
local exit_code=$1
local message=$2
exit_code=$1
message=$2
if [ $exit_code -ne 0 ]; then
echo -e "${RED}ERROR: $message${RC}"
if [ "$exit_code" -ne 0 ]; then
printf '%sERROR: %s%s\n' "$red" "$message" "$rc"
exit 1
fi
unset exit_code
unset message
}
TMPFILE=$(mktemp)
temp_file=$(mktemp)
check $? "Creating the temporary file"
curl -fsL $linutil -o $TMPFILE
curl -fsL "$binary_url" -o "$temp_file"
check $? "Downloading linutil"
chmod +x $TMPFILE
chmod +x "$temp_file"
check $? "Making linutil executable"
"$TMPFILE"
"$temp_file"
check $? "Executing linutil"
rm -f $TMPFILE
rm -f "$temp_file"
check $? "Deleting the temporary file"