mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-23 13:45:19 +00:00
Compare commits
18 Commits
b64d8a464a
...
7c751141a9
Author | SHA1 | Date | |
---|---|---|---|
|
7c751141a9 | ||
|
9ce3dea995 | ||
|
f5f38243f0 | ||
|
51e2cbd607 | ||
|
b36a7df11c | ||
|
9f0863729f | ||
|
e8e1a36a63 | ||
|
d033b0f36d | ||
|
472c85eb79 | ||
|
629b1290be | ||
|
cb6e0f9cb6 | ||
|
159d2cb00f | ||
|
9dbb787ac5 | ||
|
1e39d967c5 | ||
|
e31622480b | ||
|
980365f7c9 | ||
|
2fd93fb707 | ||
|
8871610eb6 |
|
@ -1,2 +1,3 @@
|
|||
external-sources=true
|
||||
source=core/tabs/common-script.sh
|
||||
source=core/tabs/common-script.sh
|
||||
source=core/tabs/common-service-script.sh
|
118
Cargo.lock
generated
118
Cargo.lock
generated
|
@ -37,60 +37,16 @@ checksum = "67555e1f1ece39d737e28c8a017721287753af3f93225e4a445b29ccb0f5912c"
|
|||
dependencies = [
|
||||
"nom",
|
||||
"ratatui",
|
||||
"simdutf8",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anstream"
|
||||
version = "0.6.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"anstyle-parse",
|
||||
"anstyle-query",
|
||||
"anstyle-wincon",
|
||||
"colorchoice",
|
||||
"is_terminal_polyfill",
|
||||
"utf8parse",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anstyle"
|
||||
version = "1.0.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
|
||||
|
||||
[[package]]
|
||||
name = "anstyle-parse"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb"
|
||||
dependencies = [
|
||||
"utf8parse",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anstyle-query"
|
||||
version = "1.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a"
|
||||
dependencies = [
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anstyle-wincon"
|
||||
version = "3.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.88"
|
||||
|
@ -173,10 +129,8 @@ version = "4.5.20"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
"clap_lex",
|
||||
"strsim",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -197,12 +151,6 @@ version = "0.7.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
|
||||
|
||||
[[package]]
|
||||
name = "colorchoice"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
|
||||
|
||||
[[package]]
|
||||
name = "compact_str"
|
||||
version = "0.8.0"
|
||||
|
@ -250,9 +198,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
|
|||
|
||||
[[package]]
|
||||
name = "ego-tree"
|
||||
version = "0.6.3"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642"
|
||||
checksum = "7c6ba7d4eec39eaa9ab24d44a0e73a7949a1095a8b3f3abb11eddf27dbb56a53"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
|
@ -308,6 +256,12 @@ dependencies = [
|
|||
"allocator-api2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3"
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
version = "0.5.0"
|
||||
|
@ -350,12 +304,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.5.0"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5"
|
||||
checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown",
|
||||
"hashbrown 0.15.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -383,12 +337,6 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "is_terminal_polyfill"
|
||||
version = "1.70.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.13.0"
|
||||
|
@ -435,7 +383,6 @@ dependencies = [
|
|||
"ansi-to-tui",
|
||||
"anstyle",
|
||||
"clap",
|
||||
"ego-tree",
|
||||
"linutil_core",
|
||||
"oneshot",
|
||||
"portable-pty",
|
||||
|
@ -478,7 +425,7 @@ version = "0.12.4"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904"
|
||||
dependencies = [
|
||||
"hashbrown",
|
||||
"hashbrown 0.14.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -687,9 +634,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.5.4"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853"
|
||||
checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
]
|
||||
|
@ -877,24 +824,12 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simdutf8"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
||||
|
||||
[[package]]
|
||||
name = "smawk"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
|
@ -907,12 +842,6 @@ version = "0.1.9"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520"
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
||||
|
||||
[[package]]
|
||||
name = "strum"
|
||||
version = "0.26.3"
|
||||
|
@ -966,11 +895,6 @@ name = "textwrap"
|
|||
version = "0.16.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
|
||||
dependencies = [
|
||||
"smawk",
|
||||
"unicode-linebreak",
|
||||
"unicode-width 0.1.14",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
|
@ -1015,9 +939,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.22.20"
|
||||
version = "0.22.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
|
||||
checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"serde",
|
||||
|
@ -1084,12 +1008,6 @@ version = "1.0.13"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-linebreak"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-segmentation"
|
||||
version = "1.11.0"
|
||||
|
@ -1278,9 +1196,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.6.18"
|
||||
version = "0.6.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
|
||||
checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
|
|
@ -3,9 +3,6 @@ license = "MIT"
|
|||
version = "24.9.28"
|
||||
edition = "2021"
|
||||
|
||||
[workspace.dependencies]
|
||||
ego-tree = "0.6.2"
|
||||
|
||||
[workspace]
|
||||
members = ["tui", "core", "xtask"]
|
||||
default-members = ["tui", "core"]
|
||||
|
|
50
README.md
50
README.md
|
@ -24,6 +24,26 @@ curl -fsSL https://christitus.com/linux | sh
|
|||
```bash
|
||||
curl -fsSL https://christitus.com/linuxdev | sh
|
||||
```
|
||||
<details>
|
||||
<summary>CLI arguments</summary>
|
||||
|
||||
Linutil supports various command-line arguments to customize its behavior. Here are some common arguments you can use:
|
||||
|
||||
- `-t, --theme <THEME>` : Set the theme to use in the application [default: default] [possible values: default, compatible].
|
||||
- `--override-validation` : Show all available options, disregarding compatibility checks (UNSAFE).
|
||||
- `-h, --help` : Print help.
|
||||
|
||||
For more detailed usage, run:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://christitus.com/linux | sh -s -- --help
|
||||
```
|
||||
|
||||
```bash
|
||||
linutil --help
|
||||
```
|
||||
</details>
|
||||
|
||||
## ⬇️ Installation
|
||||
|
||||
Linutil is also available as a package in various repositories:
|
||||
|
@ -58,7 +78,15 @@ paru -S linutil
|
|||
Replace `paru` with your preferred helper and `linutil` with your preferred package.
|
||||
|
||||
</details>
|
||||
<details>
|
||||
<summary>OpenSUSE</summary>
|
||||
|
||||
Linutil can be installed on OpenSUSE with:
|
||||
```bash
|
||||
sudo zypper install linutil
|
||||
```
|
||||
|
||||
</details>
|
||||
<details>
|
||||
<summary>Cargo</summary>
|
||||
|
||||
|
@ -72,6 +100,28 @@ Note that crates installed using `cargo install` require manual updating with `c
|
|||
|
||||
</details>
|
||||
|
||||
## Configuration
|
||||
|
||||
Linutil supports configuration through a TOML config file. Path to the file can be specified with `--config` (or `-c`).
|
||||
|
||||
Available options:
|
||||
- `auto_execute` - a list of commands to execute automatically (can be combined with `--skip-confirmation`)
|
||||
|
||||
Example config:
|
||||
```toml
|
||||
# example_config.toml
|
||||
|
||||
auto_execute = [
|
||||
"Fastfetch",
|
||||
"Alacritty",
|
||||
"Kitty"
|
||||
]
|
||||
```
|
||||
|
||||
```bash
|
||||
linutil --config /path/to/example_config.toml
|
||||
```
|
||||
|
||||
## 💖 Support
|
||||
|
||||
If you find Linutil helpful, please consider giving it a ⭐️ to show your support!
|
||||
|
|
|
@ -5,11 +5,7 @@ repository = "https://github.com/ChrisTitusTech/linutil/tree/main/core"
|
|||
edition = "2021"
|
||||
version.workspace = true
|
||||
license.workspace = true
|
||||
include = [
|
||||
"src/*.rs",
|
||||
"Cargo.toml",
|
||||
"tabs/**",
|
||||
]
|
||||
include = ["src/*.rs", "Cargo.toml", "tabs/**"]
|
||||
|
||||
[dependencies]
|
||||
include_dir = "0.7.4"
|
||||
|
@ -17,4 +13,4 @@ temp-dir = "0.1.14"
|
|||
serde = { version = "1.0.205", features = ["derive"], default-features = false }
|
||||
toml = { version = "0.8.19", features = ["parse"], default-features = false }
|
||||
which = "6.0.3"
|
||||
ego-tree = { workspace = true }
|
||||
ego-tree = "0.9.0"
|
||||
|
|
28
core/src/config.rs
Normal file
28
core/src/config.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
use serde::Deserialize;
|
||||
use std::path::Path;
|
||||
use std::process;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct Config {
|
||||
pub auto_execute: Vec<String>,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn from_file(path: &Path) -> Self {
|
||||
let content = match std::fs::read_to_string(path) {
|
||||
Ok(content) => content,
|
||||
Err(e) => {
|
||||
eprintln!("Failed to read config file {}: {}", path.display(), e);
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
match toml::from_str(&content) {
|
||||
Ok(config) => config,
|
||||
Err(e) => {
|
||||
eprintln!("Failed to parse config file: {}", e);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
mod config;
|
||||
mod inner;
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
pub use ego_tree;
|
||||
use ego_tree::Tree;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub use config::Config;
|
||||
pub use inner::{get_tabs, TabList};
|
||||
|
||||
#[derive(Clone, Hash, Eq, PartialEq)]
|
||||
|
@ -33,3 +36,16 @@ pub struct ListNode {
|
|||
pub task_list: String,
|
||||
pub multi_select: bool,
|
||||
}
|
||||
|
||||
impl Tab {
|
||||
pub fn find_command(&self, name: &str) -> Option<Rc<ListNode>> {
|
||||
self.tree.root().descendants().find_map(|node| {
|
||||
let value = node.value();
|
||||
if value.name == name && !node.has_children() {
|
||||
Some(value.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,9 @@ installMeld() {
|
|||
apt-get|nala)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -y install meld
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add meld
|
||||
;;
|
||||
*)
|
||||
checkFlatpak
|
||||
flatpak install -y flathub org.gnome.meld
|
||||
|
|
|
@ -29,6 +29,9 @@ installNeovim() {
|
|||
dnf|zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add neovim ripgrep fzf py3-virtualenv luarocks go shellcheck git
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. ../../common-script.sh
|
||||
|
||||
installVsCode() {
|
||||
if ! command_exists code; then
|
||||
if ! command_exists com.visualstudio.code && ! command_exists code; then
|
||||
printf "%b\n" "${YELLOW}Installing VS Code..${RC}."
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
|
@ -28,6 +28,10 @@ installVsCode() {
|
|||
printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | "$ESCALATION_TOOL" tee /etc/yum.repos.d/vscode.repo > /dev/null
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y code
|
||||
;;
|
||||
apk)
|
||||
checkFlatpak
|
||||
flatpak install -y flathub com.visualstudio.code
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. ../../common-script.sh
|
||||
|
||||
installVsCodium() {
|
||||
if ! command_exists codium; then
|
||||
if ! command_exists com.vscodium.codium && ! command_exists codium; then
|
||||
printf "%b\n" "${YELLOW}Installing VS Codium...${RC}"
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
|
@ -26,6 +26,10 @@ installVsCodium() {
|
|||
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/yum.repos.d/vscodium.repo
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
|
||||
;;
|
||||
apk)
|
||||
checkFlatpak
|
||||
flatpak install -y flathub com.vscodium.codium
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -9,6 +9,9 @@ installAlacritty() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add alacritty
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
|
||||
;;
|
||||
|
|
|
@ -15,6 +15,9 @@ install_adb() {
|
|||
dnf|zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add android-tools
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. ../../common-script.sh
|
||||
|
||||
installBrave() {
|
||||
if ! command_exists brave; then
|
||||
if ! command_exists com.brave.Browser && ! command_exists brave; then
|
||||
printf "%b\n" "${YELLOW}Installing Brave...${RC}"
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
|
@ -29,6 +29,10 @@ installBrave() {
|
|||
"$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser
|
||||
;;
|
||||
apk)
|
||||
checkFlatpak
|
||||
flatpak install -y flathub com.brave.Browser
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -9,6 +9,9 @@ if ! command_exists chromium; then
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add chromium
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium
|
||||
;;
|
||||
|
|
|
@ -18,6 +18,9 @@ installFirefox() {
|
|||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add firefox
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. ../../common-script.sh
|
||||
|
||||
installLibreWolf() {
|
||||
if ! command_exists librewolf; then
|
||||
if ! command_exists io.gitlab.librewolf-community && ! command_exists librewolf; then
|
||||
printf "%b\n" "${YELLOW}Installing Librewolf...${RC}"
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
|
@ -32,6 +32,10 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/
|
|||
pacman)
|
||||
"$AUR_HELPER" -S --needed --noconfirm librewolf-bin
|
||||
;;
|
||||
apk)
|
||||
checkFlatpak
|
||||
flatpak install flathub io.gitlab.librewolf-community
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -9,6 +9,9 @@ installLynx() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add lynx
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx
|
||||
;;
|
||||
|
|
|
@ -22,6 +22,7 @@ installThrorium() {
|
|||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
|
|
34
core/tabs/applications-setup/browsers/tor-browser.sh
Normal file
34
core/tabs/applications-setup/browsers/tor-browser.sh
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../../common-script.sh
|
||||
|
||||
installTorBrowser() {
|
||||
if ! command_exists torbrowser-launcher; then
|
||||
printf "%b\n" "${YELLOW}Installing Tor Browser...${RC}"
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y torbrowser-launcher
|
||||
;;
|
||||
zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install torbrowser-launcher
|
||||
;;
|
||||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm torbrowser-launcher
|
||||
;;
|
||||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y torbrowser-launcher
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
printf "%b\n" "${GREEN}Tor Browser is already installed.${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
installTorBrowser
|
||||
|
|
@ -3,14 +3,14 @@
|
|||
. ../../common-script.sh
|
||||
|
||||
installWaterfox() {
|
||||
if ! command_exists waterfox; then
|
||||
if ! command_exists net.waterfox.waterfox && ! command_exists waterfox; then
|
||||
printf "%b\n" "${YELLOW}Installing waterfox...${RC}"
|
||||
case "$PACKAGER" in
|
||||
pacman)
|
||||
"$AUR_HELPER" -S --needed --noconfirm waterfox-bin
|
||||
"$AUR_HELPER" -S --needed --noconfirm waterfox-bin
|
||||
;;
|
||||
*)
|
||||
. ../setup-flatpak.sh
|
||||
checkFlatpak
|
||||
flatpak install -y flathub net.waterfox.waterfox
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. ../../common-script.sh
|
||||
|
||||
installDiscord() {
|
||||
if ! command_exists discord; then
|
||||
if ! command_exists com.discordapp.Discord && ! command_exists discord; then
|
||||
printf "%b\n" "${YELLOW}Installing Discord...${RC}"
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
|
@ -20,6 +20,10 @@ installDiscord() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y discord
|
||||
;;
|
||||
apk)
|
||||
checkFlatpak
|
||||
flatpak install -y flathub com.discordapp.Discord
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. ../../common-script.sh
|
||||
|
||||
installJitsi() {
|
||||
if ! command_exists jitsi-meet; then
|
||||
if ! command_exists org.jitsi.jitsi-meet && ! command_exists jitsi-meet; then
|
||||
printf "%b\n" "${YELLOW}Installing Jitsi meet...${RC}"
|
||||
case "$PACKAGER" in
|
||||
apt-get|nala)
|
||||
|
@ -21,6 +21,10 @@ installJitsi() {
|
|||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet
|
||||
;;
|
||||
apk)
|
||||
checkFlatpak
|
||||
flatpak install flathub org.jitsi.jitsi-meet
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -23,6 +23,10 @@ installSignal() {
|
|||
checkFlatpak
|
||||
flatpak install -y flathub org.signal.Signal
|
||||
;;
|
||||
apk)
|
||||
checkFlatpak
|
||||
flatpak install -y flathub org.signal.Signal
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -9,6 +9,9 @@ installTelegram() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm telegram-desktop
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add telegram-desktop
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop
|
||||
;;
|
||||
|
|
|
@ -9,6 +9,9 @@ installThunderBird() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add thunderbird
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird
|
||||
;;
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../../common-script.sh
|
||||
|
||||
installZapZap() {
|
||||
if ! command_exists com.rtosta.zapzap && ! command_exists zapzap; then
|
||||
printf "%b\n" "${YELLOW}Installing Zap-Zap...${RC}"
|
||||
case "$PACKAGER" in
|
||||
pacman)
|
||||
"$AUR_HELPER" -S --needed --noconfirm zapzap
|
||||
;;
|
||||
*)
|
||||
checkFlatpak
|
||||
flatpak install flathub com.rtosta.zapzap
|
||||
;;
|
||||
esac
|
||||
else
|
||||
printf "%b\n" "${GREEN}Zap-Zap is already installed.${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
checkEnv
|
||||
installZapZap
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../common-script.sh
|
||||
. ../common-service-script.sh
|
||||
|
||||
# Function to prompt the user for installation choice
|
||||
choose_installation() {
|
||||
clear
|
||||
printf "%b\n" "${YELLOW}Choose what to install:${RC}"
|
||||
printf "%b\n" "1. ${YELLOW}Docker${RC}"
|
||||
printf "%b\n" "2. ${YELLOW}Docker Compose${RC}"
|
||||
|
@ -34,19 +34,20 @@ install_docker() {
|
|||
;;
|
||||
zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker
|
||||
"$ESCALATION_TOOL" systemctl enable docker
|
||||
"$ESCALATION_TOOL" systemctl start docker
|
||||
;;
|
||||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm docker
|
||||
"$ESCALATION_TOOL" systemctl enable docker
|
||||
"$ESCALATION_TOOL" systemctl start docker
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add docker
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
startAndEnableService docker
|
||||
}
|
||||
|
||||
install_docker_compose() {
|
||||
|
@ -66,6 +67,9 @@ install_docker_compose() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm docker-compose
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add docker-cli-compose
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -6,7 +6,7 @@ setupDWM() {
|
|||
printf "%b\n" "${YELLOW}Installing DWM-Titus...${RC}"
|
||||
case "$PACKAGER" in # Install pre-Requisites
|
||||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel libx11 libxinerama libxft imlib2 libxcb git unzip flameshot lxappearance feh mate-polkit
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel libx11 libxinerama libxft imlib2 libxcb git unzip flameshot lxappearance feh mate-polkit meson libev uthash libconfig
|
||||
;;
|
||||
apt-get|nala)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y build-essential libx11-dev libxinerama-dev libxft-dev libimlib2-dev libx11-xcb-dev libfontconfig1 libx11-6 libxft2 libxinerama1 libxcb-res0-dev git unzip flameshot lxappearance feh mate-polkit
|
||||
|
|
|
@ -14,6 +14,9 @@ installFastfetch() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
|
||||
rm /tmp/fastfetch.deb
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add fastfetch
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
|
||||
;;
|
||||
|
|
|
@ -9,6 +9,9 @@ installKitty() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm kitty
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add kitty
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y kitty
|
||||
;;
|
||||
|
|
|
@ -25,6 +25,10 @@ installLinutil() {
|
|||
esac
|
||||
printf "%b\n" "${GREEN}Installed successfully.${RC}"
|
||||
;;
|
||||
zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install linutil -y
|
||||
printf "%b\n" "${GREEN}Installed successfully.${RC}"
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}There are no official packages for your distro.${RC}"
|
||||
printf "%b" "${YELLOW}Do you want to install the crates.io package? (y/N): ${RC}"
|
||||
|
@ -40,10 +44,12 @@ installLinutil() {
|
|||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y curl rustup man-pages man-db man
|
||||
;;
|
||||
zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
. $HOME/.cargo/env
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add build-base
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add rustup
|
||||
rustup-init
|
||||
# shellcheck disable=SC1091
|
||||
. "$HOME/.cargo/env"
|
||||
;;
|
||||
*)
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
|
|
|
@ -19,6 +19,13 @@ updateLinutil() {
|
|||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
. $HOME/.cargo/env
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add build-base
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add rustup
|
||||
rustup-init
|
||||
# shellcheck disable=SC1091
|
||||
. "$HOME/.cargo/env"
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
|
||||
;;
|
||||
|
|
|
@ -11,6 +11,9 @@ installDepend() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add bash bash-completion tar bat tree unzip fontconfig git
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
|
||||
;;
|
||||
|
@ -54,7 +57,7 @@ installStarshipAndFzf() {
|
|||
return
|
||||
fi
|
||||
|
||||
if ! curl -sSL https://starship.rs/install.sh | sh; then
|
||||
if ! curl -sSL https://starship.rs/install.sh | "$ESCALATION_TOOL" sh; then
|
||||
printf "%b\n" "${RED}Something went wrong during starship install!${RC}"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -16,6 +16,9 @@ installLibreOffice() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add libreoffice
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -9,6 +9,9 @@ installEvince() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm evince
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add evince
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y evince
|
||||
;;
|
||||
|
|
|
@ -9,6 +9,9 @@ installOkular() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm okular
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add okular
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y okular
|
||||
;;
|
||||
|
|
|
@ -9,6 +9,9 @@ installRofi() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rofi
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add rofi
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y rofi
|
||||
;;
|
||||
|
|
|
@ -84,6 +84,17 @@ description = "Sublime Text is a fast, lightweight, and customizable text editor
|
|||
script = "Developer-tools/sublime-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "ZapZap"
|
||||
description = "ZapZap is an open source whatsapp desktop client for Linux users developed by rafatosta."
|
||||
script = "communication-apps/zapzap-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"
|
||||
|
||||
[[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."
|
||||
|
@ -192,6 +203,12 @@ description = "Vivaldi is a freeware, cross-platform web browser developed by Vi
|
|||
script = "browsers/vivaldi.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Tor Browser"
|
||||
description = "Tor Browser is a free and open-source firefox-based web browser designed for anonymity and censorship circumvention."
|
||||
script = "browsers/tor-browser.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "waterfox"
|
||||
description = "Waterfox is the privacy-focused web browser engineered to give you speed, control, and peace of mind on the internet."
|
||||
|
@ -279,7 +296,7 @@ task_list = "I"
|
|||
[[data.preconditions]]
|
||||
matches = false
|
||||
data = "command_exists"
|
||||
values = [ "linutil" ]
|
||||
values = ["linutil"]
|
||||
|
||||
[[data]]
|
||||
name = "Linutil Updater"
|
||||
|
@ -290,7 +307,7 @@ task_list = "I"
|
|||
[[data.preconditions]]
|
||||
matches = true
|
||||
data = "command_exists"
|
||||
values = [ "linutil" ]
|
||||
values = ["linutil"]
|
||||
|
||||
[[data]]
|
||||
name = "Rofi"
|
||||
|
@ -306,7 +323,7 @@ task_list = "I SS"
|
|||
[[data.preconditions]]
|
||||
matches = true
|
||||
data = { environment = "XDG_SESSION_TYPE" }
|
||||
values = [ "wayland", "Wayland" ]
|
||||
values = ["wayland", "Wayland"]
|
||||
|
||||
[[data]]
|
||||
name = "ZSH Prompt"
|
||||
|
|
|
@ -10,6 +10,9 @@ installZsh() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add zsh
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh
|
||||
;;
|
||||
|
|
|
@ -123,6 +123,12 @@ checkPackageManager() {
|
|||
fi
|
||||
done
|
||||
|
||||
## Enable apk community packages
|
||||
if [ "$PACKAGER" = "apk" ] && grep -qE '^#.*community' /etc/apk/repositories; then
|
||||
"$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories
|
||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||
fi
|
||||
|
||||
if [ -z "$PACKAGER" ]; then
|
||||
printf "%b\n" "${RED}Can't find a supported package manager${RC}"
|
||||
exit 1
|
||||
|
@ -169,7 +175,7 @@ checkEnv() {
|
|||
checkArch
|
||||
checkEscalationTool
|
||||
checkCommandRequirements "curl groups $ESCALATION_TOOL"
|
||||
checkPackageManager 'nala apt-get dnf pacman zypper'
|
||||
checkPackageManager 'nala apt-get dnf pacman zypper apk'
|
||||
checkCurrentDirectoryWritable
|
||||
checkSuperUser
|
||||
checkDistro
|
||||
|
|
85
core/tabs/common-service-script.sh
Normal file
85
core/tabs/common-service-script.sh
Normal file
|
@ -0,0 +1,85 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
checkInitManager() {
|
||||
for manager in $1; do
|
||||
if command_exists "$manager"; then
|
||||
INIT_MANAGER="$manager"
|
||||
printf "%b\n" "${CYAN}Using ${manager} to interact with init system${RC}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$INIT_MANAGER" ]; then
|
||||
printf "%b\n" "${RED}Can't find a supported init system${RC}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
startService() {
|
||||
case "$INIT_MANAGER" in
|
||||
systemctl)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" start "$1"
|
||||
;;
|
||||
rc-service)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
stopService() {
|
||||
case "$INIT_MANAGER" in
|
||||
systemctl)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" stop "$1"
|
||||
;;
|
||||
rc-service)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
enableService() {
|
||||
case "$INIT_MANAGER" in
|
||||
systemctl)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" enable "$1"
|
||||
;;
|
||||
rc-service)
|
||||
"$ESCALATION_TOOL" rc-update add "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
disableService() {
|
||||
case "$INIT_MANAGER" in
|
||||
systemctl)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" disable "$1"
|
||||
;;
|
||||
rc-service)
|
||||
"$ESCALATION_TOOL" rc-update del "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
startAndEnableService() {
|
||||
case "$INIT_MANAGER" in
|
||||
systemctl)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1"
|
||||
;;
|
||||
rc-service)
|
||||
enableService "$1"
|
||||
startService "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
isServiceActive() {
|
||||
case "$INIT_MANAGER" in
|
||||
systemctl)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" is-active --quiet "$1"
|
||||
;;
|
||||
rc-service)
|
||||
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
checkInitManager 'systemctl rc-service'
|
|
@ -9,6 +9,9 @@ installPkg() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm ufw
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add ufw
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y ufw
|
||||
;;
|
||||
|
|
104
core/tabs/system-setup/arch/virtualization.sh
Executable file
104
core/tabs/system-setup/arch/virtualization.sh
Executable file
|
@ -0,0 +1,104 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../../common-script.sh
|
||||
|
||||
installQEMUDesktop() {
|
||||
if ! command_exists qemu-img; then
|
||||
printf "%b\n" "${YELLOW}Installing QEMU.${RC}"
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qemu-desktop
|
||||
else
|
||||
printf "%b\n" "${GREEN}QEMU is already installed.${RC}"
|
||||
fi
|
||||
checkKVM
|
||||
}
|
||||
|
||||
installQEMUEmulators() {
|
||||
if ! "$PACKAGER" -Q | grep -q "qemu-emulators-full "; then
|
||||
printf "%b\n" "${YELLOW}Installing QEMU-Emulators.${RC}"
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qemu-emulators-full swtpm
|
||||
else
|
||||
printf "%b\n" "${GREEN}QEMU-Emulators already installed.${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
installVirtManager() {
|
||||
if ! command_exists virt-manager; then
|
||||
printf "%b\n" "${YELLOW}Installing Virt-Manager.${RC}"
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm virt-manager
|
||||
else
|
||||
printf "%b\n" "${GREEN}Virt-Manager already installed.${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
checkKVM() {
|
||||
if [ ! -e "/dev/kvm" ]; then
|
||||
printf "%b\n" "${RED}KVM is not available. Make sure you have CPU virtualization support enabled in your BIOS/UEFI settings. Please refer https://wiki.archlinux.org/title/KVM for more information.${RC}"
|
||||
else
|
||||
"$ESCALATION_TOOL" usermod "$USER" -aG kvm
|
||||
fi
|
||||
}
|
||||
|
||||
setupLibvirt() {
|
||||
printf "%b\n" "${YELLOW}Configuring Libvirt.${RC}"
|
||||
if "$PACKAGER" -Q | grep -q "iptables "; then
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -Rdd --noconfirm iptables
|
||||
fi
|
||||
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm dnsmasq iptables-nft
|
||||
"$ESCALATION_TOOL" sed -i 's/^#\?firewall_backend\s*=\s*".*"/firewall_backend = "iptables"/' "/etc/libvirt/network.conf"
|
||||
|
||||
if systemctl is-active --quiet polkit; then
|
||||
"$ESCALATION_TOOL" sed -i 's/^#\?auth_unix_ro\s*=\s*".*"/auth_unix_ro = "polkit"/' "/etc/libvirt/libvirtd.conf"
|
||||
"$ESCALATION_TOOL" sed -i 's/^#\?auth_unix_rw\s*=\s*".*"/auth_unix_rw = "polkit"/' "/etc/libvirt/libvirtd.conf"
|
||||
fi
|
||||
|
||||
"$ESCALATION_TOOL" usermod "$USER" -aG libvirt
|
||||
|
||||
for value in libvirt libvirt_guest; do
|
||||
if ! grep -wq "$value" /etc/nsswitch.conf; then
|
||||
"$ESCALATION_TOOL" sed -i "/^hosts:/ s/$/ ${value}/" /etc/nsswitch.conf
|
||||
fi
|
||||
done
|
||||
|
||||
"$ESCALATION_TOOL" systemctl enable --now libvirtd.service
|
||||
"$ESCALATION_TOOL" virsh net-autostart default
|
||||
|
||||
checkKVM
|
||||
}
|
||||
|
||||
installLibvirt() {
|
||||
if ! command_exists libvirtd; then
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libvirt dmidecode
|
||||
else
|
||||
printf "%b\n" "${GREEN}Libvirt is already installed.${RC}"
|
||||
fi
|
||||
setupLibvirt
|
||||
}
|
||||
|
||||
main() {
|
||||
printf "%b\n" "${YELLOW}Choose what to install:${RC}"
|
||||
printf "%b\n" "1. ${YELLOW}QEMU${RC}"
|
||||
printf "%b\n" "2. ${YELLOW}QEMU-Emulators ( Extended architectures )${RC}"
|
||||
printf "%b\n" "3. ${YELLOW}Libvirt${RC}"
|
||||
printf "%b\n" "4. ${YELLOW}Virtual-Manager${RC}"
|
||||
printf "%b\n" "5. ${YELLOW}All${RC}"
|
||||
printf "%b" "Enter your choice [1-5]: "
|
||||
read -r CHOICE
|
||||
case "$CHOICE" in
|
||||
1) installQEMUDesktop ;;
|
||||
2) installQEMUEmulators ;;
|
||||
3) installLibvirt ;;
|
||||
4) installVirtManager ;;
|
||||
5)
|
||||
installQEMUDesktop
|
||||
installQEMUEmulators
|
||||
installLibvirt
|
||||
installVirtManager
|
||||
;;
|
||||
*) printf "%b\n" "${RED}Invalid choice.${RC}" && exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
main
|
|
@ -37,6 +37,9 @@ installDepend() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
|
||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add build-base multitail tar tree trash-cli unzip cmake jq
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
||||
;;
|
||||
|
|
|
@ -50,7 +50,8 @@ installDepend() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
||||
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@ -95,6 +96,8 @@ installAdditionalDepend() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../common-script.sh
|
||||
. ../common-service-script.sh
|
||||
|
||||
cleanup_system() {
|
||||
printf "%b\n" "${YELLOW}Performing system cleanup...${RC}"
|
||||
|
@ -23,6 +24,9 @@ cleanup_system() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" cache clean
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
|
||||
;;
|
||||
|
@ -39,7 +43,9 @@ common_cleanup() {
|
|||
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
|
||||
if [ "$INIT_MANAGER" = "systemctl" ]; then
|
||||
"$ESCALATION_TOOL" journalctl --vacuum-time=3d
|
||||
fi
|
||||
}
|
||||
|
||||
clean_data() {
|
||||
|
|
|
@ -48,6 +48,9 @@ fastUpdate() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" ref
|
||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||
exit 1
|
||||
|
@ -74,6 +77,9 @@ updateSystem() {
|
|||
"$ESCALATION_TOOL" "$PACKAGER" ref
|
||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" upgrade
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -38,6 +38,12 @@ description = "Paru is your standard pacman wrapping AUR helper with lots of fea
|
|||
script = "arch/paru-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Virtualization"
|
||||
description = "QEMU, Libvirt, Virt-Manager installation and configuration."
|
||||
script = "arch/virtualization.sh"
|
||||
task_list = "FM I SS RP"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Yay AUR Helper"
|
||||
description = "Yet Another Yogurt - An AUR Helper Written in Go. To know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../common-script.sh
|
||||
. ../common-service-script.sh
|
||||
|
||||
# Function to check Bluez is installed
|
||||
setupBluetooth() {
|
||||
|
@ -10,6 +11,9 @@ setupBluetooth() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm bluez-utils
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add bluez
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y bluez
|
||||
;;
|
||||
|
@ -18,15 +22,7 @@ setupBluetooth() {
|
|||
printf "%b\n" "${GREEN}Bluez is already installed.${RC}"
|
||||
fi
|
||||
|
||||
# Check if bluetooth service is running
|
||||
if ! systemctl is-active --quiet bluetooth; then
|
||||
printf "%b\n" "${YELLOW}Bluetooth service is not running. Starting it now...${RC}"
|
||||
"$ESCALATION_TOOL" systemctl start bluetooth
|
||||
|
||||
if systemctl is-active --quiet bluetooth; then
|
||||
printf "%b\n" "${GREEN}Bluetooth service started successfully.${RC}"
|
||||
fi
|
||||
fi
|
||||
startService bluetooth
|
||||
}
|
||||
|
||||
# Function to display the main menu
|
||||
|
|
|
@ -12,6 +12,7 @@ list_devices() {
|
|||
printf "\n"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
installDependencies() {
|
||||
DEPENDENCIES="xz gzip bzip2 jq"
|
||||
if ! command_exists ${DEPENDENCIES}; then
|
||||
|
@ -23,6 +24,8 @@ installDependencies() {
|
|||
"${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES};;
|
||||
pacman)
|
||||
"${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES};;
|
||||
apk)
|
||||
"${ESCALATION_TOOL}" "${PACKAGER}" add ${DEPENDENCIES};;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager.${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -19,6 +19,9 @@ if ! command_exists openssl; then
|
|||
zypper)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install openssl
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add openssl
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||
exit 1
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../common-script.sh
|
||||
. ../common-service-script.sh
|
||||
|
||||
create_file() {
|
||||
printf "%b\n" "Creating script..."
|
||||
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
|
||||
printf "%b\n" "Creating script..."
|
||||
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
for tty in /dev/tty{1..6}
|
||||
|
@ -13,12 +14,12 @@ do
|
|||
done
|
||||
EOF
|
||||
|
||||
"$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock
|
||||
"$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock
|
||||
}
|
||||
|
||||
create_service() {
|
||||
printf "%b\n" "Creating service..."
|
||||
"$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
|
||||
printf "%b\n" "Creating service..."
|
||||
"$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
|
||||
[Unit]
|
||||
Description=numlock
|
||||
|
||||
|
@ -33,23 +34,28 @@ EOF
|
|||
}
|
||||
|
||||
numlockSetup() {
|
||||
if [ ! -f "/usr/local/bin/numlock" ]; then
|
||||
create_file
|
||||
fi
|
||||
if [ "$INIT_MANAGER" = "rc-service" ]; then
|
||||
printf "%b\n" "${RED}Unsupported init system.${RC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/systemd/system/numlock.service" ]; then
|
||||
create_service
|
||||
fi
|
||||
if [ ! -f "/usr/local/bin/numlock" ]; then
|
||||
create_file
|
||||
fi
|
||||
|
||||
printf "%b" "Do you want to enable Numlock on boot? (y/N): "
|
||||
read -r confirm
|
||||
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
|
||||
"$ESCALATION_TOOL" systemctl enable numlock.service --quiet
|
||||
printf "%b\n" "Numlock will be enabled on boot"
|
||||
else
|
||||
"$ESCALATION_TOOL" systemctl disable numlock.service --quiet
|
||||
printf "%b\n" "Numlock will not be enabled on boot"
|
||||
fi
|
||||
if [ ! -f "/etc/systemd/system/numlock.service" ]; then
|
||||
create_service
|
||||
fi
|
||||
|
||||
printf "%b" "Do you want to enable Numlock on boot? (y/N): "
|
||||
read -r confirm
|
||||
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
|
||||
enableService numlock
|
||||
printf "%b\n" "Numlock will be enabled on boot"
|
||||
else
|
||||
disableService numlock
|
||||
printf "%b\n" "Numlock will not be enabled on boot"
|
||||
fi
|
||||
}
|
||||
|
||||
checkEnv
|
||||
|
|
|
@ -10,8 +10,8 @@ installollama() {
|
|||
printf "%b\n" "${GREEN}ollama is already installed.${RC}"
|
||||
else
|
||||
printf "%b\n" "${YELLOW}Installing ollama...${RC}"
|
||||
curl -fsSL https://ollama.com/install.sh | sh
|
||||
"$ESCALATION_TOOL" systemctl start ollama
|
||||
curl -fsSL https://ollama.com/install.sh | "$ESCALATION_TOOL" sh
|
||||
"$ESCALATION_TOOL" startService ollama
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@ installAutoCpufreq() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm git
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add git
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y git
|
||||
;;
|
||||
|
|
27
core/tabs/utils/printers/install-cups.sh
Normal file
27
core/tabs/utils/printers/install-cups.sh
Normal file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../../common-script.sh
|
||||
|
||||
installCUPS() {
|
||||
clear
|
||||
|
||||
case "$PACKAGER" in
|
||||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm cups
|
||||
;;
|
||||
apt-get | nala)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y cups
|
||||
;;
|
||||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y cups
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
installCUPS
|
30
core/tabs/utils/printers/install-epson-printer-drivers.sh
Normal file
30
core/tabs/utils/printers/install-epson-printer-drivers.sh
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../../common-script.sh
|
||||
. ./install-cups.sh
|
||||
|
||||
installEpsonPrinterDriver() {
|
||||
clear
|
||||
|
||||
case "$PACKAGER" in
|
||||
pacman)
|
||||
"$AUR_HELPER" -S --noconfirm epson-inkjet-printer-escpr
|
||||
;;
|
||||
apt-get | nala)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y printer-driver-escpr
|
||||
;;
|
||||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y epson-inkjet-printer-escpr
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
checkAURHelper
|
||||
installCUPS
|
||||
installEpsonPrinterDriver
|
|
@ -11,6 +11,9 @@ install_package() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE"
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add "$PACKAGE"
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"
|
||||
;;
|
||||
|
@ -34,23 +37,23 @@ setup_ssh() {
|
|||
install_package openssh
|
||||
SSH_SERVICE="sshd"
|
||||
;;
|
||||
apk)
|
||||
install_package openssh
|
||||
SSH_SERVICE="sshd"
|
||||
;;
|
||||
*)
|
||||
install_package openssh-server
|
||||
SSH_SERVICE="sshd"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Enable and start the appropriate SSH service
|
||||
"$ESCALATION_TOOL" systemctl enable "$SSH_SERVICE"
|
||||
"$ESCALATION_TOOL" systemctl start "$SSH_SERVICE"
|
||||
startAndEnableService "$SSH_SERVICE"
|
||||
|
||||
# Get the local IP address
|
||||
LOCAL_IP=$(ip -4 addr show | awk '/inet / {print $2}' | tail -n 1)
|
||||
|
||||
printf "%b\n" "${GREEN}Your local IP address is: $LOCAL_IP${RC}"
|
||||
|
||||
# Check if SSH is running
|
||||
if systemctl is-active --quiet "$SSH_SERVICE"; then
|
||||
if isServiceActive "$SSH_SERVICE"; then
|
||||
printf "%b\n" "${GREEN}SSH is up and running.${RC}"
|
||||
else
|
||||
printf "%b\n" "${RED}Failed to start SSH.${RC}"
|
||||
|
@ -130,12 +133,11 @@ setup_samba() {
|
|||
EOL
|
||||
fi
|
||||
|
||||
# Enable and start Samba services
|
||||
"$ESCALATION_TOOL" systemctl enable smb nmb
|
||||
"$ESCALATION_TOOL" systemctl start smb nmb
|
||||
for service in smb nmb; do
|
||||
startAndEnableService "$service"
|
||||
done
|
||||
|
||||
# Check if Samba is running
|
||||
if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then
|
||||
if isServiceActive smb && isServiceActive nmb; then
|
||||
printf "%b\n" "${GREEN}Samba is up and running.${RC}"
|
||||
printf "%b\n" "${YELLOW}Samba share available at: $SHARED_DIR${RC}"
|
||||
else
|
||||
|
|
|
@ -76,6 +76,21 @@ name = "Set Resolution"
|
|||
description = "This script is designed to change the resolution of monitors connected to your system"
|
||||
script = "monitor-control/set_resolutions.sh"
|
||||
|
||||
[[data]]
|
||||
name = "Printers"
|
||||
|
||||
[[data.entries]]
|
||||
name = "CUPS"
|
||||
script = "printers/install-cups.sh"
|
||||
description = "This script will install the CUPS system, required for most printer drivers on Linux."
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Epson printer drivers"
|
||||
script = "printers/install-epson-printer-drivers.sh"
|
||||
description = "This script will install the Epson printer drivers."
|
||||
task_list = "I"
|
||||
|
||||
[[data]]
|
||||
name = "User Account Manager"
|
||||
multi_select = false
|
||||
|
|
|
@ -12,9 +12,12 @@ install_timeshift() {
|
|||
pacman)
|
||||
"$ESCALATION_TOOL" "${PACKAGER}" -S --noconfirm timeshift
|
||||
;;
|
||||
*)
|
||||
dnf|zypper|apt-get|nala)
|
||||
"$ESCALATION_TOOL" "${PACKAGER}" install -y timeshift
|
||||
;;
|
||||
*)
|
||||
printf "%b\n" "${RED}Unsupported package manager.${RC}"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
printf "%b\n" "${GREEN}Timeshift is already installed.${RC}"
|
||||
|
|
|
@ -13,6 +13,9 @@ setup_xrandr() {
|
|||
apt-get|nala)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y x11-xserver-utils
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add xrandr
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-server-utils
|
||||
;;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../common-script.sh
|
||||
. ../common-service-script.sh
|
||||
|
||||
# Function to check if NetworkManager is installed
|
||||
setupNetworkManager() {
|
||||
|
@ -13,6 +14,9 @@ setupNetworkManager() {
|
|||
dnf)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y NetworkManager-1
|
||||
;;
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add networkmanager-wifi iwd
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y network-manager
|
||||
;;
|
||||
|
@ -22,13 +26,11 @@ setupNetworkManager() {
|
|||
fi
|
||||
|
||||
# Check if NetworkManager service is running
|
||||
if ! systemctl is-active --quiet NetworkManager; then
|
||||
if ! isServiceActive NetworkManager; then
|
||||
printf "%b\n" "${YELLOW}NetworkManager service is not running. Starting it now...${RC}"
|
||||
"$ESCALATION_TOOL" systemctl start NetworkManager
|
||||
|
||||
if systemctl is-active --quiet NetworkManager; then
|
||||
printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}"
|
||||
fi
|
||||
startService NetworkManager
|
||||
else
|
||||
printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
## Milestones
|
||||
### Q4 2024
|
||||
- [x] Finish the foundation of the project's CLI
|
||||
- [ ] Implement CLI arguments and configuration support
|
||||
- [x] Implement CLI arguments and configuration support
|
||||
- [ ] Add an option for logging script executions
|
||||
|
||||
### Q1 2025
|
||||
|
|
|
@ -44,6 +44,7 @@ https://github.com/ChrisTitusTech/neovim
|
|||
- **Mozilla Firefox**: Mozilla Firefox is a free and open-source web browser developed by the Mozilla Foundation.
|
||||
- **Thorium**: Thorium is a Chromium-based browser focused on privacy and performance.
|
||||
- **Vivaldi**: Vivaldi is a freeware, cross-platform web browser developed by Vivaldi Technologies.
|
||||
- **Tor Browser**: Tor Browser is a free and open-source firefox-based web browser designed for anonymity and censorship circumvention.
|
||||
- **waterfox**: Waterfox is the privacy-focused web browser engineered to give you speed, control, and peace of mind on the internet.
|
||||
- **Alacritty**: 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.
|
||||
- **Android Debloater**: Universal Android Debloater (UAD) is a tool designed to help users remove bloatware and unnecessary pre-installed applications from Android devices, enhancing performance and user experience.
|
||||
|
@ -88,6 +89,7 @@ https://github.com/ChrisTitusTech/dwm-titus
|
|||
- **Linux Neptune for SteamDeck**: Valve's fork of Linux Kernel for the SteamDeck
|
||||
- **Nvidia Drivers && Hardware Acceleration**: This script installs and configures nvidia drivers with Hardware Acceleration.
|
||||
- **Paru AUR Helper**: 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
|
||||
- **Virtualization**: QEMU, Libvirt, Virt-Manager installation and configuration.
|
||||
- **Yay AUR Helper**: Yet Another Yogurt - An AUR Helper Written in Go. To know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers
|
||||
|
||||
### Fedora
|
||||
|
@ -125,6 +127,11 @@ https://github.com/ChrisTitusTech/dwm-titus
|
|||
- **Set Primary Monitor**: This script is designed to set a Primary monitor in your system
|
||||
- **Set Resolution**: This script is designed to change the resolution of monitors connected to your system
|
||||
|
||||
### Printers
|
||||
|
||||
- **CUPS**: This script will install the CUPS system, required for most printer drivers on Linux.
|
||||
- **Epson printer drivers**: This script will install the Epson printer drivers.
|
||||
|
||||
### User Account Manager
|
||||
|
||||
- **Auto Mount Drive**: This utility is designed to help with automating the process of mounting a drive on to your system.
|
||||
|
|
|
@ -22,6 +22,10 @@ curl -fsSL https://christitus.com/linux | sh
|
|||
curl -fsSL https://christitus.com/linuxdev | sh
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-config\fR \fI<path>\fR
|
||||
Path to the configuration file.
|
||||
|
||||
.TP
|
||||
\fB\-t\fR, \fB\-\-theme\fR \fI<theme>\fR
|
||||
Set the theme to use in the TUI.
|
||||
|
@ -32,6 +36,10 @@ Possible values:
|
|||
.br
|
||||
Defaults to \fIdefault\fR.
|
||||
|
||||
.TP
|
||||
\fB\-y\fR, \fB\-\-skip\-confirmation\fR
|
||||
Skip confirmation prompt before executing commands.
|
||||
|
||||
.TP
|
||||
\fB\-\-override\-validation\fR
|
||||
Show all available entries, disregarding compatibility checks. (\fBUNSAFE\fR)
|
||||
|
|
2
start.sh
2
start.sh
|
@ -43,7 +43,7 @@ check $? "Downloading linutil"
|
|||
chmod +x "$temp_file"
|
||||
check $? "Making linutil executable"
|
||||
|
||||
"$temp_file"
|
||||
"$temp_file" "$@"
|
||||
check $? "Executing linutil"
|
||||
|
||||
rm -f "$temp_file"
|
||||
|
|
|
@ -69,7 +69,7 @@ check $? "Downloading linutil"
|
|||
chmod +x "$TMPFILE"
|
||||
check $? "Making linutil executable"
|
||||
|
||||
"$TMPFILE"
|
||||
"$TMPFILE" "$@"
|
||||
check $? "Executing linutil"
|
||||
|
||||
rm -f "$TMPFILE"
|
||||
|
|
|
@ -14,21 +14,20 @@ default = ["tips"]
|
|||
tips = ["rand"]
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "4.5.20", features = ["derive"] }
|
||||
ego-tree = { workspace = true }
|
||||
oneshot = "0.1.8"
|
||||
clap = { version = "4.5.20", features = ["derive", "std"], default-features = false }
|
||||
oneshot = { version = "0.1.8", features = ["std"], default-features = false }
|
||||
portable-pty = "0.8.1"
|
||||
ratatui = "0.29.0"
|
||||
ratatui = { version = "0.29.0", features = ["crossterm"], default-features = false }
|
||||
tui-term = "0.2.0"
|
||||
temp-dir = "0.1.14"
|
||||
unicode-width = "0.2.0"
|
||||
unicode-width = { version = "0.2.0", default-features = false }
|
||||
rand = { version = "0.8.5", optional = true }
|
||||
linutil_core = { path = "../core", version = "24.9.28" }
|
||||
tree-sitter-highlight = "0.24.3"
|
||||
tree-sitter-bash = "0.23.1"
|
||||
textwrap = "0.16.1"
|
||||
anstyle = "1.0.8"
|
||||
ansi-to-tui = "7.0.0"
|
||||
textwrap = { version = "0.16.1", default-features = false }
|
||||
anstyle = { version = "1.0.8", default-features = false }
|
||||
ansi-to-tui = { version = "7.0.0", default-features = false }
|
||||
zips = "0.1.7"
|
||||
|
||||
[[bin]]
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use crate::{state::ListEntry, theme::Theme};
|
||||
use ego_tree::NodeId;
|
||||
use linutil_core::Tab;
|
||||
use linutil_core::{ego_tree::NodeId, Tab};
|
||||
use ratatui::{
|
||||
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
|
||||
layout::{Position, Rect},
|
||||
|
|
|
@ -71,8 +71,8 @@ impl Shortcut {
|
|||
}
|
||||
|
||||
fn to_spans(&self) -> Vec<Span<'static>> {
|
||||
let mut ret: Vec<_> = self
|
||||
.key_sequences
|
||||
let description = Span::styled(self.desc, Style::default().italic());
|
||||
self.key_sequences
|
||||
.iter()
|
||||
.flat_map(|seq| {
|
||||
[
|
||||
|
@ -81,8 +81,7 @@ impl Shortcut {
|
|||
Span::default().content("] "),
|
||||
]
|
||||
})
|
||||
.collect();
|
||||
ret.push(Span::styled(self.desc, Style::default().italic()));
|
||||
ret
|
||||
.chain(std::iter::once(description))
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ mod theme;
|
|||
|
||||
use std::{
|
||||
io::{self, stdout},
|
||||
path::PathBuf,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
|
@ -30,10 +31,18 @@ use state::AppState;
|
|||
// Linux utility toolbox
|
||||
#[derive(Debug, Parser)]
|
||||
struct Args {
|
||||
#[arg(short, long, help = "Path to the configuration file")]
|
||||
config: Option<PathBuf>,
|
||||
#[arg(short, long, value_enum)]
|
||||
#[arg(default_value_t = Theme::Default)]
|
||||
#[arg(help = "Set the theme to use in the application")]
|
||||
theme: Theme,
|
||||
#[arg(
|
||||
short = 'y',
|
||||
long,
|
||||
help = "Skip confirmation prompt before executing commands"
|
||||
)]
|
||||
skip_confirmation: bool,
|
||||
#[arg(long, default_value_t = false)]
|
||||
#[clap(help = "Show all available options, disregarding compatibility checks (UNSAFE)")]
|
||||
override_validation: bool,
|
||||
|
@ -45,7 +54,13 @@ struct Args {
|
|||
fn main() -> io::Result<()> {
|
||||
let args = Args::parse();
|
||||
|
||||
let mut state = AppState::new(args.theme, args.override_validation, args.size_bypass);
|
||||
let mut state = AppState::new(
|
||||
args.config,
|
||||
args.theme,
|
||||
args.override_validation,
|
||||
args.size_bypass,
|
||||
args.skip_confirmation,
|
||||
);
|
||||
|
||||
stdout().execute(EnterAlternateScreen)?;
|
||||
enable_raw_mode()?;
|
||||
|
|
|
@ -255,7 +255,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, 200);
|
||||
let mut parser = vt100::Parser::new(size.height, size.width, 1000);
|
||||
let mutex = self.buffer.lock();
|
||||
let buffer = mutex.as_ref().unwrap();
|
||||
parser.process(buffer);
|
||||
|
|
|
@ -7,8 +7,8 @@ use crate::{
|
|||
running_command::RunningCommand,
|
||||
theme::Theme,
|
||||
};
|
||||
use ego_tree::NodeId;
|
||||
use linutil_core::{ListNode, TabList};
|
||||
|
||||
use linutil_core::{ego_tree::NodeId, Config, ListNode, TabList};
|
||||
#[cfg(feature = "tips")]
|
||||
use rand::Rng;
|
||||
use ratatui::{
|
||||
|
@ -19,6 +19,7 @@ use ratatui::{
|
|||
widgets::{Block, Borders, List, ListState, Paragraph},
|
||||
Frame,
|
||||
};
|
||||
use std::path::PathBuf;
|
||||
use std::rc::Rc;
|
||||
|
||||
const MIN_WIDTH: u16 = 100;
|
||||
|
@ -61,6 +62,7 @@ pub struct AppState {
|
|||
#[cfg(feature = "tips")]
|
||||
tip: String,
|
||||
size_bypass: bool,
|
||||
skip_confirmation: bool,
|
||||
}
|
||||
|
||||
pub enum Focus {
|
||||
|
@ -85,10 +87,18 @@ enum SelectedItem {
|
|||
}
|
||||
|
||||
impl AppState {
|
||||
pub fn new(theme: Theme, override_validation: bool, size_bypass: bool) -> Self {
|
||||
pub fn new(
|
||||
config_path: Option<PathBuf>,
|
||||
theme: Theme,
|
||||
override_validation: bool,
|
||||
size_bypass: bool,
|
||||
skip_confirmation: bool,
|
||||
) -> Self {
|
||||
let tabs = linutil_core::get_tabs(!override_validation);
|
||||
let root_id = tabs[0].tree.root().id();
|
||||
|
||||
let auto_execute_commands = config_path.map(|path| Config::from_file(&path).auto_execute);
|
||||
|
||||
let mut state = Self {
|
||||
theme,
|
||||
focus: Focus::List,
|
||||
|
@ -103,12 +113,35 @@ impl AppState {
|
|||
#[cfg(feature = "tips")]
|
||||
tip: get_random_tip(),
|
||||
size_bypass,
|
||||
skip_confirmation,
|
||||
};
|
||||
|
||||
state.update_items();
|
||||
if let Some(auto_execute_commands) = auto_execute_commands {
|
||||
state.handle_initial_auto_execute(&auto_execute_commands);
|
||||
}
|
||||
|
||||
state
|
||||
}
|
||||
|
||||
fn handle_initial_auto_execute(&mut self, auto_execute_commands: &[String]) {
|
||||
self.selected_commands = auto_execute_commands
|
||||
.iter()
|
||||
.filter_map(|name| self.tabs.iter().find_map(|tab| tab.find_command(name)))
|
||||
.collect();
|
||||
|
||||
if !self.selected_commands.is_empty() {
|
||||
let cmd_names: Vec<_> = self
|
||||
.selected_commands
|
||||
.iter()
|
||||
.map(|node| node.name.as_str())
|
||||
.collect();
|
||||
|
||||
let prompt = ConfirmPrompt::new(&cmd_names);
|
||||
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
||||
}
|
||||
}
|
||||
|
||||
fn get_list_item_shortcut(&self) -> Box<[Shortcut]> {
|
||||
if self.selected_item_is_dir() {
|
||||
Box::new([Shortcut::new("Go to selected dir", ["l", "Right", "Enter"])])
|
||||
|
@ -756,14 +789,18 @@ impl AppState {
|
|||
}
|
||||
}
|
||||
|
||||
let cmd_names = self
|
||||
.selected_commands
|
||||
.iter()
|
||||
.map(|node| node.name.as_str())
|
||||
.collect::<Vec<_>>();
|
||||
if self.skip_confirmation {
|
||||
self.handle_confirm_command();
|
||||
} else {
|
||||
let cmd_names = self
|
||||
.selected_commands
|
||||
.iter()
|
||||
.map(|node| node.name.as_str())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let prompt = ConfirmPrompt::new(&cmd_names[..]);
|
||||
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
||||
let prompt = ConfirmPrompt::new(&cmd_names[..]);
|
||||
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
||||
}
|
||||
}
|
||||
SelectedItem::None => {}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user