Compare commits

...

10 Commits

Author SHA1 Message Date
zdiff
8ad13a53e5
Merge 2fd93fb707 into 8ea3da9843 2024-11-07 03:05:38 +00:00
zdiff
2fd93fb707 Merge remote-tracking branch 'upstream/main' 2024-11-06 22:05:05 -05:00
Jeevitha Kannan K S
8ea3da9843
Remove dependabot ignores (#806) 2024-11-06 16:30:40 -06:00
Jeevitha Kannan K S
176b19d692
Use ratatui bundled crossterm (#805) 2024-11-06 16:29:52 -06:00
Jeevitha Kannan K S
98e2f83f43
feat: Add arch nvidia installation script (#797)
* Add arch nvidia script

* Update model fetching

* chore: formatting, git as dep

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-06 16:28:36 -06:00
Adam Perkowski
9d1dc35f43
📃 feat: Linux Neptune (Valve's kernel for SteamDeck) installation (#683)
* Linux Neptune installation script

* fixed some stuff that's not supposed to be here

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>

* fix repo check

* added audio patches

https://github.com/ChrisTitusTech/linutil/issues/269#issuecomment-2380379049

* add linux neptune to docs (userguide)

* steamdeck precondition

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* precondition fix

* another precondition fix

---------

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-06 16:20:16 -06:00
Jeevitha Kannan K S
1234edd466
Change numlock description (#790) 2024-11-06 16:11:31 -06:00
leventbesli
d1a1812709
feat: btrfs assistant & grub-btrfs (#789)
* Btrfs Assistant(+snapper), grub-btrfs Setup added

Adds fedora-btrfs-assistant.sh, updates tab_data and documentation.

* updated doc, ta_data and sh

* enable grub-btrfsd service added

* updated some wording in notices.

* updated wording and add prompts for actions

* added fix for a possible grub error

also some more enhancements and wording improvements.

* user action removed

reinstall snapper action removed because removing and reinstalling snapper is a very unlikely action. and also snapper can't handle ./snapsots folder in the disk after reinstalling: "creating btrfs subvolume .snapshots failed since it already exists".

* firs snapshot order changed

home snapshot taken first because it's config can be saved to first root snapshot.

* better explanations in user prompts

* improved y/n loop

* formatting improvements

* formatting improvement

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* formatting improvement

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* Update task list

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* removed a inline comment

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* removed an unnececary inline comment

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* removed an unnececary inline comment

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* improved sed -i

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* improved sed -i

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* improved sed -i

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* newlines removed from tab_data.toml

Co-authored-by: Nyx <nnyyxxxx@protonmail.com>

* btrfs detection moved to toml

Co-authored-by: Nyx <nnyyxxxx@protonmail.com>

* data.preconditions added - escalation tool used

* $PACKAGER replaced with dnf

* re-added packager

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* re-added packager

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* usergide updated with docgen

* typo fix

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Nyx <nnyyxxxx@protonmail.com>
2024-11-06 16:05:26 -06:00
Albert de Palo Hardvendel
f2a1766289
Added support for installing podman (#787)
* Added support for installing podman

* removed llm comment

* Added podman to userguide

* Added support for install pythona and pip in case of missing. changed pip install to rootless install

* changed installing podman-compose with pip to packagemanager

* Update core/tabs/applications-setup/podman-setup.sh

Only install Podman if it is not installed already.

Co-authored-by: nyx <nnyyxxxx@protonmail.com>

* Update core/tabs/applications-setup/podman-setup.sh

Only install podman-compose if it is not installed already.

Co-authored-by: nyx <nnyyxxxx@protonmail.com>

* added podman-compose install option

* split podman install into podman and podman-compose

* Update core/tabs/applications-setup/podman-setup.sh

Co-authored-by: nyx <nnyyxxxx@protonmail.com>

* Update core/tabs/applications-setup/podman-setup.sh

Co-authored-by: nyx <nnyyxxxx@protonmail.com>

* Update core/tabs/applications-setup/podman-compose-setup.sh

Co-authored-by: nyx <nnyyxxxx@protonmail.com>

* Update core/tabs/applications-setup/podman-compose-setup.sh

Co-authored-by: nyx <nnyyxxxx@protonmail.com>

* Update core/tabs/applications-setup/podman-compose-setup.sh

Removed redundant quotes

Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>

* Update core/tabs/applications-setup/podman-setup.sh

Removed redundant quotes

Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>

---------

Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-06 16:03:50 -06:00
zdiff
8871610eb6 Reduce the size of the linutil binary by removing unused features from tui/Cargo.toml 2024-11-06 12:14:07 -05:00
20 changed files with 503 additions and 136 deletions

View File

@ -7,11 +7,4 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "actions/stale"
versions: '>= 9'
- dependency-name: "actions/setup-python"
versions: '> 4'
- dependency-name: "crossterm"
versions: '> 0.27.0'
interval: "weekly"

114
Cargo.lock generated
View File

@ -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"
@ -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",
"crossterm",
"ego-tree",
"linutil_core",
"oneshot",
@ -479,7 +426,7 @@ version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904"
dependencies = [
"hashbrown",
"hashbrown 0.14.5",
]
[[package]]
@ -688,9 +635,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",
]
@ -878,24 +825,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"
@ -908,12 +843,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"
@ -967,11 +896,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"
@ -1016,9 +940,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",
@ -1085,12 +1009,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"
@ -1279,9 +1197,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",
]

View File

@ -0,0 +1,33 @@
#!/bin/sh -e
. ../common-script.sh
installPodmanCompose() {
if ! command_exists podman-compose; then
printf "%b\n" "${YELLOW}Installing Podman Compose...${RC}"
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y podman-compose
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install podman-compose
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm --needed podman-compose
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y podman-compose
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
exit 1
;;
esac
else
printf "%b\n" "${GREEN}Podman Compose is already installed.${RC}"
fi
}
checkEnv
checkEscalationTool
installPodmanCompose

View File

@ -0,0 +1,33 @@
#!/bin/sh -e
. ../common-script.sh
installPodman() {
if ! command_exists podman; then
printf "%b\n" "${YELLOW}Installing Podman...${RC}"
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y podman
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install podman
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm --needed podman
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y podman
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
exit 1
;;
esac
else
printf "%b\n" "${GREEN}Podman is already installed.${RC}"
fi
}
checkEnv
checkEscalationTool
installPodman

View File

@ -228,6 +228,18 @@ description = "Docker is an open platform that uses OS-level virtualization to d
script = "docker-setup.sh"
task_list = "I SS"
[[data]]
name = "Podman"
description = "Podman is a daemon-less open platform that uses OS-level virtualization to deliver software in packages called containers."
script = "podman-setup.sh"
task_list = "I SS"
[[data]]
name = "Podman-compose"
description = "Podman Compose is a tool for defining and running multi-container applications using Podman."
script = "podman-compose-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"

View File

@ -0,0 +1,60 @@
#!/bin/sh -e
. ../../common-script.sh
setUpRepos() {
if ! grep -q "^\s*\[jupiter-staging\]" /etc/pacman.conf; then
printf "%b\n" "${CYAN}Adding jupiter-staging to pacman repositories...${RC}"
echo "[jupiter-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
fi
if ! grep -q "^\s*\[holo-staging\]" /etc/pacman.conf; then
printf "%b\n" "${CYAN}Adding holo-staging to pacman repositories...${RC}"
echo "[holo-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
fi
}
installKernel() {
if ! "$PACKAGER" -Q | grep -q "\blinux-neptune"; then
printf "%b\n" "${CYAN}Installing linux-neptune..."
"$ESCALATION_TOOL" "$PACKAGER" -Syyu --noconfirm
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm linux-neptune linux-neptune-headers steamdeck-dsp jupiter-staging/alsa-ucm-conf
"$ESCALATION_TOOL" mkinitcpio -P
else
printf "%b\n" "${GREEN}linux-neptune detected. Skipping installation.${RC}"
fi
if [ -f /etc/default/grub ]; then
printf "%b\n" "${CYAN}Updating GRUB...${RC}"
if ! grep -q '^UPDATEDEFAULT=' /etc/default/grub; then
echo 'UPDATEDEFAULT=yes' | "$ESCALATION_TOOL" tee -a /etc/default/grub
else
"$ESCALATION_TOOL" sed -i 's/^UPDATEDEFAULT=.*/UPDATEDEFAULT=yes/' /etc/default/grub
fi
if [ -f /boot/grub/grub.cfg ]; then
"$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg
else
printf "%b\n" "${RED}GRUB configuration file not found. Run grub-mkconfig manually.${RC}"
fi
else
printf "%b\n" "${RED}GRUB not detected. Manually set your bootloader to use linux-neptune.${RC}"
fi
}
copyFirmwareFiles() {
printf "%b\n" "${CYAN}Copying firmware files...${RC}"
"$ESCALATION_TOOL" mkdir -p /usr/lib/firmware/cirrus
"$ESCALATION_TOOL" cp /usr/lib/firmware/cs35l41-dsp1-spk-cali.bin /usr/lib/firmware/cirrus/
"$ESCALATION_TOOL" cp /usr/lib/firmware/cs35l41-dsp1-spk-cali.wmfw /usr/lib/firmware/cirrus/
"$ESCALATION_TOOL" cp /usr/lib/firmware/cs35l41-dsp1-spk-prot.bin /usr/lib/firmware/cirrus/
"$ESCALATION_TOOL" cp /usr/lib/firmware/cs35l41-dsp1-spk-prot.wmfw /usr/lib/firmware/cirrus/
}
checkEnv
checkEscalationTool
setUpRepos
installKernel
copyFirmwareFiles

View File

@ -0,0 +1,120 @@
#!/bin/sh -e
. ../../common-script.sh
LIBVA_DIR="$HOME/.local/share/linutil/libva"
MPV_CONF="$HOME/.config/mpv/mpv.conf"
installDeps() {
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel dkms ninja meson git
installed_kernels=$("$PACKAGER" -Q | grep -E '^linux(| |-rt|-rt-lts|-hardened|-zen|-lts)[^-headers]' | cut -d ' ' -f 1)
for kernel in $installed_kernels; do
header="${kernel}-headers"
printf "%b\n" "${CYAN}Installing headers for $kernel...${RC}"
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$header"
done
}
checkNvidiaHardware() {
# Refer https://nouveau.freedesktop.org/CodeNames.html for model code names
model=$(lspci -k | grep -A 2 -E "(VGA|3D)" | grep NVIDIA | sed 's/.*Corporation //;s/ .*//' | cut -c 1-2)
case "$model" in
GM | GP | GV) return 1 ;;
TU | GA | AD) return 0 ;;
*) printf "%b\n" "${RED}Unsupported hardware." && exit 1 ;;
esac
}
checkIntelHardware() {
model=$(grep "model name" /proc/cpuinfo | head -n 1 | cut -d ':' -f 2 | cut -c 2-3)
[ "$model" -ge 11 ]
}
promptUser() {
printf "%b" "Do you want to $1 ? [y/N]:"
read -r confirm
[ "$confirm" = "y" ] || [ "$confirm" = "Y" ]
}
setKernelParam() {
PARAMETER="$1"
if grep -q "$PARAMETER" /etc/default/grub; then
printf "%b\n" "${YELLOW}NVIDIA modesetting is already enabled in GRUB.${RC}"
else
"$ESCALATION_TOOL" sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ $PARAMETER\"/" /etc/default/grub
printf "%b\n" "${CYAN}Added $PARAMETER to /etc/default/grub.${RC}"
"$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg
fi
}
setupHardwareAcceleration() {
if ! command_exists grub-mkconfig; then
printf "%b\n" "${RED}Currently hardware acceleration is only available with GRUB.${RC}"
return
fi
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libva-nvidia-driver
mkdir -p "$HOME/.local/share/linutil"
if [ -d "$LIBVA_DIR" ]; then
rm -rf "$LIBVA_DIR"
fi
printf "%b\n" "${YELLOW}Cloning libva from https://github.com/intel/libva in ${LIBVA_DIR}${RC}"
git clone --branch=v2.22-branch --depth=1 https://github.com/intel/libva "$LIBVA_DIR"
mkdir -p "$LIBVA_DIR/build"
cd "$LIBVA_DIR/build" && arch-meson .. -Dwith_legacy=nvctrl && ninja
"$ESCALATION_TOOL" ninja install
"$ESCALATION_TOOL" sed -i '/^MOZ_DISABLE_RDD_SANDBOX/d' "/etc/environment"
"$ESCALATION_TOOL" sed -i '/^LIBVA_DRIVER_NAME/d' "/etc/environment"
printf "LIBVA_DRIVER_NAME=nvidia\nMOZ_DISABLE_RDD_SANDBOX=1" | "$ESCALATION_TOOL" tee -a /etc/environment >/dev/null
printf "%b\n" "${GREEN}Hardware Acceleration setup completed successfully.${RC}"
if promptUser "enable Hardware Acceleration in MPV player"; then
mkdir -p "$HOME/.config/mpv"
if [ -f "$MPV_CONF" ]; then
sed -i '/^hwdec/d' "$MPV_CONF"
fi
printf "hwdec=auto" | tee -a "$MPV_CONF" >/dev/null
printf "%b\n" "${GREEN}MPV Hardware Acceleration enabled successfully.${RC}"
fi
}
installDriver() {
# Refer https://wiki.archlinux.org/title/NVIDIA for open-dkms or dkms driver selection
if checkNvidiaHardware && promptUser "install nvidia's open source drivers"; then
printf "%b\n" "${YELLOW}Installing nvidia open source driver...${RC}"
installDeps
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm nvidia-open-dkms nvidia-utils
else
printf "%b\n" "${YELLOW}Installing nvidia proprietary driver...${RC}"
installDeps
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm nvidia-dkms nvidia-utils
fi
if checkIntelHardware; then
setKernelParam "ibt=off"
fi
# Refer https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend
setKernelParam "nvidia.NVreg_PreserveVideoMemoryAllocations=1"
"$ESCALATION_TOOL" systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
printf "%b\n" "${GREEN}Driver installed successfully.${RC}"
if promptUser "setup Hardware Acceleration"; then
setupHardwareAcceleration
fi
printf "%b\n" "${GREEN}Please reboot your system for the changes to take effect.${RC}"
}
checkEnv
checkEscalationTool
installDriver

View File

@ -0,0 +1,168 @@
#!/bin/sh -e
. ../../common-script.sh
# This script automates the installation and root and home snapshot configuration of Snapper and installs Grub-Btrfs on Fedora.
# Also installs python3-dnf-plugin-snapper package for automatic snapshots after dnf commands.
# Install Btrfs-Assistant/snapper and dependencies
installBtrfsStack() {
if ! command_exists btrfs-assistant; then
printf "%b\n" "${YELLOW}==========================================${RC}"
printf "%b\n" "${YELLOW}Installing Btrfs Assistant with snapper...${RC}"
printf "%b\n" "${YELLOW}==========================================${RC}"
case "$PACKAGER" in
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant python3-dnf-plugin-snapper
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
printf "%b\n" "${GREEN}Btrfs Assistant is already installed.${RC}"
fi
}
# Create first snapper config for root and home and create new manual snapshots
configureSnapper() {
printf "%b\n" "${YELLOW}===========================================================================${RC}"
printf "%b\n" "${YELLOW}Creating snapper root(/) and /home config and taking the first snapshots...${RC}"
printf "%b\n" "${YELLOW}===========================================================================${RC}"
"$ESCALATION_TOOL" snapper -c home create-config /home && "$ESCALATION_TOOL" snapper -c home create --description "First home Snapshot"
"$ESCALATION_TOOL" snapper -c root create-config / && "$ESCALATION_TOOL" snapper -c root create --description "First root Snapshot"
printf "%b\n" "${YELLOW}Updating timeline settings...${RC}"
# Modifyling default timeline root config
"$ESCALATION_TOOL" sed -i'' '
s/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="1"/;
s/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="2"/;
s/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="1"/;
s/^TIMELINE_LIMIT_MONTHLY="[^"]*"/TIMELINE_LIMIT_MONTHLY="0"/;
s/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/
' /etc/snapper/configs/root
# Modifyling default timeline for home config
"$ESCALATION_TOOL" sed -i'' '
s/^TIMELINE_LIMIT_HOURLY="[^"]*"/TIMELINE_LIMIT_HOURLY="2"/;
s/^TIMELINE_LIMIT_DAILY="[^"]*"/TIMELINE_LIMIT_DAILY="1"/;
s/^TIMELINE_LIMIT_WEEKLY="[^"]*"/TIMELINE_LIMIT_WEEKLY="0"/;
s/^TIMELINE_LIMIT_MONTHLY="[^"]*"/TIMELINE_LIMIT_MONTHLY="1"/;
s/^TIMELINE_LIMIT_YEARLY="[^"]*"/TIMELINE_LIMIT_YEARLY="0"/
' /etc/snapper/configs/home
printf "%b\n" "${GREEN}Snapper configs and first snapshots created.${RC}"
}
# Starting services
serviceStartEnable() {
printf "%b\n" "${YELLOW}==================================================================================${RC}"
printf "%b\n" "${YELLOW}Starting and enabling snapper-timeline.timer and snapper-cleanup.timer services...${RC}"
printf "%b\n" "${YELLOW}==================================================================================${RC}"
"$ESCALATION_TOOL" systemctl enable --now snapper-timeline.timer
"$ESCALATION_TOOL" systemctl enable --now snapper-cleanup.timer
printf "%b\n" "${GREEN}Snapper services started and enabled.${RC}"
}
# Ask user if they want to install grub-btrfs
askInstallGrubBtrfs() {
printf "%b\n" "${YELLOW}=====================================${RC}"
printf "%b\n" "${YELLOW}(optional) grub-btrfs installation...${RC}"
printf "%b\n" "${YELLOW}=====================================${RC}"
printf "%b\n" "${YELLOW}You can skip installing grub-btrfs and use only Btrfs Assistant GUI or snapper CLI.${RC}"
printf "%b\n" "${CYAN}Notice: grub-btrfs may cause problems with booting into snapshots and other OSes on systems with secure boot/tpm. You will be asked to apply mitigation for this issue in next step.${RC}"
while true; do
printf "%b" "${YELLOW}Do you want to install grub-btrfs? Press (y) for yes, (n) for no, (f) to apply tpm mitigation to already installed grub-btrfs: ${RC}"
read -r response
case "$response" in
[yY]*)
installGrubBtrfs
break
;;
[nN]*)
printf "%b\n" "${GREEN}Skipping grub-btrfs installation.${RC}"
break
;;
[fF]*)
mitigateTpmError
break
;;
*)
printf "%b\n" "${RED}Invalid input. Please enter 'y' for yes, 'n' for no, or (f) to apply tpm mitigation to already installed grub-btrfs.${RC}"
;;
esac
done
}
# Install grub-btrfs
installGrubBtrfs() {
# Check if the grub-btrfs dir exists before attempting to clone into it.
printf "%b\n" "${YELLOW}Downloading grub-btrfs and installing dependencies...${RC}"
if [ -d "$HOME/grub-btrfs" ]; then
rm -rf "$HOME/grub-btrfs"
fi
"$ESCALATION_TOOL" "$PACKAGER" install -y make git inotify-tools
cd "$HOME" && git clone https://github.com/Antynea/grub-btrfs
printf "%b\n" "${YELLOW}Installing grub-btrfs...${RC}"
cd "$HOME/grub-btrfs"
printf "%b\n" "${YELLOW}Modifying grub-btrfs configuration for Fedora...${RC}"
sed -i'' '/#GRUB_BTRFS_SNAPSHOT_KERNEL/a GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="systemd.volatile=state"' config
sed -i'' '/#GRUB_BTRFS_GRUB_DIRNAME/a GRUB_BTRFS_GRUB_DIRNAME="/boot/grub2"' config
sed -i'' '/#GRUB_BTRFS_MKCONFIG=/a GRUB_BTRFS_MKCONFIG=/sbin/grub2-mkconfig' config
sed -i'' '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config
"$ESCALATION_TOOL" make install
printf "%b\n" "${YELLOW}Updating grub configuration and enabling grub-btrfsd service...${RC}"
"$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && "$ESCALATION_TOOL" systemctl enable --now grub-btrfsd.service
printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}"
cd .. && rm -rf "$HOME/grub-btrfs"
printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}"
printf "%b\n" "${CYAN}Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot.${RC}"
mitigateTpmError
}
mitigateTpmError() {
printf "%b\n" "${YELLOW}===============================================${RC}"
printf "%b\n" "${YELLOW}Mitigation for 'tpm.c:150:unknown TPM error'...${RC}"
printf "%b\n" "${YELLOW}===============================================${RC}"
printf "%b\n" "${YELLOW}Some systems with secure boot/tpm may encounter 'tpm.c:150:unknown TPM error' when booting into snapshots.${RC}"
printf "%b\n" "${YELLOW}If you encounter this issue, you can come back later and apply this mitigation or you can apply it now.${RC}"
while true; do
printf "%b\n" "${YELLOW}Do you want to apply the TPM error mitigation? (y/n): ${RC}"
read -r response
case "$response" in
[yY]*)
printf "%b\n" "${YELLOW}Creating /etc/grub.d/02_tpm file...${RC}"
echo '#!/bin/sh' | "$ESCALATION_TOOL" tee /etc/grub.d/02_tpm > /dev/null
echo 'echo "rmmod tpm"' | "$ESCALATION_TOOL" tee -a /etc/grub.d/02_tpm > /dev/null
"$ESCALATION_TOOL" chmod +x /etc/grub.d/02_tpm # makes the file executable
"$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg # updates grub config
printf "%b\n" "${GREEN}Mitigation applied and grub config updated.${RC}"
break
;;
[nN]*)
printf "%b\n" "${GREEN}Skipping TPM error mitigation.${RC}"
break
;;
*)
printf "%b\n" "${RED}Invalid input. Please enter 'y' for yes or 'n' for no.${RC}"
;;
esac
done
}
# Post install information
someNotices() {
printf "%b\n" "${YELLOW}================================NOTICES================================${RC}"
printf "%b\n" "${YELLOW}Notice: You can manage snapshots from GUI with Btrfs Assistant or CLI with snapper.${RC}"
printf "%b\n" "${YELLOW}Notice: You may change (Hourly, daily, weekly, monthly, yearly) timeline settings with Btrfs Assistant GUI.${RC}"
printf "%b\n" "${RED}Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately...${RC}"
printf "%b\n" "${YELLOW}================================NOTICES================================${RC}"
printf "%b\n" "${GREEN}Setup process completed.${RC}"
}
checkEnv
checkEscalationTool
installBtrfsStack
configureSnapper
serviceStartEnable
askInstallGrubBtrfs
someNotices

View File

@ -15,6 +15,23 @@ script = "arch/server-setup.sh"
task_list = "SI D"
multi_select = false
[[data.entries]]
name ="Linux Neptune for SteamDeck"
description = "Valve's fork of Linux Kernel for the SteamDeck"
script = "arch/linux-neptune.sh"
task_list = "I PFM K"
[[data.entries.preconditions]]
matches = true
data = { file = "/sys/devices/virtual/dmi/id/board_vendor" }
values = [ "Valve" ]
[[data.entries]]
name = "Nvidia Drivers && Hardware Acceleration"
description = "This script installs and configures nvidia drivers with Hardware Acceleration."
script = "arch/nvidia-drivers.sh"
task_list = "I FM SS"
[[data.entries]]
name = "Paru AUR Helper"
description = "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"
@ -71,6 +88,17 @@ description = "Enables Virtualization through dnf"
script = "fedora/virtualization.sh"
task_list = "I"
[[data.entries]]
name = "Btrfs Assistant, Snapper Config, grub-btrfs"
description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Enables snapper-timeline and snapper-cleanup services. Installs Grub-Btrfs. Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot. Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately."
script = "fedora/fedora-btrfs-assistant.sh"
task_list = "I PFM SS"
[[data.preconditions]]
matches = true
data = "command_exists"
values = [ "btrfs" ]
[[data]]
name = "Build Prerequisites"
description = "This script is designed to handle the installation of various software dependencies across different Linux distributions"

View File

@ -2,11 +2,6 @@
. ../common-script.sh
# setleds can be used in all distros
# This method works by calling a script using systemd service
# Create a script to toggle numlock
create_file() {
printf "%b\n" "Creating script..."
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
@ -21,7 +16,6 @@ EOF
"$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock
}
# Create a systemd service to run the script on boot
create_service() {
printf "%b\n" "Creating service..."
"$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
@ -39,7 +33,6 @@ EOF
}
numlockSetup() {
# Check if the script and service files exists
if [ ! -f "/usr/local/bin/numlock" ]; then
create_file
fi

View File

@ -136,7 +136,7 @@ task_list = "I FM"
[[data]]
name = "Numlock on Startup"
description = "This utility is designed to configure auto enabling of numlock on boot"
description = "This utility is designed to enable Num Lock at boot, rather than within desktop environments like KDE or GNOME"
script = "numlock.sh"
task_list = "PFM SS"

View File

@ -56,6 +56,9 @@ All of the layouts can be applied dynamically, optimising the environment for th
This command installs and configures DWM and a desktop manager.
The list of patches applied can be found in CTT's DWM repository
https://github.com/ChrisTitusTech/dwm-titus
- **Docker**: Docker is an open platform that uses OS-level virtualization to deliver software in packages called containers.
- **Podman**: Podman is a daemon-less open platform that uses OS-level virtualization to deliver software in packages called containers.
- **Podman-compose**: Podman Compose is a tool for defining and running multi-container applications using Podman.
- **Fastfetch**: Fastfetch is a neofetch-like tool for fetching system information and displaying it prettily. It is written mainly in C, with performance and customizability in mind. This command installs fastfetch and configures from CTT's mybash repository. https://github.com/ChrisTitusTech/mybash
- **Flatpak / Flathub**: Flatpak is a universal application sandbox for Linux that uses isolated packages from Flathub to prevent conflicts and system alterations, while alleviating dependency concerns. This command installs Flatpak and adds the Flathub repository
- **Grub Theme**: Installs ChrisTitusTech's Top 5 Bootloader Themes script to allow for easy customization of GRUB.
@ -83,6 +86,8 @@ https://github.com/ChrisTitusTech/dwm-titus
### Arch Linux
- **Arch Server Setup**: This command installs a minimal arch server setup under 5 minutes.
- **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
- **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
@ -94,6 +99,7 @@ https://github.com/ChrisTitusTech/dwm-titus
- **RPM Fusion**: RPM Fusion provides software that the Fedora Project or Red Hat doesn't want to ship. That software is provided as precompiled RPMs for all current Fedora versions and current Red Hat Enterprise Linux or clones versions; you can use the RPM Fusion repositories with tools like yum and PackageKit. For more information visit: https://rpmfusion.org/
- **Upgrade to a New Fedora Release**: Upgrades system to the next Fedora release
- **Virtualization**: Enables Virtualization through dnf
- **Btrfs Assistant, Snapper Config, grub-btrfs**: Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes the first root(/) and /home snapshots. Enables snapper-timeline and snapper-cleanup services. Installs Grub-Btrfs. Notice: To perform a system recovery via grub-btrfs, perform a restore operation with Btrfs Assistant GUI after booting into the snapshot. Notice: If you used the default Fedora disk partitioning during OS installation, the /boot configured as an separate EXT4 partition. Therefore, it cannot be included in root snapshots. Backup separately.
- **Build Prerequisites**: This script is designed to handle the installation of various software dependencies across different Linux distributions
- **Full System Cleanup**: This script is designed to remove unnecessary packages, clean old cache files, remove temporary files, and to empty the trash.
- **Full System Update**: This command updates your system to the latest packages available for your distro
@ -124,7 +130,7 @@ https://github.com/ChrisTitusTech/dwm-titus
- **Auto Mount Drive**: This utility is designed to help with automating the process of mounting a drive on to your system.
- **Bluetooth Manager**: This utility is designed to manage bluetooth in your system
- **Numlock on Startup**: This utility is designed to configure auto enabling of numlock on boot
- **Numlock on Startup**: This utility is designed to enable Num Lock at boot, rather than within desktop environments like KDE or GNOME
- **Ollama**: This utility is designed to manage ollama in your system
- **Service Manager**: This utility is designed to manage services in your system
- **WiFi Manager**: This utility is designed to manage wifi in your system

View File

@ -14,22 +14,21 @@ default = ["tips"]
tips = ["rand"]
[dependencies]
clap = { version = "4.5.20", features = ["derive"] }
crossterm = "0.28.1"
clap = { version = "4.5.20", features = ["derive", "std"], default-features = false }
ego-tree = { workspace = true }
oneshot = "0.1.8"
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]]

View File

@ -2,8 +2,8 @@ use std::borrow::Cow;
use crate::{float::FloatContent, hint::Shortcut};
use crossterm::event::{KeyCode, KeyEvent};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent},
layout::Alignment,
prelude::*,
widgets::{Block, Borders, Clear, List},

View File

@ -1,8 +1,8 @@
use crate::{state::ListEntry, theme::Theme};
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use ego_tree::NodeId;
use linutil_core::Tab;
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
layout::{Position, Rect},
style::{Color, Style},
text::Span,

View File

@ -1,5 +1,5 @@
use crossterm::event::{KeyCode, KeyEvent};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent},
layout::{Constraint, Direction, Layout, Rect},
Frame,
};

View File

@ -8,9 +8,8 @@ use crate::{float::FloatContent, hint::Shortcut};
use linutil_core::Command;
use crossterm::event::{KeyCode, KeyEvent};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent},
layout::Rect,
style::{Style, Stylize},
text::Line,

View File

@ -14,13 +14,17 @@ use std::{
use crate::theme::Theme;
use clap::Parser;
use crossterm::{
event::{self, DisableMouseCapture, Event, KeyEventKind},
style::ResetColor,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
use ratatui::{
backend::CrosstermBackend,
crossterm::{
event::{self, DisableMouseCapture, Event, KeyEventKind},
style::ResetColor,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
},
Terminal,
};
use ratatui::{backend::CrosstermBackend, Terminal};
use state::AppState;
// Linux utility toolbox

View File

@ -1,11 +1,11 @@
use crate::{float::FloatContent, hint::Shortcut};
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use linutil_core::Command;
use oneshot::{channel, Receiver};
use portable_pty::{
ChildKiller, CommandBuilder, ExitStatus, MasterPty, NativePtySystem, PtySize, PtySystem,
};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
layout::{Rect, Size},
style::{Color, Style, Stylize},
text::{Line, Span},

View File

@ -7,12 +7,12 @@ use crate::{
running_command::RunningCommand,
theme::Theme,
};
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers};
use ego_tree::NodeId;
use linutil_core::{ListNode, TabList};
#[cfg(feature = "tips")]
use rand::Rng;
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers},
layout::{Alignment, Constraint, Direction, Flex, Layout},
style::{Style, Stylize},
text::{Line, Span, Text},
@ -30,6 +30,7 @@ D - disk modifications (ex. partitioning) (privileged)
FI - flatpak installation
FM - file modification
I - installation (privileged)
K - kernel modifications (privileged)
MP - package manager actions
SI - full system installation
SS - systemd actions (privileged)