mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-23 21:51:56 +00:00
Compare commits
10 Commits
a09f38ede6
...
be0166913a
Author | SHA1 | Date | |
---|---|---|---|
|
be0166913a | ||
|
fa69885b6c | ||
|
bfa9ea3bd7 | ||
|
524f8ebc86 | ||
|
a790accb7c | ||
|
a6bd6ec156 | ||
|
5962213b83 | ||
|
16785ca86c | ||
|
2abfc26348 | ||
|
acfc1d2aff |
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -425,6 +425,7 @@ dependencies = [
|
|||
"tree-sitter-highlight",
|
||||
"tui-term",
|
||||
"unicode-width 0.2.0",
|
||||
"vt100-ctt",
|
||||
"zips",
|
||||
]
|
||||
|
||||
|
@ -1096,7 +1097,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "72af159125ce32b02ceaced6cffae6394b0e6b6dfd4dc164a6c59a2db9b3c0b0"
|
||||
dependencies = [
|
||||
"ratatui",
|
||||
"vt100",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1147,9 +1147,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "vt100"
|
||||
version = "0.15.2"
|
||||
source = "git+https://github.com/ChrisTitusTech/vt100-rust#e41fb3d8fb5fd01dd2d076c9a25823a31656012f"
|
||||
name = "vt100-ctt"
|
||||
version = "0.15.3"
|
||||
source = "git+https://github.com/ChrisTitusTech/vt100-rust#39136a6232d043d8447afa7d47805b6f6baa09ee"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"log",
|
||||
|
|
|
@ -8,9 +8,6 @@ members = ["tui", "core", "xtask"]
|
|||
default-members = ["tui", "core"]
|
||||
resolver = "2"
|
||||
|
||||
[patch.crates-io]
|
||||
vt100 = { git = "https://github.com/ChrisTitusTech/vt100-rust" }
|
||||
|
||||
[profile.release]
|
||||
opt-level = "z"
|
||||
debug = false
|
||||
|
|
52
core/tabs/applications-setup/developer-tools/zed.sh
Normal file
52
core/tabs/applications-setup/developer-tools/zed.sh
Normal file
|
@ -0,0 +1,52 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../../common-script.sh
|
||||
|
||||
installZed() {
|
||||
if ! command_exists dev.zed.Zed && ! command_exists zed && ! command_exists zeditor; then
|
||||
printf "%b\n" "${CYAN}Installing Zed.${RC}"
|
||||
case "$PACKAGER" in
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add zed
|
||||
;;
|
||||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S zed
|
||||
;;
|
||||
zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" addrepo -f https://download.opensuse.org/repositories/editors/openSUSE_Tumbleweed/editors.repo
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y zed
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${YELLOW}No official package found for package manager $PACKAGER. Do you want to install flathub package or from source?${RC}"
|
||||
printf "%b\n" "1) Flathub package"
|
||||
printf "%b\n" "2) Source"
|
||||
printf "%b\n" "3) Exit"
|
||||
printf "%b" "Choose an option: "
|
||||
read -r choice
|
||||
case "$choice" in
|
||||
1)
|
||||
checkFlatpak
|
||||
flatpak install -y flathub dev.zed.Zed
|
||||
;;
|
||||
2)
|
||||
curl -f https://zed.dev/install.sh | sh
|
||||
;;
|
||||
3)
|
||||
printf "%b\n" "${GREEN}Exiting.${RC}"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Invalid option.${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
else
|
||||
printf "%b\n" "${GREEN}Zed is already installed.${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
checkEnv
|
||||
clear
|
||||
installZed
|
|
@ -51,37 +51,37 @@ 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"
|
||||
script = "developer-tools/githubdesktop.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "JetBrains Toolbox"
|
||||
description = "JetBrains Toolbox is a collection of tools and an app that help developers work with JetBrains products."
|
||||
script = "Developer-tools/jetbrains-toolbox.sh"
|
||||
script = "developer-tools/jetbrains-toolbox.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"
|
||||
script = "developer-tools/meld.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"
|
||||
script = "developer-tools/neovim.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"
|
||||
script = "developer-tools/ngrok.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"
|
||||
script = "developer-tools/sublime.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
|
@ -98,13 +98,19 @@ script = "communication-apps/zoom-setup.sh"
|
|||
[[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"
|
||||
script = "developer-tools/vscode.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"
|
||||
script = "developer-tools/vscodium.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Zed"
|
||||
description = "Zed is a next-generation code editor written in rust, designed for high-performance collaboration with humans and AI."
|
||||
script = "developer-tools/zed.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data]]
|
||||
|
|
|
@ -18,7 +18,7 @@ clap = { version = "4.5.20", features = ["derive", "std"], default-features = fa
|
|||
oneshot = { version = "0.1.8", features = ["std"], default-features = false }
|
||||
portable-pty = "0.8.1"
|
||||
ratatui = { version = "0.29.0", features = ["crossterm"], default-features = false }
|
||||
tui-term = "0.2.0"
|
||||
tui-term = { version = "0.2.0", default-features = false }
|
||||
temp-dir = "0.1.14"
|
||||
time = { version = "0.3.36", features = ["formatting", "local-offset", "macros"], default-features = false }
|
||||
unicode-width = { version = "0.2.0", default-features = false }
|
||||
|
@ -31,6 +31,7 @@ anstyle = { version = "1.0.8", default-features = false }
|
|||
ansi-to-tui = { version = "7.0.0", default-features = false }
|
||||
zips = "0.1.7"
|
||||
nix = { version = "0.29.0", features = [ "user" ] }
|
||||
vt100-ctt = { git = "https://github.com/ChrisTitusTech/vt100-rust" }
|
||||
|
||||
[[bin]]
|
||||
name = "linutil"
|
||||
|
|
|
@ -18,10 +18,9 @@ use std::{
|
|||
thread::JoinHandle,
|
||||
};
|
||||
use time::{macros::format_description, OffsetDateTime};
|
||||
use tui_term::{
|
||||
vt100::{self, Screen},
|
||||
widget::PseudoTerminal,
|
||||
};
|
||||
use tui_term::widget::PseudoTerminal;
|
||||
use vt100_ctt::{Parser, Screen};
|
||||
|
||||
pub struct RunningCommand {
|
||||
/// A buffer to save all the command output (accumulates, until the command exits)
|
||||
buffer: Arc<Mutex<Vec<u8>>>,
|
||||
|
@ -285,7 +284,7 @@ impl RunningCommand {
|
|||
// Process the buffer with a parser with the current screen size
|
||||
// We don't actually need to create a new parser every time, but it is so much easier this
|
||||
// way, and doesn't cost that much
|
||||
let mut parser = vt100::Parser::new(size.height, size.width, 1000);
|
||||
let mut parser = Parser::new(size.height, size.width, 1000);
|
||||
let mutex = self.buffer.lock();
|
||||
let buffer = mutex.as_ref().unwrap();
|
||||
parser.process(buffer);
|
||||
|
|
Loading…
Reference in New Issue
Block a user