Compare commits

...

6 Commits

Author SHA1 Message Date
D7OM
c9c8dc0b71
Merge aa11f2756d into fa69885b6c 2024-11-16 18:01:59 -07:00
Jeevitha Kannan K S
fa69885b6c
Use vt100-ctt instead of patching the dep (#952)
Thanks @a-kenji
2024-11-16 15:07:22 -06:00
d7omdev
aa11f2756d Merge branch 'main' of https://github.com/d7omdev/linutil 2024-11-12 18:31:35 +03:00
d7omdev
a810a9e238 Revert changes to docs/userguide.md 2024-11-12 18:30:26 +03:00
D7OM
17d486818e
Update core/tabs/applications-setup/browsers/zen-browser.sh
Co-authored-by: Jeevitha Kannan K S <ksjeevithakannan123@gmail.com>
2024-11-12 18:22:19 +03:00
d7omdev
462917c5ea Zen Browser installation
- Added Zen Browser to Web Browsers tab.
2024-11-12 15:13:32 +03:00
6 changed files with 46 additions and 14 deletions

8
Cargo.lock generated
View File

@ -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",

View File

@ -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

View File

@ -0,0 +1,29 @@
#!/bin/sh -e
. ../../common-script.sh
installZenBrowser() {
if ! command_exists io.github.zen_browser.zen && ! command_exists zen-browser; then
printf "%b\n" "${YELLOW}Installing Zen Browser...${RC}"
case "$PACKAGER" in
pacman)
if grep -q avx2 /proc/cpuinfo; then
"$AUR_HELPER" -S --needed --noconfirm zen-browser-avx2-bin
else
"$AUR_HELPER" -S --needed --noconfirm zen-browser-bin
fi
;;
*)
checkFlatpak
flatpak install -y flathub io.github.zen_browser.zen
;;
esac
else
printf "%b\n" "${GREEN}Zen Browser is already installed.${RC}"
fi
}
checkEnv
checkEscalationTool
checkAURHelper
installZenBrowser

View File

@ -191,6 +191,12 @@ description = "Mozilla Firefox is a free and open-source web browser developed b
script = "browsers/firefox.sh"
task_list = "I"
[[data.entries]]
name = "Zen Browser"
description = "Zen Browser is a privacy-focused web browser designed for enhanced security and a seamless browsing experience."
script = "browsers/zen-browser.sh"
task_list = "I"
[[data.entries]]
name = "Thorium"
description = "Thorium is a Chromium-based browser focused on privacy and performance."
@ -335,4 +341,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. This command installs ZSH prompt and provides basic configuration."
script = "zsh-setup.sh"
task_list = "I FM"
task_list = "I FM"

View File

@ -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"

View File

@ -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);