Compare commits

...

95 Commits

Author SHA1 Message Date
Chris Titus
a410429b32
Merge branch 'main' into main 2024-11-07 13:28:33 -06:00
Harsh Vyapari
51e2cbd607
feat: whatsapp desktop app (#838)
* feat(communication/whatsapp): add whatsapp desktop client

* Update core/tabs/applications-setup/communication-apps/whatsapp-setup.sh

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

* refactor: changing name to zapzap

As per @Ilj3954 and @adamperkowski request, I'm changing both option and
script name to zapzap (which was the original name of the app)

* Update core/tabs/applications-setup/tab_data.toml

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

* Update core/tabs/applications-setup/communication-apps/zapzap-setup.sh

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

* Update core/tabs/applications-setup/communication-apps/zapzap-setup.sh

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

* Update core/tabs/applications-setup/communication-apps/zapzap-setup.sh

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

* Update core/tabs/applications-setup/communication-apps/zapzap-setup.sh

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

* chore: adjusting indentation

* Update core/tabs/applications-setup/communication-apps/zapzap-setup.sh

Co-authored-by: Jeevitha Kannan K S <ksjeevithakannan123@gmail.com>

* Update core/tabs/applications-setup/tab_data.toml

Co-authored-by: Jeevitha Kannan K S <ksjeevithakannan123@gmail.com>

---------

Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-07 13:26:57 -06:00
Vorthas
b36a7df11c
feat: printer driver installation (#837)
* Add basic script to install Epson printer drivers in Arch, Debian, and Fedora.

* Add I to the task_list for this script.

* Update core/tabs/utils/printers/install-epson-printer-drivers.sh

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

* Update userguide.md based on adam's documentation update.

* Add description to tab_data.toml for the printer addition.

* Fix typo, oops.

* Actually generate the updated userguide.

* Add installation of CUPS as a pre-requisite for Epson printer drivers as well as standalone script for other printer drivers to be added in the future.

* Update core/tabs/utils/printers/install-cups.sh

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

* Update core/tabs/utils/printers/install-epson-printer-drivers.sh

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

* Update core/tabs/utils/tab_data.toml

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

* Update core/tabs/utils/tab_data.toml

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

* Update docs after changes.

---------

Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-11-07 13:23:13 -06:00
Jeevitha Kannan K S
9f0863729f
feat: Add automation based on config file (#836)
* feat: Add automation based on config file

* docs: add configuration to the manpage & README

* update roadmap

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-07 13:21:37 -06:00
Jeevitha Kannan K S
e8e1a36a63
Linutil arguments when using curl (#835)
* Use args

* Include details about arguments

* Update README.md

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

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-11-07 13:18:21 -06:00
Jeevitha Kannan K S
d033b0f36d
feat: Add --skip-confirmation flag (#834)
* feat: Add --skip-confirmation flag

* add `--skip-confirmation` to the manpage

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-11-07 13:09:18 -06:00
Jeevitha Kannan K S
472c85eb79
Increase scroll length (#830) 2024-11-07 13:08:20 -06:00
Sebastian
629b1290be
Added required dependencies for Arch (#824)
When installing dwm-titus with slstatus from a fresh Arch-Server install, several required dependencies are missing and need to be included. These are:
- meson
- libev
- uthash
- libconfig

Tested only on another fresh Arch-Server install and script completed successfully.
2024-11-07 13:07:49 -06:00
solomoncyj
cb6e0f9cb6
Add OpenSUSE to list of linutil added to package managers (#820)
* Add OpenSUSE to list of linutil added to package managers

* Update README.md

* set up install script

* Update linutil-installer.sh

* Update linutil-installer.sh

* fixes

* Update linutil-installer.sh

* Update linutil-installer.sh

* Update linutil-installer.sh

* Update linutil-installer.sh

* Update README.md

* Update linutil-installer.sh

* Update README.md

* Update linutil-installer.sh

* Apply suggestions from code review

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

* Update core/tabs/applications-setup/linutil-installer.sh

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

* Update linutil-installer.sh

* Update linutil-installer.sh

* Update README.md

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-07 13:07:28 -06:00
Jeevitha Kannan K S
159d2cb00f
Update mybash-setup.sh (#819) 2024-11-07 13:05:23 -06:00
Jeevitha Kannan K S
9dbb787ac5
Update ollama.sh (#815)
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-07 13:04:53 -06:00
Jeevitha Kannan K S
1e39d967c5
feat: Alpine linux support (#814)
* Add basic apk to scripts

* Add common service script

* Fix alpine bugs

* Add flatpak installations

* chore: update scripts, add common-service-script to shellcheckrc
2024-11-07 13:03:21 -06:00
Jeevitha Kannan K S
e31622480b
feat: Add Arch virtualization setup script (#813)
* Add Arch virtualization setup script

* Replace hardcoded pacman

* Update core/tabs/system-setup/arch/virtualization.sh

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

* Update virtualization.sh

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

* Update core/tabs/system-setup/arch/virtualization.sh

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

* chore: formatting

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-11-07 13:01:50 -06:00
Liam
980365f7c9
refactor: Re-export ego-tree dependency from linutil core (#811)
* refactor: Export ego-tree from linutil core, rather than workspace

* refactor: Improve code formatting

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-07 13:00:34 -06:00
nyx
421044f43e
fix reversion (#923) 2024-11-07 12:58:18 -06:00
Jeevitha Kannan K S
652b8808a9
xtask docgen (#924) 2024-11-07 12:52:51 -06: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
Liam
6728e7ee9b
refact: Handle temporary directories entirely within core (#754)
* refactor: Handle temporary directories entirely within core

* fix (xtask): Handle modified tablist struct

* refactor (xtask): Apply Clippy suggested changes

* Fix size_bypass

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-06 15:28:17 -06:00
nyx
c36879e22f
Implement Rounded corners (#918)
* add rounded corners

* more

* apply rounded corners to script boxes as well
2024-11-06 14:01:19 -06:00
nev-al
e463037e69
fix(dwmtitus-setup): dm picking (#823)
Co-authored-by: usr <you@example.com>
2024-11-06 12:04:02 -06:00
Adam Perkowski
f0734f361c
🦀 feat(ux): add a minimum size bypass cli flag (#920)
* 🦀 feat(ux): add a minimum size bypass cli flag

* oopsie
2024-11-06 09:49:26 -06:00
nyx
565f507190
implement word wrapping functionality (#755)
* implement dynamic auto updating word wrapping functionality

* run fmt

* remove dupe space

* run fmt

* add remove comments back

* fix compilation errors

* run fmt

* run docgen

* run docgen

* fix conflicts

* run cargo xtask docgen

* use boolean rather than enum

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-11-06 09:40:55 -06:00
Jeevitha Kannan K S
88d6fd12a2
fix: flatpak path (#916) 2024-11-05 16:42:40 -06:00
Jeevitha Kannan K S
67b749942c
refact: multi-selection to per cmd (#719)
* Add per cmd multi-selection

* Add colors for nm cmds

* fix: conflicts
2024-11-05 13:59:57 -06:00
Sebastian
48e8bab12c
Add greeter install for lightdm during dwm-titus setup (#831)
* Add greeter install for lightdm

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

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

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-11-05 13:58:21 -06:00
Jeevitha Kannan K S
c20c6e2f38
Add missing gaming deps (#761) 2024-11-05 13:41:53 -06:00
nyx
5878f4dbf0
implement fish like tab completion (#767)
* implement fish like tab completion

* grey the pv out and convert to lowercase

* run fmt

* do not tabcomplete if the user hits enter

* fix

* fix lints

* run docgen

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-11-01 16:01:01 -05:00
Chris Titus
58f3433de6 fix doc privs for pushing new prs to docs 2024-11-01 15:18:12 -05:00
Chris Titus
00d321d75e fix tag output 2024-11-01 15:15:35 -05:00
Chris Titus
6f21718963 change to PAT Token 2024-11-01 15:04:07 -05:00
JEEVITHA KANNAN K S
951cdc2d4c
feat: jetbrains-toolbox (#893)
* feat: jetbrains-toolbox

* fix: formatting and shebang

* Forgot the docs
2024-11-01 14:29:01 -05:00
Chris Titus
1dec242548 add pr write privs 2024-11-01 14:27:58 -05:00
JEEVITHA KANNAN K S
808ef913e5
refact: use tags instead of runner id (#900)
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-01 13:45:39 -05:00
JEEVITHA KANNAN K S
904ea6ee53
refact(ci): Preview workflow to create PR (#901)
* refact: use tags instead of runner id

* refact: pr instead of auto commit

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-01 13:43:05 -05:00
Chris Titus
6eba207f27 Preview Commit to PR fix 2024-11-01 13:36:23 -05:00
JEEVITHA KANNAN K S
d4eacaeab3
refact fix: Flatpak (#705)
* Fix flatpak paths

* Refact office suites flatpak

* Merge flatpak_app_exists and command_exists

* Fix binary path bug

* Add apk pgm

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-01 12:25:11 -05:00
JEEVITHA KANNAN K S
5987d0d808
refact(ci): bashisms.yml (#793)
* Refact bashisms.yml

* Update bashisms.yml
2024-11-01 12:21:49 -05:00
JEEVITHA KANNAN K S
9cc57330dc
fix: remove unnecessary arch update (#897) 2024-11-01 12:12:32 -05:00
JEEVITHA KANNAN K S
a0d6070c1a
fix: shellcheck errors (#896) 2024-11-01 12:11:36 -05:00
JEEVITHA KANNAN K S
4f4becc4fc
fix: aarch64 release (#894) 2024-11-01 01:21:34 -05:00
JEEVITHA KANNAN K S
7e13faae8a
Use flatpak (#812) 2024-10-31 15:21:01 -05:00
dependabot[bot]
4c3cc75997
Bump clap from 4.5.19 to 4.5.20 (#825)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.19 to 4.5.20.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.19...clap_complete-v4.5.20)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-31 15:20:21 -05:00
dependabot[bot]
1730d9da21
Bump tree-sitter-highlight from 0.24.2 to 0.24.3 (#826)
Bumps [tree-sitter-highlight](https://github.com/tree-sitter/tree-sitter) from 0.24.2 to 0.24.3.
- [Release notes](https://github.com/tree-sitter/tree-sitter/releases)
- [Changelog](https://github.com/tree-sitter/tree-sitter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tree-sitter/tree-sitter/compare/v0.24.2...v0.24.3)

---
updated-dependencies:
- dependency-name: tree-sitter-highlight
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-31 15:20:01 -05:00
dependabot[bot]
f1444cd4dc
Bump crate-ci/typos from 1.25.0 to 1.26.0 (#827)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.25.0 to 1.26.0.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.25.0...v1.26.0)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-31 15:19:46 -05:00
JEEVITHA KANNAN K S
afa2afc0e8
chore: bump ratatui -> 0.29.0 (#865)
* chore: bump ratatui -> 0.29.0

* chore: bump ansi-to-tui -> 7.0.0

* chore: bump tui-term -> 0.2.0
2024-10-31 15:19:24 -05:00
Adam Perkowski
17d62302b3
fix: ILoveCandy in pacman conf (#892) 2024-10-31 15:18:18 -05:00
JEEVITHA KANNAN K S
00914ab05d
fix: cargo.lock fixes (#891) 2024-10-31 15:17:49 -05:00
JEEVITHA KANNAN K S
01285f4908
ci: Remove unnecessary auto commit (#791)
* Remove autocommit

* Remove move to build dir

* Preview for 2024.10.09

* Revert preview section for https://github.com/ChrisTitusTech/linutil/pull/792

---------

Co-authored-by: jeevithakannan2 <jeevithakannan2@users.noreply.github.com>
2024-10-31 15:09:36 -05:00
JEEVITHA KANNAN K S
06d8b52b94
ci: Seperate preview from Linutil Release (#792)
* Seperate preview from linutil.yml

* Fix paths as per https://github.com/ChrisTitusTech/linutil/pull/791

* Refact commit msg

* Update preview.yml
2024-10-31 15:00:25 -05:00
Adam Perkowski
4ee27890f4
fix the repo (#889) 2024-10-31 14:49:15 -05:00
Adam Perkowski
29f218f57a
feat(arch-setup): enable colors and the easter egg in pacman (#890) 2024-10-31 14:48:51 -05:00
JEEVITHA KANNAN K S
dd10565d8f
Fix btrfs issue (#728) 2024-10-31 14:47:24 -05:00
leventbesli
2837f9291a
fix(browsers): vivaldi setup (#718)
* Fixed Vivaldi Setup

Lynx install script replaced with Vivaldi.

* zypper and pacman added to vivaldi.sh

- zypper and pacman added.
- format fixes.

* Delete Cargo.lock

* Revert "Delete Cargo.lock"

This reverts commit 0b0f173c9e.

* xdg-utils removed from script

* revert cargo.lock

* update cargo.lock

* update cargo.lock

* Update Cargo.lock

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

* Update Cargo.lock

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

---------

Co-authored-by: Nyx <144965845+nnyyxxxx@users.noreply.github.com>
2024-10-31 14:19:22 -05:00
Angaddeep Singh
4577df4dea
feat(docker-setup): fedora support (#707)
* Docker Setup for Fedora

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

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

---------

Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
2024-10-31 14:14:51 -05:00
JEEVITHA KANNAN K S
11336cf9f1
chore: Add spacing before and after for tui titles (#706)
* Add spacing

* Use string instead of box::leak

* Update tui/src/state.rs

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

---------

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-10-31 14:14:17 -05:00
JEEVITHA KANNAN K S
ad678b2d4b
Fix common script paths (#717) 2024-10-31 14:07:20 -05:00
Angelos Giannourakos
f4c20c80f0
fix(nala): remove autoclean from system-cleanup.sh (#697)
* Removing autoclean for apt | nala

Removing autoclean command for apt | nala because there is no such command on debian especially for nala

* Update system-cleanup.sh

* Update system-cleanup.sh

* Update system-cleanup.sh
2024-10-31 14:02:25 -05:00
Angaddeep Singh
1d61778736
feat(fedora): release upgrade script (#886)
* 1st commit

* Update tab_data.toml

* bashism fix

* Update core/tabs/system-setup/fedora/fedora-upgrade.sh

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

* Update core/tabs/system-setup/fedora/fedora-upgrade.sh

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

* Update core/tabs/system-setup/fedora/fedora-upgrade.sh

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

* Update core/tabs/system-setup/fedora/fedora-upgrade.sh

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

* Update core/tabs/system-setup/tab_data.toml

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

* Update core/tabs/system-setup/fedora/fedora-upgrade.sh

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

* Update core/tabs/system-setup/fedora/fedora-upgrade.sh

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

* Update core/tabs/system-setup/fedora/fedora-upgrade.sh

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

* Update core/tabs/system-setup/fedora/fedora-upgrade.sh

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

* update

* Apply suggestions from code review

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

* Update fedora-upgrade.sh

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
2024-10-31 14:01:04 -05:00
nyx
f612a38762
fix fedora timeshift (#774) 2024-10-31 13:57:59 -05:00
nyx
fc2d731754
do not exit linutil in confirmation prompt when q is pressed (#758)
* do not exit linutil in confirmation prompt when q is pressed

* remove cap support

* add ``ctrl + c`` exiting

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

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:49:08 -05:00
nyx
72dfb29969
dont allow the user to bring up the command desc if there is none (#753)
* dont allow the user to bring up the command desc if there is none

* obey our god lints

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:42:06 -05:00
nyx
52565e5ea1
clear the search bar if the user changes categories (#752)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:41:03 -05:00
nyx
9353849e16
use bin for faster installation (#748)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:40:07 -05:00
nyx
ded7fcb735
fix issues with set brightness (#747)
Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:39:26 -05:00
nyx
f9d7ed94b1
fix bug in ssh commands (#733)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:37:41 -05:00
nyx
38138334b7
dont allow scrolling when last line is visible (#729)
* dont allow scrolling when last line is visible

* apply changes proposed by adam

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

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:37:01 -05:00
nyx
1dcc3f3c99
allow scrolling past last entry / first entry (#727)
* allow scrolling past last entry

* Update tui/src/state.rs

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

* Update tui/src/state.rs

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

* apply changes proposed by adam

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

* apply changes proposed by adam round 2

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

* undo changes proposed by adam in scroll up and down funcs

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:35:53 -05:00
nyx
66a4334aee
sort entries alphabetically (#726)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:33:12 -05:00
nyx
2d14a0a7b6
return user to their previous position if they exit a subdir (#725)
* return user to their previous position if they enter a subdir

* fix lint

* implement changes proposed by adam

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

* add newline back

* coalesce `visit_stack` and `position_stack` (#6)

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: cartercanedy <99052281+cartercanedy@users.noreply.github.com>
2024-10-31 13:30:22 -05:00
nyx
0c8977192f
fix color bleeding (#723)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:27:13 -05:00
nyx
a5fd25f6af
organize shortcut list into a grid-like-pattern (#721)
* organize shortcut list into a grid-like-pattern

* increase minimum size

* add newline back to satisfy lint

* decrease to 25

* optimization

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

* satisfy lint

* implement some changes proposed by adam

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

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:25:16 -05:00
Bernhard M. Wiedemann
b2fb33229b
Replace BUILD_DATE with CARGO_PKG_VERSION (#878)
to make builds reproducible.
See https://reproducible-builds.org/ for why this is good.
2024-10-31 13:22:17 -05:00
JEEVITHA KANNAN K S
67f6a4989f
Update rust.yml (#866)
Run workflow in all Cargo.toml changes
2024-10-31 13:21:06 -05:00
JEEVITHA KANNAN K S
6e1d7a6768
Update roadmap.md (#875)
* Update roadmap.md

* Update docs/roadmap.md

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

* Update docs/roadmap.md

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

* Update docs/roadmap.md

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

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:15:02 -05:00
Adam Perkowski
a2bdd8fb4c
fix(waydroid-setup): not installing dkms on arch (#881)
took some code from #797

Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
2024-10-31 13:11:24 -05:00
Adam Perkowski
c7d7cd3891
fix: github release notes not working (#884)
so apparently you can't mix stuff like `labels` and `label` in YAML (f YAML)
if i try to create a release now (yes i can), it just won't generate the notes. this will fix it
2024-10-31 13:10:45 -05:00
Adam Perkowski
663992b15d
⚖️ docs: fix the security policy (#883)
* docs: fix the security policy

* better grammar and stuff

* add a version matrix

* LATEST hyprlink
2024-10-31 13:07:50 -05:00
nyx
a9fdfd1784
make command_exists interpret multiple values (#762)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:06:46 -05:00
JEEVITHA KANNAN K S
e29ca044c0
Fix bash deps (#763) 2024-10-31 13:06:17 -05:00
hexis
abcf7fc376
added waterfox browser (#700)
* added waterfox browser

* added waterfox browser

* added waterfox browser

* added waterfox browser

* added waterfox browser

* added waterfox browser

* added waterfox browser

* added waterfox browser

* fixed things

* fixed things

* added FI

* flatpak fix

* added lapce IDE

* .
2024-10-31 13:04:55 -05:00
Liam
5e19458c74
feat: Drastically increase the operating system support for USB creation script (#828)
* feat: Drastically increase the operating system support for USB creator

* fix: Modify jq syntax to fix false positive from checkbashisms

* feat: Include chosen release in 'available editions' text

* fix: Correct syntax for older jq versions

* refactor: Remove pointless comment

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

* fix: List available options in a more readable way.

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

---------

Co-authored-by: nyx <nnyyxxxx@protonmail.com>
Co-authored-by: adamperkowski <adamperkowski@users.noreply.github.com>
2024-10-31 12:58:10 -05:00
JEEVITHA KANNAN K S
23954aa8bc
refact(ci): ShellCheck (#887)
* ci: add shfmt

* refact: shellcheck
2024-10-31 12:53:06 -05:00
Adam Perkowski
696110eae5
refact(release): better categories (#876) 2024-10-25 15:44:41 -05:00
Adam Perkowski
e3688e9b3d
fix+refact(system-cleanup) (#856)
* fix(system-cleanup): some issues

* new packager quotes
2024-10-24 14:59:23 -05:00
Adam Perkowski
51631a16cb
feat: desktop entry & manpage installation through linutil-installer.sh (#802) 2024-10-24 14:55:56 -05:00
Adam Perkowski
d39ffad527
📖 fix(docs): newlines (#796) 2024-10-24 14:50:27 -05:00
Adam Perkowski
c0982a787f
📖 add auto docs generation instructions to the Contributing Guidelines (#788)
* 📖 add auto docs generation instructions to the Contributing Guidelines

* Commit Contributing Guidelines

---------

Co-authored-by: adamperkowski <adamperkowski@users.noreply.github.com>
2024-10-24 14:45:37 -05:00
Adam Perkowski
4f7de594a6
🔍️ exiting search with Ctrl-C + better shortcut tips (#768) 2024-10-24 14:43:16 -05:00
Adam Perkowski
fa2f838b63
📃 fix(monitor setup): a bug with utility-functions; newlines & colors in the scripts (#713)
* fixed newlines & changed colors to keep synergy

* fixed a bug
2024-10-24 14:39:04 -05:00
122 changed files with 2601 additions and 1062 deletions

View File

@ -16,6 +16,7 @@ cd linutil
``` ```
## 3. Make your changes ## 3. Make your changes
- **Edit the files you want to change**: Make your changes to the relevant files. - **Edit the files you want to change**: Make your changes to the relevant files.
- **Test your changes**: Run `cargo run` to test your modifications in a local environment and ensure everything works as expected. - **Test your changes**: Run `cargo run` to test your modifications in a local environment and ensure everything works as expected.
@ -60,6 +61,7 @@ cd linutil
## 11. Documentation ## 11. Documentation
- **Update the documentation**: If your change affects the functionality, please update the relevant documentation files to reflect this. - **Update the documentation**: If your change affects the functionality, please update the relevant documentation files to reflect this.
- **Automatic generation**: If you decide to add functionality through a new shell script, make sure to fill out all fields in `tab_data.toml` and run `cargo xtask docgen`.
## 12. License ## 12. License

19
.github/SECURITY.md vendored
View File

@ -2,13 +2,20 @@
## Supported Versions ## Supported Versions
It is recommended that you run the stable version as this is more tested and used by most. The dev branch is bleed-edge commits that are not well tested and aren't meant to be used in production environments It is recommended that you use the stable branch as it's tested and used by most. The dev branch may contain bleeding-edge commits that are not well tested and are not meant to be used in production environments.<br>
Version tags lower than the [latest stable release](https://github.com/ChrisTitusTech/linutil/releases/latest) are **not** supported.
| Version | Supported | | Branch | Supported |
| ------- | ------------------ | | ------- | ---------------------- |
| latest | :white_check_mark: | | Stable | :white_check_mark: YES |
| dev | :x: | | Dev | :x: NO |
| Version | Supported |
| -------------------------------------------------- | ---------------------- |
| [![LATEST](https://img.shields.io/github/v/release/ChrisTitusTech/linutil?color=%230567ff&label=Latest&style=for-the-badge)](https://github.com/ChrisTitusTech/linutil/releases/latest) | :white_check_mark: YES |
| Below LATEST | :x: NO |
| Above LATEST | :x: NO |
## Reporting a Vulnerability ## Reporting a Vulnerability
I'd recommend making an Issue for reporting a bug. If you would like privately submit the bug you can email me at contact@christitus.com If you have any reason to believe there are security vulnerabilities in Linutil, fill out the [report form](https://github.com/christitustech/linutil/security/advisories/new) or e-mail [contact@christitus.com](mailto:contact@christitus.com).

View File

@ -8,10 +8,3 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "weekly" interval: "weekly"
ignore:
- dependency-name: "actions/stale"
versions: '>= 9'
- dependency-name: "actions/setup-python"
versions: '> 4'
- dependency-name: "crossterm"
versions: '> 0.27.0'

27
.github/release.yml vendored
View File

@ -2,19 +2,34 @@ changelog:
categories: categories:
- title: '🚀 Features' - title: '🚀 Features'
labels: labels:
- 'feature'
- 'enhancement' - 'enhancement'
- title: '🐛 Bug Fixes' - title: '🐛 Bug Fixes'
labels: labels:
- 'fix'
- 'bugfix'
- 'bug' - 'bug'
- title: '⚙️ Refactoring'
labels:
- 'refactor'
- title: '🧩 UI/UX'
labels:
- 'UI/UX'
- title: '📚 Documentation' - title: '📚 Documentation'
label: 'documentation' labels:
- 'documentation'
- title: '🔒 Security' - title: '🔒 Security'
label: 'security' labels:
- 'security'
- title: '🧰 GitHub Actions' - title: '🧰 GitHub Actions'
label: 'github actions' labels:
- 'github_actions'
- title: '🦀 Rust'
labels:
- 'rust'
- title: '📃 Scripting'
labels:
- 'script'
- title: 'Other Changes'
labels:
- "*"
exclude: exclude:
labels: labels:
- 'skip-changelog' - 'skip-changelog'

View File

@ -3,7 +3,7 @@ name: Check for bashisms
on: on:
pull_request: pull_request:
paths: paths:
- core/tabs/** - 'core/tabs/**/*.sh'
merge_group: merge_group:
workflow_dispatch: workflow_dispatch:
@ -15,31 +15,33 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: git fetch origin ${{ github.base_ref }} - run: git fetch origin ${{ github.base_ref }}
- name: Get a list of changed script files - name: Install devscripts
id: get_sh_files run: sudo apt-get update && sudo apt-get install -y devscripts
- name: Get changed .sh files (PR only)
id: changed-sh-files
if: github.event_name == 'pull_request'
uses: tj-actions/changed-files@v45
with:
files: '**/*.sh'
- name: Get all .sh files (if workflow dispatched)
id: sh-files
if: github.event_name != 'pull_request'
run: | run: |
sh_files=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs | grep '\.sh$' || true) files=$(find . -type f -name "*.sh" | tr '\n' ' ')
if [ -n "$sh_files" ]; then echo "files=${files:-none}" >> $GITHUB_ENV
echo "$sh_files" > changed_files
echo "changed=1" >> $GITHUB_OUTPUT - name: Set FILES for bashism check
id: set-files
run: |
if [[ "${{ steps.changed-sh-files.outputs.any_changed }}" == 'true' ]]; then
echo "FILES=${{ steps.changed-sh-files.outputs.all_changed_files }}" >> $GITHUB_ENV
else else
echo "changed=0" >> $GITHUB_OUTPUT echo "FILES=${{ env.files }}" >> $GITHUB_ENV
fi fi
- name: Install devscripts
if: steps.get_sh_files.outputs.changed == 1
run: sudo apt-get update && sudo apt-get install devscripts
- name: Check for bashisms - name: Check for bashisms
if: steps.get_sh_files.outputs.changed == 1
run: | run: |
echo "Running for:\n$(cat changed_files)\n" IFS=' ' read -r -a file_array <<< "$FILES"
for file in $(cat changed_files); do checkbashisms "${file_array[@]}"
if [[ -f "$file" ]]; then
checkbashisms "$file"
fi
done
- name: Remove the created file
if: steps.get_sh_files.outputs.changed == 1
run: rm changed_files

View File

@ -13,6 +13,10 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: linutil_env
permissions:
contents: write
pull-requests: write
steps: steps:
- name: Checkout Repository - name: Checkout Repository
@ -22,13 +26,19 @@ jobs:
- name: Copy Contributing Guidelines - name: Copy Contributing Guidelines
run: | run: |
echo "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md' echo -e "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md'
- uses: stefanzweifel/git-auto-commit-action@v5 - name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with: with:
commit_message: Commit Contributing Guidelines commit-message: Update Contributing Guidelines
file_pattern: "docs/contributing.md" title: 'docs: Update Contributing Guidelines'
add_options: '--force' body: 'Automated update of Contributing Guidelines from .github/CONTRIBUTING.md'
branch: update-contributing-guidelines
delete-branch: true
base: main
labels: documentation
token: ${{ secrets.PAT_TOKEN }}
if: success() if: success()
- name: Setup Python - name: Setup Python

View File

@ -46,19 +46,9 @@ jobs:
run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl --all-features run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl --all-features
- name: Build aarch64 binary - name: Build aarch64 binary
run: cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl --all-features
- name: Move binaries to build directory
run: | run: |
mv build/x86_64-unknown-linux-musl/release/linutil build/linutil cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl --all-features
mv build/aarch64-unknown-linux-musl/release/linutil build/linutil-aarch64 mv ./build/aarch64-unknown-linux-musl/release/linutil ./build/aarch64-unknown-linux-musl/release/linutil-aarch64
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Commit Linutil
file_pattern: "build/linutil build/linutil-aarch64"
add_options: '--force'
if: success()
- name: Extract Version - name: Extract Version
id: extract_version id: extract_version
@ -80,32 +70,11 @@ jobs:
append_body: true append_body: true
generate_release_notes: true generate_release_notes: true
files: | files: |
./build/linutil ./build/x86_64-unknown-linux-musl/release/linutil
./build/linutil-aarch64 ./build/aarch64-unknown-linux-musl/release/linutil-aarch64
./start.sh ./start.sh
./startdev.sh ./startdev.sh
prerelease: true prerelease: true
env: env:
version: ${{ env.version }} version: ${{ env.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Preview
run: |
echo "$(pwd)/build" >> $GITHUB_PATH
- name: Generate preview
uses: charmbracelet/vhs-action@v2.1.0
with:
path: "docs/assets/preview.tape"
- name: Move preview
run: |
mv preview.gif docs/assets/preview.gif
- name: Upload preview
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Preview for ${{ env.version }}
file_pattern: "docs/assets/preview.gif"
add_options: "--force"
if: success()

78
.github/workflows/preview.yml vendored Normal file
View File

@ -0,0 +1,78 @@
name: LinUtil Preview
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name'
required: true
workflow_run:
workflows: ["LinUtil Release"]
types:
- completed
jobs:
generate_preview:
runs-on: ubuntu-latest
environment: linutil_env
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Get tag name ( Workflow Run )
id: latest_tag
uses: actions/github-script@v7
if: github.event_name == 'workflow_run'
with:
script: |
const releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 1
});
core.setOutput('result', releases.data[0].tag_name);
result-encoding: string
- name: Set tag name ( Workflow Run )
if: github.event_name == 'workflow_run'
run: echo "tag_name=${{ steps.latest_tag.outputs.result }}" >> $GITHUB_ENV
- name: Set tag name ( Workflow Dispatch )
if: ${{ github.event_name }} == 'workflow_dispatch'
run: echo "tag_name=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
- name: Download binary
run: |
curl -LO "https://github.com/${{ github.repository }}/releases/download/${{ env.tag_name }}/linutil"
- name: Set env
run: |
chmod +x linutil
mkdir -p build
mv linutil build/linutil
echo "${{ github.workspace }}/build" >> $GITHUB_PATH
- name: Generate preview
uses: charmbracelet/vhs-action@v2.1.0
with:
path: "docs/assets/preview.tape"
- name: Move preview
run: mv preview.gif docs/assets/preview.gif
- name: Create PR
uses: peter-evans/create-pull-request@v7.0.5
with:
commit-message: Preview for ${{ env.tag_name }}
file-pattern: "docs/assets/preview.gif"
add-options: "--force"
token: ${{ secrets.PAT_TOKEN }}
branch: feature/preview-${{ env.tag_name }}
title: "Update preview for ${{ env.tag_name }}"
body: |
Automated PR to update preview gif for version ${{ env.tag_name }}
if: success()

View File

@ -5,7 +5,7 @@ on:
branches: ["main"] branches: ["main"]
paths: paths:
- '**/*.rs' - '**/*.rs'
- 'Cargo.toml' - '**/Cargo.toml'
- 'Cargo.lock' - 'Cargo.lock'
env: env:

View File

@ -1,9 +1,9 @@
name: ShellCheck name: Script Checks
on: on:
pull_request: pull_request:
paths: paths:
- 'core/tabs/**/*.sh' - '**/*.sh'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -11,45 +11,25 @@ jobs:
name: Shellcheck name: Shellcheck
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout sources
- run: git fetch origin ${{ github.base_ref }} uses: actions/checkout@v4
- name: Download, setup, and run ShellCheck - name: Run ShellCheck
shell: bash {0} uses: reviewdog/action-shellcheck@v1
run : | with:
SC_URL="https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz" shellcheck_flags: '--source-path=${{ github.workspace }}/.shellcheckrc'
curl -fsSL "$SC_URL" | tar -Jx reviewdog_flags: '-fail-level=any'
chmod +x "./shellcheck-v0.10.0/shellcheck"
error=0 shfmt:
files_to_check=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs) name: Shell Fomatting
runs-on: ubuntu-latest
needs: shellcheck
steps:
- name: Checkout sources
uses: actions/checkout@v4
for file in $files_to_check; do - name: Run shfmt
if [[ "$file" == *.sh ]] && [[ -f "$file" ]]; then uses: reviewdog/action-shfmt@v1
sc_output=$(./shellcheck-v0.10.0/shellcheck -fgcc -Serror "$file") with:
iter_safe_parsed_errors=$(echo -e "$sc_output" | sed -n 's/\(.\+\)\:\([0-9]\+\)\:\([0-9]\+\)\: \(.*\)/::error file=\1,line=\2,col=\3::\4/p' | sed 's/ /:space:/g') shfmt_flags: '-i 4 -ci'
reviewdog_flags: '-fail-level=any'
for error in $iter_safe_parsed_errors; do
echo "$error" | sed 's/:space:/ /g'
error=1
done
tabs_detected=$(grep -nP '^\t+\S+' "$file")
# fast fail on the action runner would fail immediately if there weren't any tabs found
# this check makes sure that we don't continue if there's something really weird going on
if [ "$?" = "2" ]; then
echo "::error file=$file::There was a critical error while grepping $file, aborting"
exit 1
fi
iter_safe_parsed_tabs_detected=$(echo "$tabs_detected" | sed -n 's,\([0-9]\+\).*,::error file='"$file"'\,line=\1::Found tab indentations,p' | sed 's/ /:space:/g')
for error in $iter_safe_parsed_tabs_detected; do
echo "$error" | sed 's/:space:/ /g'
error=1
done
fi
done
exit $error

View File

@ -12,4 +12,4 @@ jobs:
- run: git fetch origin ${{ github.base_ref }} - run: git fetch origin ${{ github.base_ref }}
- name: Run spellcheck - name: Run spellcheck
uses: crate-ci/typos@v1.25.0 uses: crate-ci/typos@v1.26.0

3
.shellcheckrc Normal file
View File

@ -0,0 +1,3 @@
external-sources=true
source=core/tabs/common-script.sh
source=core/tabs/common-service-script.sh

215
Cargo.lock generated
View File

@ -29,26 +29,11 @@ version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "ansi-to-tui" name = "ansi-to-tui"
version = "6.0.0" version = "7.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00c4af0bef1b514c9b6a32a773caf604c1390fa7913f4eaa23bfe76f251d6a42" checksum = "67555e1f1ece39d737e28c8a017721287753af3f93225e4a445b29ccb0f5912c"
dependencies = [ dependencies = [
"nom", "nom",
"ratatui", "ratatui",
@ -136,12 +121,6 @@ version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]] [[package]]
name = "byteorder" name = "byteorder"
version = "1.5.0" version = "1.5.0"
@ -178,25 +157,11 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets",
]
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.19" version = "4.5.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -204,9 +169,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.19" version = "4.5.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -252,12 +217,6 @@ dependencies = [
"static_assertions", "static_assertions",
] ]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]] [[package]]
name = "crossterm" name = "crossterm"
version = "0.28.1" version = "0.28.1"
@ -291,9 +250,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
[[package]] [[package]]
name = "ego-tree" name = "ego-tree"
version = "0.6.3" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" checksum = "7c6ba7d4eec39eaa9ab24d44a0e73a7949a1095a8b3f3abb11eddf27dbb56a53"
[[package]] [[package]]
name = "either" name = "either"
@ -370,29 +329,6 @@ dependencies = [
"windows-sys", "windows-sys",
] ]
[[package]]
name = "iana-time-zone"
version = "0.1.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "include_dir" name = "include_dir"
version = "0.7.4" version = "0.7.4"
@ -422,6 +358,12 @@ dependencies = [
"hashbrown", "hashbrown",
] ]
[[package]]
name = "indoc"
version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
[[package]] [[package]]
name = "instability" name = "instability"
version = "0.3.2" version = "0.3.2"
@ -462,15 +404,6 @@ version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "js-sys"
version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
dependencies = [
"wasm-bindgen",
]
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.5.0" version = "1.5.0"
@ -501,16 +434,14 @@ version = "24.9.28"
dependencies = [ dependencies = [
"ansi-to-tui", "ansi-to-tui",
"anstyle", "anstyle",
"chrono",
"clap", "clap",
"crossterm",
"ego-tree",
"linutil_core", "linutil_core",
"oneshot", "oneshot",
"portable-pty", "portable-pty",
"rand", "rand",
"ratatui", "ratatui",
"temp-dir", "temp-dir",
"textwrap",
"tree-sitter-bash", "tree-sitter-bash",
"tree-sitter-highlight", "tree-sitter-highlight",
"tui-term", "tui-term",
@ -607,15 +538,6 @@ dependencies = [
"minimal-lexical", "minimal-lexical",
] ]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.19.0" version = "1.19.0"
@ -743,23 +665,23 @@ dependencies = [
[[package]] [[package]]
name = "ratatui" name = "ratatui"
version = "0.28.1" version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"cassowary", "cassowary",
"compact_str", "compact_str",
"crossterm", "crossterm",
"indoc",
"instability", "instability",
"itertools", "itertools",
"lru", "lru",
"paste", "paste",
"strum", "strum",
"strum_macros",
"unicode-segmentation", "unicode-segmentation",
"unicode-truncate", "unicode-truncate",
"unicode-width 0.1.14", "unicode-width 0.2.0",
] ]
[[package]] [[package]]
@ -966,6 +888,12 @@ version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "smawk"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
[[package]] [[package]]
name = "static_assertions" name = "static_assertions"
version = "1.1.0" version = "1.1.0"
@ -1032,6 +960,17 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
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]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.64" version = "1.0.64"
@ -1088,9 +1027,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter" name = "tree-sitter"
version = "0.24.2" version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b84f60031bf8245b563a80c92c1034e557a914f7958f474bc0afa2eed78b98" checksum = "f9871f16d6cf5c4757dcf30d5d2172a2df6987c510c017bbb7abfb7f9aa24d06"
dependencies = [ dependencies = [
"cc", "cc",
"regex", "regex",
@ -1111,9 +1050,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-highlight" name = "tree-sitter-highlight"
version = "0.24.2" version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c727fb31f816c09fc54dc0e971d101318926866f7261b2acb820e84a61bf52d" checksum = "48859aa39513716018d81904220960f415dbb72e071234a721304d20bf245e4c"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"regex", "regex",
@ -1130,9 +1069,9 @@ checksum = "2545046bd1473dac6c626659cc2567c6c0ff302fc8b84a56c4243378276f7f57"
[[package]] [[package]]
name = "tui-term" name = "tui-term"
version = "0.1.13" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d07f0233f0d4795d2dc6663cfc3ce56b87bebcee66d6bcc088aa6aff5c072361" checksum = "72af159125ce32b02ceaced6cffae6394b0e6b6dfd4dc164a6c59a2db9b3c0b0"
dependencies = [ dependencies = [
"ratatui", "ratatui",
"vt100", "vt100",
@ -1144,6 +1083,12 @@ version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
[[package]]
name = "unicode-linebreak"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
[[package]] [[package]]
name = "unicode-segmentation" name = "unicode-segmentation"
version = "1.11.0" version = "1.11.0"
@ -1223,61 +1168,6 @@ version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
dependencies = [
"cfg-if",
"once_cell",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
[[package]] [[package]]
name = "which" name = "which"
version = "6.0.3" version = "6.0.3"
@ -1312,15 +1202,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets",
]
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.52.0" version = "0.52.0"

View File

@ -3,9 +3,6 @@ license = "MIT"
version = "24.9.28" version = "24.9.28"
edition = "2021" edition = "2021"
[workspace.dependencies]
ego-tree = "0.6.2"
[workspace] [workspace]
members = ["tui", "core", "xtask"] members = ["tui", "core", "xtask"]
default-members = ["tui", "core"] default-members = ["tui", "core"]

View File

@ -24,6 +24,26 @@ curl -fsSL https://christitus.com/linux | sh
```bash ```bash
curl -fsSL https://christitus.com/linuxdev | sh 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 ## ⬇️ Installation
Linutil is also available as a package in various repositories: 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. Replace `paru` with your preferred helper and `linutil` with your preferred package.
</details> </details>
<details>
<summary>OpenSUSE</summary>
Linutil can be installed on OpenSUSE with:
```bash
sudo zypper install linutil
```
</details>
<details> <details>
<summary>Cargo</summary> <summary>Cargo</summary>
@ -72,6 +100,28 @@ Note that crates installed using `cargo install` require manual updating with `c
</details> </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 ## 💖 Support
If you find Linutil helpful, please consider giving it a ⭐️ to show your support! If you find Linutil helpful, please consider giving it a ⭐️ to show your support!

View File

@ -5,11 +5,7 @@ repository = "https://github.com/ChrisTitusTech/linutil/tree/main/core"
edition = "2021" edition = "2021"
version.workspace = true version.workspace = true
license.workspace = true license.workspace = true
include = [ include = ["src/*.rs", "Cargo.toml", "tabs/**"]
"src/*.rs",
"Cargo.toml",
"tabs/**",
]
[dependencies] [dependencies]
include_dir = "0.7.4" include_dir = "0.7.4"
@ -17,4 +13,4 @@ temp-dir = "0.1.14"
serde = { version = "1.0.205", features = ["derive"], default-features = false } serde = { version = "1.0.205", features = ["derive"], default-features = false }
toml = { version = "0.8.19", features = ["parse"], default-features = false } toml = { version = "0.8.19", features = ["parse"], default-features = false }
which = "6.0.3" which = "6.0.3"
ego-tree = { workspace = true } ego-tree = "0.9.0"

28
core/src/config.rs Normal file
View 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);
}
}
}
}

View File

@ -1,6 +1,7 @@
use std::{ use std::{
fs::File, fs::File,
io::{BufRead, BufReader, Read}, io::{BufRead, BufReader, Read},
ops::{Deref, DerefMut},
os::unix::fs::PermissionsExt, os::unix::fs::PermissionsExt,
path::{Path, PathBuf}, path::{Path, PathBuf},
rc::Rc, rc::Rc,
@ -14,8 +15,34 @@ use temp_dir::TempDir;
const TAB_DATA: Dir = include_dir!("$CARGO_MANIFEST_DIR/tabs"); const TAB_DATA: Dir = include_dir!("$CARGO_MANIFEST_DIR/tabs");
pub fn get_tabs(validate: bool) -> (TempDir, Vec<Tab>) { // Allow the unused TempDir to be stored for later destructor call
let (temp_dir, tab_files) = TabList::get_tabs(); #[allow(dead_code)]
pub struct TabList(pub Vec<Tab>, TempDir);
// Implement deref to allow Vec<Tab> methods to be called on TabList
impl Deref for TabList {
type Target = Vec<Tab>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl DerefMut for TabList {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl IntoIterator for TabList {
type Item = Tab;
type IntoIter = std::vec::IntoIter<Self::Item>;
fn into_iter(self) -> Self::IntoIter {
self.0.into_iter()
}
}
pub fn get_tabs(validate: bool) -> TabList {
let (temp_dir, tab_files) = TabDirectories::get_tabs();
let tabs: Vec<_> = tab_files let tabs: Vec<_> = tab_files
.into_iter() .into_iter()
@ -33,40 +60,28 @@ pub fn get_tabs(validate: bool) -> (TempDir, Vec<Tab>) {
let tabs: Vec<Tab> = tabs let tabs: Vec<Tab> = tabs
.into_iter() .into_iter()
.map( .map(|(TabEntry { name, data }, directory)| {
|( let mut tree = Tree::new(Rc::new(ListNode {
TabEntry { name: "root".to_string(),
name, description: String::new(),
data, command: Command::None,
multi_selectable, task_list: String::new(),
}, multi_select: false,
directory, }));
)| { let mut root = tree.root_mut();
let mut tree = Tree::new(Rc::new(ListNode { create_directory(data, &mut root, &directory, validate, true);
name: "root".to_string(), Tab { name, tree }
description: String::new(), })
command: Command::None,
task_list: String::new(),
}));
let mut root = tree.root_mut();
create_directory(data, &mut root, &directory, validate);
Tab {
name,
tree,
multi_selectable,
}
},
)
.collect(); .collect();
if tabs.is_empty() { if tabs.is_empty() {
panic!("No tabs found"); panic!("No tabs found");
} }
(temp_dir, tabs) TabList(tabs, temp_dir)
} }
#[derive(Deserialize)] #[derive(Deserialize)]
struct TabList { struct TabDirectories {
directories: Vec<PathBuf>, directories: Vec<PathBuf>,
} }
@ -74,12 +89,6 @@ struct TabList {
struct TabEntry { struct TabEntry {
name: String, name: String,
data: Vec<Entry>, data: Vec<Entry>,
#[serde(default = "default_multi_selectable")]
multi_selectable: bool,
}
fn default_multi_selectable() -> bool {
true
} }
#[derive(Deserialize)] #[derive(Deserialize)]
@ -94,6 +103,12 @@ struct Entry {
entry_type: EntryType, entry_type: EntryType,
#[serde(default)] #[serde(default)]
task_list: String, task_list: String,
#[serde(default = "default_true")]
multi_select: bool,
}
fn default_true() -> bool {
true
} }
#[derive(Deserialize)] #[derive(Deserialize)]
@ -174,8 +189,11 @@ fn create_directory(
node: &mut NodeMut<Rc<ListNode>>, node: &mut NodeMut<Rc<ListNode>>,
command_dir: &Path, command_dir: &Path,
validate: bool, validate: bool,
parent_multi_select: bool,
) { ) {
for entry in data { for entry in data {
let multi_select = parent_multi_select && entry.multi_select;
match entry.entry_type { match entry.entry_type {
EntryType::Entries(entries) => { EntryType::Entries(entries) => {
let mut node = node.append(Rc::new(ListNode { let mut node = node.append(Rc::new(ListNode {
@ -183,8 +201,9 @@ fn create_directory(
description: entry.description, description: entry.description,
command: Command::None, command: Command::None,
task_list: String::new(), task_list: String::new(),
multi_select,
})); }));
create_directory(entries, &mut node, command_dir, validate); create_directory(entries, &mut node, command_dir, validate, multi_select);
} }
EntryType::Command(command) => { EntryType::Command(command) => {
node.append(Rc::new(ListNode { node.append(Rc::new(ListNode {
@ -192,6 +211,7 @@ fn create_directory(
description: entry.description, description: entry.description,
command: Command::Raw(command), command: Command::Raw(command),
task_list: String::new(), task_list: String::new(),
multi_select,
})); }));
} }
EntryType::Script(script) => { EntryType::Script(script) => {
@ -210,6 +230,7 @@ fn create_directory(
file: script, file: script,
}, },
task_list: entry.task_list, task_list: entry.task_list,
multi_select,
})); }));
} }
} }
@ -252,9 +273,9 @@ fn is_executable(path: &Path) -> bool {
.unwrap_or(false) .unwrap_or(false)
} }
impl TabList { impl TabDirectories {
fn get_tabs() -> (TempDir, Vec<PathBuf>) { fn get_tabs() -> (TempDir, Vec<PathBuf>) {
let temp_dir = TempDir::new().unwrap(); let temp_dir = TempDir::with_prefix("linutil_scripts").unwrap();
TAB_DATA TAB_DATA
.extract(&temp_dir) .extract(&temp_dir)
.expect("Failed to extract the saved directory"); .expect("Failed to extract the saved directory");

View File

@ -1,11 +1,14 @@
mod config;
mod inner; mod inner;
use std::rc::Rc; use std::rc::Rc;
pub use ego_tree;
use ego_tree::Tree; use ego_tree::Tree;
use std::path::PathBuf; use std::path::PathBuf;
pub use inner::get_tabs; pub use config::Config;
pub use inner::{get_tabs, TabList};
#[derive(Clone, Hash, Eq, PartialEq)] #[derive(Clone, Hash, Eq, PartialEq)]
pub enum Command { pub enum Command {
@ -23,7 +26,6 @@ pub enum Command {
pub struct Tab { pub struct Tab {
pub name: String, pub name: String,
pub tree: Tree<Rc<ListNode>>, pub tree: Tree<Rc<ListNode>>,
pub multi_selectable: bool,
} }
#[derive(Clone, Hash, Eq, PartialEq)] #[derive(Clone, Hash, Eq, PartialEq)]
@ -32,4 +34,18 @@ pub struct ListNode {
pub description: String, pub description: String,
pub command: Command, pub command: Command,
pub task_list: String, 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
}
})
}
} }

View File

@ -0,0 +1,48 @@
#!/bin/sh -e
. ../../common-script.sh
manualInstall() {
JETBRAINS_TOOLBOX_DIR="/opt/jetbrains-toolbox"
case "$ARCH" in
x86_64) ARCHIVE_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release" | jq -r ".TBA[0].downloads.linux.link") ;;
aarch64) ARCHIVE_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release" | jq -r ".TBA[0].downloads.linuxARM64.link") ;;
esac
curl -fSL "$ARCHIVE_URL" -o "jetbrains-toolbox.tar.gz"
if [ -d "$JETBRAINS_TOOLBOX_DIR" ]; then
"$ESCALATION_TOOL" rm -rf "$JETBRAINS_TOOLBOX_DIR"
fi
"$ESCALATION_TOOL" mkdir -p "$JETBRAINS_TOOLBOX_DIR"
"$ESCALATION_TOOL" tar -xzf "jetbrains-toolbox.tar.gz" -C "$JETBRAINS_TOOLBOX_DIR" --strip-components=1
"$ESCALATION_TOOL" ln -sf "$JETBRAINS_TOOLBOX_DIR/jetbrains-toolbox" "/usr/bin/jetbrains-toolbox"
}
installJetBrainsToolBox() {
if ! command_exists jetbrains-toolbox; then
printf "%b\n" "${YELLOW}Installing Jetbrains Toolbox...${RC}"
case "$PACKAGER" in
pacman)
"$AUR_HELPER" -S --needed --noconfirm jetbrains-toolbox
;;
dnf)
manualInstall
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y libfuse2
manualInstall
;;
esac
printf "%b\n" "${GREEN}Successfully installed Jetbrains Toolbox.${RC}"
else
printf "%b\n" "${GREEN}Jetbrains toolbox is already installed.${RC}"
fi
}
checkEnv
checkEscalationTool
checkAURHelper
installJetBrainsToolBox

View File

@ -3,7 +3,7 @@
. ../../common-script.sh . ../../common-script.sh
installMeld() { installMeld() {
if ! command_exists meld; then if ! command_exists org.gnome.meld && ! command_exists meld; then
printf "%b\n" "${YELLOW}Installing Meld...${RC}" printf "%b\n" "${YELLOW}Installing Meld...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
@ -12,8 +12,11 @@ installMeld() {
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" -y install meld "$ESCALATION_TOOL" "$PACKAGER" -y install meld
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add meld
;;
*) *)
. ../setup-flatpak.sh checkFlatpak
flatpak install -y flathub org.gnome.meld flatpak install -y flathub org.gnome.meld
;; ;;
esac esac

View File

@ -29,6 +29,9 @@ installNeovim() {
dnf|zypper) dnf|zypper)
"$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git "$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}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -3,7 +3,7 @@
. ../../common-script.sh . ../../common-script.sh
installVsCode() { installVsCode() {
if ! command_exists code; then if ! command_exists com.visualstudio.code && ! command_exists code; then
printf "%b\n" "${YELLOW}Installing VS Code..${RC}." printf "%b\n" "${YELLOW}Installing VS Code..${RC}."
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) 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 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 "$ESCALATION_TOOL" "$PACKAGER" install -y code
;; ;;
apk)
checkFlatpak
flatpak install -y flathub com.visualstudio.code
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -3,7 +3,7 @@
. ../../common-script.sh . ../../common-script.sh
installVsCodium() { installVsCodium() {
if ! command_exists codium; then if ! command_exists com.vscodium.codium && ! command_exists codium; then
printf "%b\n" "${YELLOW}Installing VS Codium...${RC}" printf "%b\n" "${YELLOW}Installing VS Codium...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) 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 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 "$ESCALATION_TOOL" "$PACKAGER" install -y codium
;; ;;
apk)
checkFlatpak
flatpak install -y flathub com.vscodium.codium
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -9,6 +9,9 @@ installAlacritty() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add alacritty
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty "$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
;; ;;

View File

@ -15,6 +15,9 @@ install_adb() {
dnf|zypper) dnf|zypper)
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools "$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add android-tools
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1

View File

@ -3,14 +3,9 @@
. ../common-script.sh . ../common-script.sh
installBottles() { installBottles() {
if ! command_exists flatpak; then if ! command_exists com.usebottles.bottles; then
printf "%b\n" "${YELLOW}Installing Bottles...${RC}" printf "%b\n" "${YELLOW}Installing Bottles...${RC}"
case "$PACKAGER" in flatpak install -y flathub com.usebottles.bottles
*)
. ./setup-flatpak.sh
flatpak install -y flathub com.usebottles.bottles
;;
esac
else else
printf "%b\n" "${GREEN}Bottles is already installed.${RC}" printf "%b\n" "${GREEN}Bottles is already installed.${RC}"
fi fi
@ -18,4 +13,5 @@ installBottles() {
checkEnv checkEnv
checkEscalationTool checkEscalationTool
checkFlatpak
installBottles installBottles

View File

@ -3,7 +3,7 @@
. ../../common-script.sh . ../../common-script.sh
installBrave() { installBrave() {
if ! command_exists brave; then if ! command_exists com.brave.Browser && ! command_exists brave; then
printf "%b\n" "${YELLOW}Installing Brave...${RC}" printf "%b\n" "${YELLOW}Installing Brave...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) 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" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
"$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser "$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}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -9,6 +9,9 @@ if ! command_exists chromium; then
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add chromium
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium "$ESCALATION_TOOL" "$PACKAGER" install -y chromium
;; ;;

View File

@ -18,6 +18,9 @@ installFirefox() {
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox "$ESCALATION_TOOL" "$PACKAGER" install -y firefox
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add firefox
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -3,7 +3,7 @@
. ../../common-script.sh . ../../common-script.sh
installLibreWolf() { installLibreWolf() {
if ! command_exists librewolf; then if ! command_exists io.gitlab.librewolf-community && ! command_exists librewolf; then
printf "%b\n" "${YELLOW}Installing Librewolf...${RC}" printf "%b\n" "${YELLOW}Installing Librewolf...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
@ -32,6 +32,10 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/
pacman) pacman)
"$AUR_HELPER" -S --needed --noconfirm librewolf-bin "$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}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -9,6 +9,9 @@ installLynx() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add lynx
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx "$ESCALATION_TOOL" "$PACKAGER" install -y lynx
;; ;;

View File

@ -22,6 +22,7 @@ installThrorium() {
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;; ;;
esac esac
else else

View File

@ -2,22 +2,39 @@
. ../../common-script.sh . ../../common-script.sh
installLynx() { installVivaldi() {
if ! command_exists lynx; then if ! command_exists vivaldi; then
printf "%b\n" "${YELLOW}Installing Lynx...${RC}" printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y curl
"$ESCALATION_TOOL" curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo dd of=/usr/share/keyrings/vivaldi-browser.gpg
"$ESCALATION_TOOL" echo "deb [signed-by=/usr/share/keyrings/vivaldi-browser.gpg arch=$(dpkg --print-architecture)] https://repo.vivaldi.com/archive/deb/ stable main" | sudo dd of=/etc/apt/sources.list.d/vivaldi-archive.list
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y vivaldi-stable
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://repo.vivaldi.com/stable/vivaldi-fedora.repo
"$ESCALATION_TOOL" "$PACKAGER" install -y vivaldi-stable
;;
zypper)
"$ESCALATION_TOOL" zypper ar https://repo.vivaldi.com/archive/vivaldi-suse.repo
"$ESCALATION_TOOL" zypper --non-interactive --gpg-auto-import-keys in vivaldi-stable
;;
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm vivaldi
;; ;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;; ;;
esac esac
else else
printf "%b\n" "${GREEN}Lynx TUI Browser is already installed.${RC}" printf "%b\n" "${GREEN}Vivaldi Browser is already installed.${RC}"
fi fi
} }
checkEnv checkEnv
checkEscalationTool checkEscalationTool
installLynx installVivaldi

View File

@ -0,0 +1,25 @@
#!/bin/sh -e
. ../../common-script.sh
installWaterfox() {
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
;;
*)
checkFlatpak
flatpak install -y flathub net.waterfox.waterfox
;;
esac
else
printf "%b\n" "${GREEN}Waterfox is already installed.${RC}"
fi
}
checkEnv
checkEscalationTool
checkAURHelper
installWaterfox

View File

@ -3,7 +3,7 @@
. ../../common-script.sh . ../../common-script.sh
installDiscord() { installDiscord() {
if ! command_exists discord; then if ! command_exists com.discordapp.Discord && ! command_exists discord; then
printf "%b\n" "${YELLOW}Installing Discord...${RC}" printf "%b\n" "${YELLOW}Installing Discord...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) 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 https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
"$ESCALATION_TOOL" "$PACKAGER" install -y discord "$ESCALATION_TOOL" "$PACKAGER" install -y discord
;; ;;
apk)
checkFlatpak
flatpak install -y flathub com.discordapp.Discord
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -3,7 +3,7 @@
. ../../common-script.sh . ../../common-script.sh
installJitsi() { 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}" printf "%b\n" "${YELLOW}Installing Jitsi meet...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
@ -21,6 +21,10 @@ installJitsi() {
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet "$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}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -3,7 +3,7 @@
. ../../common-script.sh . ../../common-script.sh
installSignal() { installSignal() {
if ! command_exists signal; then if ! command_exists org.signal.Signal && ! command_exists signal; then
printf "%b\n" "${YELLOW}Installing Signal...${RC}" printf "%b\n" "${YELLOW}Installing Signal...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
@ -20,8 +20,12 @@ installSignal() {
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm signal-desktop "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm signal-desktop
;; ;;
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" copr enable luminoso/Signal-Desktop checkFlatpak
"$ESCALATION_TOOL" "$PACKAGER" install -y signal-desktop 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}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"

View File

@ -3,14 +3,14 @@
. ../../common-script.sh . ../../common-script.sh
installSlack() { installSlack() {
if ! command_exists slack; then if ! command_exists com.slack.Slack && ! command_exists slack; then
printf "%b\n" "${YELLOW}Installing Slack...${RC}" printf "%b\n" "${YELLOW}Installing Slack...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
"$AUR_HELPER" -S --needed --noconfirm slack-desktop "$AUR_HELPER" -S --needed --noconfirm slack-desktop
;; ;;
*) *)
. ../setup-flatpak.sh checkFlatpak
flatpak install -y flathub com.slack.Slack flatpak install -y flathub com.slack.Slack
;; ;;
esac esac

View File

@ -9,6 +9,9 @@ installTelegram() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm telegram-desktop "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm telegram-desktop
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add telegram-desktop
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop "$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop
;; ;;

View File

@ -9,6 +9,9 @@ installThunderBird() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add thunderbird
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird "$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird
;; ;;

View File

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

View File

@ -3,14 +3,14 @@
. ../../common-script.sh . ../../common-script.sh
installZoom() { installZoom() {
if ! command_exists zoom; then if ! command_exists us.zoom.Zoom && ! command_exists zoom; then
printf "%b\n" "${YELLOW}Installing Zoom...${RC}" printf "%b\n" "${YELLOW}Installing Zoom...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
"$AUR_HELPER" -S --needed --noconfirm zoom "$AUR_HELPER" -S --needed --noconfirm zoom
;; ;;
*) *)
. ../setup-flatpak.sh checkFlatpak
flatpak install -y flathub us.zoom.Zoom flatpak install -y flathub us.zoom.Zoom
;; ;;
esac esac

View File

@ -1,10 +1,10 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../common-script.sh
. ../common-service-script.sh
# Function to prompt the user for installation choice # Function to prompt the user for installation choice
choose_installation() { choose_installation() {
clear
printf "%b\n" "${YELLOW}Choose what to install:${RC}" printf "%b\n" "${YELLOW}Choose what to install:${RC}"
printf "%b\n" "1. ${YELLOW}Docker${RC}" printf "%b\n" "1. ${YELLOW}Docker${RC}"
printf "%b\n" "2. ${YELLOW}Docker Compose${RC}" printf "%b\n" "2. ${YELLOW}Docker Compose${RC}"
@ -26,21 +26,28 @@ install_docker() {
apt-get|nala) apt-get|nala)
curl -fsSL https://get.docker.com | sh curl -fsSL https://get.docker.com | sh
;; ;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
"$ESCALATION_TOOL" "$PACKAGER" -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin
"$ESCALATION_TOOL" systemctl enable --now docker
;;
zypper) zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker
"$ESCALATION_TOOL" systemctl enable docker
"$ESCALATION_TOOL" systemctl start docker
;; ;;
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm docker "$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}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1
;; ;;
esac esac
startAndEnableService docker
} }
install_docker_compose() { install_docker_compose() {
@ -49,12 +56,20 @@ install_docker_compose() {
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin "$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin
;; ;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
"$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin
;;
zypper) zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker-compose "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker-compose
;; ;;
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm docker-compose "$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}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -6,7 +6,7 @@ setupDWM() {
printf "%b\n" "${YELLOW}Installing DWM-Titus...${RC}" printf "%b\n" "${YELLOW}Installing DWM-Titus...${RC}"
case "$PACKAGER" in # Install pre-Requisites case "$PACKAGER" in # Install pre-Requisites
pacman) 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) 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 "$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
@ -214,10 +214,28 @@ setupDisplayManager() {
printf "%b\n" "${YELLOW}3. GDM ${RC}" printf "%b\n" "${YELLOW}3. GDM ${RC}"
printf "%b\n" "${YELLOW} ${RC}" printf "%b\n" "${YELLOW} ${RC}"
printf "%b" "${YELLOW}Please select one: ${RC}" printf "%b" "${YELLOW}Please select one: ${RC}"
read -r DM read -r choice
case "$choice" in
1)
DM="sddm"
;;
2)
DM="lightdm"
;;
3)
DM="gdm"
;;
*)
printf "%b\n" "${RED}Invalid selection! Please choose 1, 2, or 3.${RC}"
exit 1
;;
esac
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM" "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$DM"
if [ "$DM" = "lightdm" ]; then
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lightdm-gtk-greeter
fi
;; ;;
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM" "$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"

View File

@ -14,6 +14,9 @@ installFastfetch() {
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb "$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
rm /tmp/fastfetch.deb rm /tmp/fastfetch.deb
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add fastfetch
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch "$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
;; ;;

View File

@ -9,6 +9,9 @@ installKitty() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm kitty "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm kitty
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add kitty
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y kitty "$ESCALATION_TOOL" "$PACKAGER" install -y kitty
;; ;;

View File

@ -25,6 +25,10 @@ installLinutil() {
esac esac
printf "%b\n" "${GREEN}Installed successfully.${RC}" 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\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}" printf "%b" "${YELLOW}Do you want to install the crates.io package? (y/N): ${RC}"
@ -35,15 +39,17 @@ installLinutil() {
printf "%b\n" "${YELLOW}Installing rustup...${RC}" printf "%b\n" "${YELLOW}Installing rustup...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm curl rustup man-db
;; ;;
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup "$ESCALATION_TOOL" "$PACKAGER" install -y curl rustup man-pages man-db man
;; ;;
zypper) apk)
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make "$ESCALATION_TOOL" "$PACKAGER" add build-base
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y "$ESCALATION_TOOL" "$PACKAGER" add rustup
. $HOME/.cargo/env rustup-init
# shellcheck disable=SC1091
. "$HOME/.cargo/env"
;; ;;
*) *)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
@ -54,12 +60,23 @@ installLinutil() {
rustup default stable rustup default stable
cargo install --force linutil_tui cargo install --force linutil_tui
printf "%b\n" "${GREEN}Installed successfully.${RC}" printf "%b\n" "${GREEN}Installed successfully.${RC}"
installExtra
;; ;;
*) printf "%b\n" "${RED}Linutil not installed.${RC}" ;; *) printf "%b\n" "${RED}Linutil not installed.${RC}" ;;
esac esac
esac esac
} }
installExtra() {
printf "%b\n" "${YELLOW}Installing the manpage...${RC}"
"$ESCALATION_TOOL" mkdir -p /usr/share/man/man1
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/man/linutil.1' | "$ESCALATION_TOOL" tee '/usr/share/man/man1/linutil.1' > /dev/null
printf "%b\n" "${YELLOW}Creating a Desktop Entry...${RC}"
"$ESCALATION_TOOL" mkdir -p /usr/share/applications
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/linutil.desktop' | "$ESCALATION_TOOL" tee /usr/share/applications/linutil.desktop > /dev/null
printf "%b\n" "${GREEN}Done.${RC}"
}
checkEnv checkEnv
checkEscalationTool checkEscalationTool
checkAURHelper checkAURHelper

View File

@ -19,6 +19,13 @@ updateLinutil() {
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. $HOME/.cargo/env . $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 "$ESCALATION_TOOL" "$PACKAGER" install -y rustup
;; ;;

View File

@ -5,16 +5,19 @@
gitpath="$HOME/.local/share/mybash" gitpath="$HOME/.local/share/mybash"
installDepend() { installDepend() {
if ! command_exists bash bash-completion tar bat tree unzip fontconfig git; then if [ ! -f "/usr/share/bash-completion/bash_completion" ] || ! command_exists bash tar bat tree unzip fc-list git; then
printf "%b\n" "${YELLOW}Installing Bash...${RC}" printf "%b\n" "${YELLOW}Installing Bash...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
;; ;;
*) apk)
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git "$ESCALATION_TOOL" "$PACKAGER" add bash bash-completion tar bat tree unzip fontconfig git
;; ;;
esac *)
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
;;
esac
fi fi
} }
@ -54,7 +57,7 @@ installStarshipAndFzf() {
return return
fi 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}" printf "%b\n" "${RED}Something went wrong during starship install!${RC}"
exit 1 exit 1
fi fi

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../../common-script.sh
installFreeOffice() { installFreeOffice() {
if ! command_exists softmaker-freeoffice-2024 freeoffice softmaker; then if ! command_exists softmaker-freeoffice-2024 freeoffice softmaker; then

View File

@ -1,21 +1,24 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../../common-script.sh
installLibreOffice() { installLibreOffice() {
if ! command_exists libreoffice; then if ! command_exists org.libreoffice.LibreOffice && ! command_exists libreoffice; then
printf "%b\n" "${YELLOW}Installing Libre Office...${RC}" printf "%b\n" "${YELLOW}Installing Libre Office...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core "$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core
;; ;;
zypper|dnf) zypper|dnf)
. ./setup-flatpak.sh checkFlatpak
flatpak install -y flathub org.libreoffice.LibreOffice flatpak install -y flathub org.libreoffice.LibreOffice
;; ;;
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add libreoffice
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -1,9 +1,9 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../../common-script.sh
installOnlyOffice() { installOnlyOffice() {
if ! command_exists onlyoffice-desktopeditors; then if ! command_exists org.onlyoffice.desktopeditors && ! command_exists onlyoffice-desktopeditors; then
printf "%b\n" "${YELLOW}Installing Only Office..${RC}." printf "%b\n" "${YELLOW}Installing Only Office..${RC}."
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
@ -11,7 +11,7 @@ installOnlyOffice() {
"$ESCALATION_TOOL" "$PACKAGER" install -y ./onlyoffice-desktopeditors_amd64.deb "$ESCALATION_TOOL" "$PACKAGER" install -y ./onlyoffice-desktopeditors_amd64.deb
;; ;;
zypper|dnf) zypper|dnf)
. ./setup-flatpak.sh checkFlatpak
flatpak install -y flathub org.onlyoffice.desktopeditors flatpak install -y flathub org.onlyoffice.desktopeditors
;; ;;
pacman) pacman)

View File

@ -1,16 +1,16 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../../common-script.sh
installWpsOffice() { installWpsOffice() {
if ! command_exists com.wps.Office; then if ! command_exists com.wps.Office && ! command_exists wps; then
printf "%b\n" "${YELLOW}Installing WPS Office...${RC}" printf "%b\n" "${YELLOW}Installing WPS Office...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
"$AUR_HELPER" -S --needed --noconfirm wps-office "$AUR_HELPER" -S --needed --noconfirm wps-office
;; ;;
*) *)
. ./setup-flatpak.sh checkFlatpak
flatpak install flathub com.wps.Office flatpak install flathub com.wps.Office
;; ;;
esac esac

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../../common-script.sh
installEvince() { installEvince() {
if ! command_exists evince; then if ! command_exists evince; then
@ -9,6 +9,9 @@ installEvince() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm evince "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm evince
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add evince
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y evince "$ESCALATION_TOOL" "$PACKAGER" install -y evince
;; ;;

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../../common-script.sh
installOkular() { installOkular() {
if ! command_exists okular; then if ! command_exists okular; then
@ -9,6 +9,9 @@ installOkular() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm okular "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm okular
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add okular
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y okular "$ESCALATION_TOOL" "$PACKAGER" install -y okular
;; ;;

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../../common-script.sh
installPdfstudio() { installPdfstudio() {
if ! command_exists pdfstudio2024; then if ! command_exists pdfstudio2024; then

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../../common-script.sh
installPdfstudioviewer() { installPdfstudioviewer() {
if ! command_exists pdfstudioviewer2024; then if ! command_exists pdfstudioviewer2024; then

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

@ -9,6 +9,9 @@ installRofi() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rofi "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rofi
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add rofi
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y rofi "$ESCALATION_TOOL" "$PACKAGER" install -y rofi
;; ;;

View File

@ -2,9 +2,7 @@
. ../common-script.sh . ../common-script.sh
# Used to detect the desktop environment, Only used for the If statement in the setup_flatpak function. checkDE() {
# Perhaps this should be moved to common-script.sh later on?
detect_de() {
if [ -n "$XDG_CURRENT_DESKTOP" ]; then if [ -n "$XDG_CURRENT_DESKTOP" ]; then
case "$XDG_CURRENT_DESKTOP" in case "$XDG_CURRENT_DESKTOP" in
*GNOME*) *GNOME*)
@ -17,42 +15,11 @@ detect_de() {
fi fi
} }
# Install Flatpak if not already installed. installExtra() {
setup_flatpak() {
if ! command_exists flatpak; then
printf "%b\n" "${YELLOW}Installing Flatpak...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm flatpak
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y flatpak
;;
esac
printf "%b\n" "Adding Flathub remote..."
"$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
else
if command_exists flatpak; then
if ! flatpak remotes | grep -q "flathub"; then
printf "%b" "${YELLOW}Detected Flatpak package manager but Flathub remote is not added. Would you like to add it? (y/N): ${RC}"
read -r add_remote
case "$add_remote" in
[Yy]*)
printf "%b\n" "Adding Flathub remote..."
"$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
;;
esac
else
# Needed mostly for systems without a polkit agent running (Error: updating: Unable to connect to system bus)
printf "%b\n" "${GREEN}Flathub already setup. You can quit.${RC}"
fi
fi
fi
if [ "$PACKAGER" = "apt-get" ] || [ "$PACKAGER" = "nala" ]; then if [ "$PACKAGER" = "apt-get" ] || [ "$PACKAGER" = "nala" ]; then
detect_de checkDE
# Only used for Ubuntu GNOME. Ubuntu GNOME doesnt allow flathub to be added as a remote to their store. # Only used for Ubuntu GNOME. Ubuntu GNOME doesnt allow flathub to be added as a remote to their store.
# So in case the user wants to use a GUI siftware manager they can setup it here # So in case the user wants to use a GUI software manager they can setup it here
if [ "$DE" = "GNOME" ]; then if [ "$DE" = "GNOME" ]; then
printf "%b" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/N): ${RC}" printf "%b" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/N): ${RC}"
read -r install_gnome read -r install_gnome
@ -72,4 +39,5 @@ setup_flatpak() {
checkEnv checkEnv
checkEscalationTool checkEscalationTool
setup_flatpak checkFlatpak
installExtra

View File

@ -1,50 +1,5 @@
name = "Applications Setup" name = "Applications Setup"
[[data]]
name = "Developer Tools"
[[data.entries]]
name = "Github Desktop"
description = "GitHub Desktop is a user-friendly application that simplifies the process of managing Git repositories and interacting with GitHub, providing a graphical interface for tasks like committing, branching, and syncing changes."
script = "Developer-tools/githubdesktop-setup.sh"
task_list = "I"
[[data.entries]]
name = "Neovim"
description = "Neovim is a refactor, and sometimes redactor, in the tradition of Vim.\nIt is not a rewrite but a continuation and extension of Vim.\nThis command configures neovim from CTT's neovim configuration.\nhttps://github.com/ChrisTitusTech/neovim"
script = "Developer-tools/neovim-setup.sh"
task_list = "I FM"
[[data.entries]]
name = "Sublime Text"
description = "Sublime Text is a fast, lightweight, and customizable text editor known for its simplicity, powerful features, and wide range of plugins for various programming languages."
script = "Developer-tools/sublime-setup.sh"
task_list = "I"
[[data.entries]]
name = "VS Code"
description = "Visual Studio Code (VS Code) is a lightweight, open-source code editor with built-in support for debugging, version control, and extensions for various programming languages and frameworks."
script = "Developer-tools/vscode-setup.sh"
task_list = "I"
[[data.entries]]
name = "VS Codium"
description = "VSCodium is a free, open-source version of Visual Studio Code (VS Code) that removes Microsoft-specific telemetry and branding."
script = "Developer-tools/vscodium-setup.sh"
task_list = "I"
[[data.entries]]
name = "Meld"
description = "Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects."
script = "Developer-tools/meld-setup.sh"
task_list = "I FI"
[[data.entries]]
name = "Ngrok"
description = "Ngrok is a tool that creates secure, temporary tunnels to expose local servers to the internet for testing and development."
script = "Developer-tools/ngrok-setup.sh"
task_list = "I"
[[data]] [[data]]
name = "Communication Apps" name = "Communication Apps"
@ -78,21 +33,88 @@ description = "Telegram is a cloud-based messaging app known for its speed and s
script = "communication-apps/telegram-setup.sh" script = "communication-apps/telegram-setup.sh"
task_list = "I" 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"
task_list = "I"
[[data.entries]] [[data.entries]]
name = "Thunderbird" name = "Thunderbird"
description = "Thunderbird is a free, open-source email client that offers powerful features like customizable email management, a built-in calendar, and extensive add-ons for enhanced functionality." description = "Thunderbird is a free, open-source email client that offers powerful features like customizable email management, a built-in calendar, and extensive add-ons for enhanced functionality."
script = "communication-apps/thunderbird-setup.sh" script = "communication-apps/thunderbird-setup.sh"
task_list = "I" 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"
task_list = "I"
[[data]]
name = "Developer Tools"
[[data.entries]]
name = "Github Desktop"
description = "GitHub Desktop is a user-friendly application that simplifies the process of managing Git repositories and interacting with GitHub, providing a graphical interface for tasks like committing, branching, and syncing changes."
script = "Developer-tools/githubdesktop-setup.sh"
task_list = "I"
[[data.entries]]
name = "JetBrains Toolbox"
description = "JetBrains Toolbox is a collection of tools and an app that help developers work with JetBrains products."
script = "Developer-tools/jetbrains-toolbox.sh"
task_list = "I"
[[data.entries]]
name = "Meld"
description = "Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects."
script = "Developer-tools/meld-setup.sh"
task_list = "I FI"
[[data.entries]]
name = "Neovim"
description = "Neovim is a refactor, and sometimes redactor, in the tradition of Vim.\nIt is not a rewrite but a continuation and extension of Vim.\nThis command configures neovim from CTT's neovim configuration.\nhttps://github.com/ChrisTitusTech/neovim"
script = "Developer-tools/neovim-setup.sh"
task_list = "I FM"
[[data.entries]]
name = "Ngrok"
description = "Ngrok is a tool that creates secure, temporary tunnels to expose local servers to the internet for testing and development."
script = "Developer-tools/ngrok-setup.sh"
task_list = "I"
[[data.entries]]
name = "Sublime Text"
description = "Sublime Text is a fast, lightweight, and customizable text editor known for its simplicity, powerful features, and wide range of plugins for various programming languages."
script = "Developer-tools/sublime-setup.sh"
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."
script = "Developer-tools/vscode-setup.sh"
task_list = "I"
[[data.entries]]
name = "VS Codium"
description = "VSCodium is a free, open-source version of Visual Studio Code (VS Code) that removes Microsoft-specific telemetry and branding."
script = "Developer-tools/vscodium-setup.sh"
task_list = "I"
[[data]] [[data]]
name = "Office Suites" name = "Office Suites"
[[data.entries]]
name = "FreeOffice"
script = "office-suites/freeoffice.sh"
task_list = "I"
[[data.entries]] [[data.entries]]
name = "LibreOffice" name = "LibreOffice"
script = "office-suites/libreoffice.sh" script = "office-suites/libreoffice.sh"
@ -103,11 +125,6 @@ name = "OnlyOffice"
script = "office-suites/onlyoffice.sh" script = "office-suites/onlyoffice.sh"
task_list = "I" task_list = "I"
[[data.entries]]
name = "FreeOffice"
script = "office-suites/freeoffice.sh"
task_list = "I"
[[data.entries]] [[data.entries]]
name = "WPS Office" name = "WPS Office"
script = "office-suites/wpsoffice.sh" script = "office-suites/wpsoffice.sh"
@ -192,9 +209,15 @@ description = "Tor Browser is a free and open-source firefox-based web browser d
script = "browsers/tor-browser.sh" script = "browsers/tor-browser.sh"
task_list = "I" 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."
script = "browsers/waterfox.sh"
task_list = "FI"
[[data]] [[data]]
name = "Alacritty" name = "Alacritty"
description = "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.\nThis command installs and condifures alacritty terminal emulator." description = "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."
script = "alacritty-setup.sh" script = "alacritty-setup.sh"
task_list = "I FM" task_list = "I FM"
@ -206,37 +229,49 @@ task_list = "I"
[[data]] [[data]]
name = "Bash Prompt" name = "Bash Prompt"
description = "The .bashrc file is a script that runs every time a new terminal session is started in Unix-like operating systems.\nIt is used to configure the shell session, set up aliases, define functions, and more, making the terminal easier to use and more powerful.\nThis command configures the key sections and functionalities defined in the .bashrc file from CTT's mybash repository.\nhttps://github.com/ChrisTitusTech/mybash" description = "The .bashrc file is a script that runs every time a new terminal session is started in Unix-like operating systems. It is used to configure the shell session, set up aliases, define functions, and more, making the terminal easier to use and more powerful. This command configures the key sections and functionalities defined in the .bashrc file from CTT's mybash repository. https://github.com/ChrisTitusTech/mybash"
script = "mybash-setup.sh" script = "mybash-setup.sh"
task_list = "I FM" task_list = "I FM"
[[data]] [[data]]
name = "Bottles" name = "Bottles"
description = "Bottles allows Windows software, like applications and games, to run on Linux.\nBottles also provides tools to categorize, organize and optimize your applications." description = "Bottles allows Windows software, like applications and games, to run on Linux. Bottles also provides tools to categorize, organize and optimize your applications."
script = "bottles-setup.sh" script = "bottles-setup.sh"
task_list = "FI" task_list = "FI"
[[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"
script = "dwmtitus-setup.sh"
task_list = "I PFM SS"
[[data]] [[data]]
name = "Docker" name = "Docker"
description = "Docker is an open platform that uses OS-level virtualization to deliver software in packages called containers." description = "Docker is an open platform that uses OS-level virtualization to deliver software in packages called containers."
script = "docker-setup.sh" script = "docker-setup.sh"
task_list = "I SS" 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"
script = "dwmtitus-setup.sh"
task_list = "I PFM SS"
[[data]] [[data]]
name = "Fastfetch" name = "Fastfetch"
description = "Fastfetch is a neofetch-like tool for fetching system information and displaying it prettily.\nIt is written mainly in C, with performance and customizability in mind.\nThis command installs fastfetch and configures from CTT's mybash repository.\nhttps://github.com/ChrisTitusTech/mybash" description = "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"
script = "fastfetch-setup.sh" script = "fastfetch-setup.sh"
task_list = "I FM" task_list = "I FM"
[[data]] [[data]]
name = "Flatpak / Flathub" name = "Flatpak / Flathub"
description = "Flatpak is a universal application sandbox for Linux that uses isolated packages from Flathub to prevent conflicts and system alterations, while alleviating dependency concerns.\nThis command installs Flatpak and adds the Flathub repository" description = "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"
script = "setup-flatpak.sh" script = "setup-flatpak.sh"
task_list = "I" task_list = "I"
@ -248,7 +283,7 @@ task_list = "PFM"
[[data]] [[data]]
name = "Kitty" name = "Kitty"
description = "kitty is a free and open-source GPU-accelerated terminal emulator for Linux, macOS, and some BSD distributions, focused on performance and features.\nkitty is written in a mix of C and Python programming languages.\n This command installs and configures kitty." description = "kitty is a free and open-source GPU-accelerated terminal emulator for Linux, macOS, and some BSD distributions, focused on performance and features. kitty is written in a mix of C and Python programming languages. This command installs and configures kitty."
script = "kitty-setup.sh" script = "kitty-setup.sh"
task_list = "I FM" task_list = "I FM"
@ -261,7 +296,7 @@ task_list = "I"
[[data.preconditions]] [[data.preconditions]]
matches = false matches = false
data = "command_exists" data = "command_exists"
values = [ "linutil" ] values = ["linutil"]
[[data]] [[data]]
name = "Linutil Updater" name = "Linutil Updater"
@ -272,11 +307,11 @@ task_list = "I"
[[data.preconditions]] [[data.preconditions]]
matches = true matches = true
data = "command_exists" data = "command_exists"
values = [ "linutil" ] values = ["linutil"]
[[data]] [[data]]
name = "Rofi" name = "Rofi"
description = "Rofi is a window switcher, run dialog, ssh-launcher and dmenu replacement that started as a clone of simpleswitcher, written by Sean Pringle and later expanded by Dave Davenport.\nThis command installs and configures rofi with configuration from CTT's DWM repo.\nhttps://github.com/ChrisTitusTech/dwm-titus" description = "Rofi is a window switcher, run dialog, ssh-launcher and dmenu replacement that started as a clone of simpleswitcher, written by Sean Pringle and later expanded by Dave Davenport. This command installs and configures rofi with configuration from CTT's DWM repo. https://github.com/ChrisTitusTech/dwm-titus"
script = "rofi-setup.sh" script = "rofi-setup.sh"
task_list = "I FM" task_list = "I FM"
@ -288,10 +323,10 @@ task_list = "I SS"
[[data.preconditions]] [[data.preconditions]]
matches = true matches = true
data = { environment = "XDG_SESSION_TYPE" } data = { environment = "XDG_SESSION_TYPE" }
values = [ "wayland", "Wayland" ] values = ["wayland", "Wayland"]
[[data]] [[data]]
name = "ZSH Prompt" name = "ZSH Prompt"
description = "The Z shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.\nThis command installs ZSH prompt and provides basic configuration." description = "The Z shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh. This command installs ZSH prompt and provides basic configuration."
script = "zsh-setup.sh" script = "zsh-setup.sh"
task_list = "I FM" task_list = "I FM"

View File

@ -15,10 +15,17 @@ installWaydroid() {
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
"$AUR_HELPER" -S --needed --noconfirm waydroid "$AUR_HELPER" -S --needed --noconfirm waydroid
if command_exists dkms; then if ! command_exists dkms; then
"$AUR_HELPER" -S --needed --noconfirm binder_linux-dkms installed_kernels=$("$PACKAGER" -Q | grep -E '^linux(| |-rt|-rt-lts|-hardened|-zen|-lts)[^-headers]' | cut -d ' ' -f 1)
"$ESCALATION_TOOL" modprobe binder-linux device=binder,hwbinder,vndbinder 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
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm dkms
fi fi
"$AUR_HELPER" -S --needed --noconfirm binder_linux-dkms
"$ESCALATION_TOOL" modprobe binder-linux device=binder,hwbinder,vndbinder
;; ;;
apt-get|nala) apt-get|nala)
curl https://repo.waydro.id | "$ESCALATION_TOOL" sh curl https://repo.waydro.id | "$ESCALATION_TOOL" sh

View File

@ -10,6 +10,9 @@ installZsh() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add zsh
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh "$ESCALATION_TOOL" "$PACKAGER" install -y zsh
;; ;;

View File

@ -9,7 +9,48 @@ CYAN='\033[36m'
GREEN='\033[32m' GREEN='\033[32m'
command_exists() { command_exists() {
command -v "$1" >/dev/null 2>&1 for cmd in "$@"; do
export PATH="$HOME/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH"
command -v "$cmd" >/dev/null 2>&1 || return 1
done
return 0
}
checkFlatpak() {
if ! command_exists flatpak; then
printf "%b\n" "${YELLOW}Installing Flatpak...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm flatpak
;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add flatpak
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y flatpak
;;
esac
printf "%b\n" "${YELLOW}Adding Flathub remote...${RC}"
"$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
printf "%b\n" "${YELLOW}Applications installed by Flatpak may not appear on your desktop until the user session is restarted...${RC}"
else
if ! flatpak remotes | grep -q "flathub"; then
printf "%b\n" "${YELLOW}Adding Flathub remote...${RC}"
"$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
else
printf "%b\n" "${CYAN}Flatpak is installed${RC}"
fi
fi
}
checkArch() {
case "$(uname -m)" in
x86_64 | amd64) ARCH="x86_64" ;;
aarch64 | arm64) ARCH="aarch64" ;;
*) printf "%b\n" "${RED}Unsupported architecture: $(uname -m)${RC}" && exit 1 ;;
esac
printf "%b\n" "${CYAN}System architecture: ${ARCH}${RC}"
} }
checkAURHelper() { checkAURHelper() {
@ -82,6 +123,12 @@ checkPackageManager() {
fi fi
done 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 if [ -z "$PACKAGER" ]; then
printf "%b\n" "${RED}Can't find a supported package manager${RC}" printf "%b\n" "${RED}Can't find a supported package manager${RC}"
exit 1 exit 1
@ -125,9 +172,10 @@ checkDistro() {
} }
checkEnv() { checkEnv() {
checkArch
checkEscalationTool checkEscalationTool
checkCommandRequirements "curl groups $ESCALATION_TOOL" checkCommandRequirements "curl groups $ESCALATION_TOOL"
checkPackageManager 'nala apt-get dnf pacman zypper' checkPackageManager 'nala apt-get dnf pacman zypper apk'
checkCurrentDirectoryWritable checkCurrentDirectoryWritable
checkSuperUser checkSuperUser
checkDistro checkDistro

View 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'

View File

@ -5,6 +5,6 @@ name = "Diablo II Resurrected"
[[data.entries]] [[data.entries]]
name = "Loot Filter" name = "Loot Filter"
description = "This is a loot filter for Diablo II Resurrected.\nIt's designed to be a simple, clean, and easy to read loot filter that highlights the most important items.\nWorks on battle.net and single player.\nNo frills, no config, just highlights high runes and other valuable items.\nFor more information visit: https://github.com/ChrisTitusTech/d2r-loot-filter" description = "This is a loot filter for Diablo II Resurrected. It's designed to be a simple, clean, and easy to read loot filter that highlights the most important items. Works on battle.net and single player. No frills, no config, just highlights high runes and other valuable items. For more information visit: https://github.com/ChrisTitusTech/d2r-loot-filter"
script = "diablo-ii/d2r-loot-filters.sh" script = "diablo-ii/d2r-loot-filters.sh"
task_list = "FM" task_list = "FM"

View File

@ -9,6 +9,9 @@ installPkg() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm ufw "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm ufw
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add ufw
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y ufw "$ESCALATION_TOOL" "$PACKAGER" install -y ufw
;; ;;

View File

@ -2,6 +2,6 @@ name = "Security"
[[data]] [[data]]
name = "Firewall Baselines (CTT)" name = "Firewall Baselines (CTT)"
description = "Developed to ease iptables firewall configuration, UFW provides a user friendly way to create an IPv4 or IPv6 host-based firewall.\nThis command installs UFW and configures UFW based on CTT's recommended rules.\nFor more information visit: https://christitus.com/linux-security-mistakes" description = "Developed to ease iptables firewall configuration, UFW provides a user friendly way to create an IPv4 or IPv6 host-based firewall. This command installs UFW and configures UFW based on CTT's recommended rules. For more information visit: https://christitus.com/linux-security-mistakes"
script = "firewall-baselines.sh" script = "firewall-baselines.sh"
task_list = "I SS" task_list = "I SS"

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

@ -8,8 +8,8 @@ installDepend() {
if ! command_exists paru; then if ! command_exists paru; then
printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}" printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}"
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel git
cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/paru.git && "$ESCALATION_TOOL" chown -R "$USER": ./paru cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/paru-bin.git && "$ESCALATION_TOOL" chown -R "$USER": ./paru-bin
cd paru && makepkg --noconfirm -si cd paru-bin && makepkg --noconfirm -si
printf "%b\n" "${GREEN}Paru installed${RC}" printf "%b\n" "${GREEN}Paru installed${RC}"
else else
printf "%b\n" "${GREEN}Paru already installed${RC}" printf "%b\n" "${GREEN}Paru already installed${RC}"

View File

@ -386,33 +386,36 @@ fi
if [[ "${FS}" == "btrfs" ]]; then if [[ "${FS}" == "btrfs" ]]; then
mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" mkfs.vfat -F32 -n "EFIBOOT" "${partition2}"
mkfs.btrfs -L ROOT "${partition3}" -f mkfs.btrfs -f "${partition3}"
mount -t btrfs "${partition3}" /mnt mount -t btrfs "${partition3}" /mnt
subvolumesetup subvolumesetup
elif [[ "${FS}" == "ext4" ]]; then elif [[ "${FS}" == "ext4" ]]; then
mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" mkfs.vfat -F32 -n "EFIBOOT" "${partition2}"
mkfs.ext4 -L ROOT "${partition3}" mkfs.ext4 "${partition3}"
mount -t ext4 "${partition3}" /mnt mount -t ext4 "${partition3}" /mnt
elif [[ "${FS}" == "luks" ]]; then elif [[ "${FS}" == "luks" ]]; then
mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" mkfs.vfat -F32 "${partition2}"
# enter luks password to cryptsetup and format root partition # enter luks password to cryptsetup and format root partition
echo -n "${LUKS_PASSWORD}" | cryptsetup -y -v luksFormat "${partition3}" - echo -n "${LUKS_PASSWORD}" | cryptsetup -y -v luksFormat "${partition3}" -
# open luks container and ROOT will be place holder # open luks container and ROOT will be place holder
echo -n "${LUKS_PASSWORD}" | cryptsetup open "${partition3}" ROOT - echo -n "${LUKS_PASSWORD}" | cryptsetup open "${partition3}" ROOT -
# now format that container # now format that container
mkfs.btrfs -L ROOT "${partition3}" mkfs.btrfs "${partition3}"
# create subvolumes for btrfs # create subvolumes for btrfs
mount -t btrfs "${partition3}" /mnt mount -t btrfs "${partition3}" /mnt
subvolumesetup subvolumesetup
ENCRYPTED_PARTITION_UUID=$(blkid -s UUID -o value "${partition3}")
fi fi
BOOT_UUID=$(blkid -s UUID -o value "${partition2}")
sync sync
if ! mountpoint -q /mnt; then if ! mountpoint -q /mnt; then
echo "ERROR! Failed to mount ${partition3} to /mnt after multiple attempts." echo "ERROR! Failed to mount ${partition3} to /mnt after multiple attempts."
exit 1 exit 1
fi fi
mkdir -p /mnt/boot/efi mkdir -p /mnt/boot/efi
mount -t vfat -L EFIBOOT /mnt/boot/ mount -t vfat -U "${BOOT_UUID}" /mnt/boot/
if ! grep -qs '/mnt' /proc/mounts; then if ! grep -qs '/mnt' /proc/mounts; then
echo "Drive is not mounted can not continue" echo "Drive is not mounted can not continue"
@ -435,7 +438,7 @@ fi
echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
genfstab -L /mnt >> /mnt/etc/fstab genfstab -U /mnt >> /mnt/etc/fstab
echo " echo "
Generated /etc/fstab: Generated /etc/fstab:
" "
@ -526,6 +529,9 @@ sed -i 's/^# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: A
#Add parallel downloading #Add parallel downloading
sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
#Set colors and enable the easter egg
sed -i 's/^#Color/Color\nILoveCandy/' /etc/pacman.conf
#Enable multilib #Enable multilib
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
pacman -Sy --noconfirm --needed pacman -Sy --noconfirm --needed

View 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

View File

@ -37,6 +37,9 @@ installDepend() {
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit "$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 "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
;; ;;

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

@ -0,0 +1,83 @@
#!/bin/sh -e
. ../../common-script.sh
current_version=$(rpm -E '%{fedora}')
next_version=$((current_version + 1))
update() {
printf "%b\n" "${YELLOW}Make sure your system is fully updated; if not, update it first and reboot once.${RC}"
printf "%b\n" "${CYAN}Your current Fedora version is $current_version.${RC}"
printf "%b\n" "${CYAN}The next available version is $next_version.${RC}"
printf "%b\n" "${YELLOW}Do you want to update to $next_version? (y/n): ${RC}"
read -r response
case "$response" in
y|Y)
printf "%b\n" "${CYAN}Preparing to update to $next_version...${RC}"
if ! "$ESCALATION_TOOL" "$PACKAGER" install dnf-plugin-system-upgrade -y; then
printf "%b\n" "${RED}Failed to install dnf-plugin-system-upgrade.${RC}"
exit 1
fi
if ! "$ESCALATION_TOOL" "$PACKAGER" system-upgrade download --releasever="$next_version" -y ; then
printf "%b\n" "${RED}Failed to download the upgrade packages.${RC}"
exit 1
fi
printf "%b\n" "${YELLOW}Do you want to reboot now to apply the upgrade? (y/n): ${RC}"
read -r reboot_response
case "$reboot_response" in
y|Y)
printf "%b\n" "${YELLOW}Rebooting to apply the upgrade...${RC}"
"$ESCALATION_TOOL" "$PACKAGER" system-upgrade reboot
;;
*)
printf "%b\n" "${YELLOW}You can reboot later to apply the upgrade.${RC}"
;;
esac
;;
*)
printf "%b\n" "${RED}No upgrade performed.${RC}"
;;
esac
}
post_upgrade() {
printf "%b\n" "${YELLOW}Running post-upgrade tasks...${RC}"
case "$PACKAGER" in
dnf)
"$ESCALATION_TOOL" "$PACKAGER" autoremove
"$ESCALATION_TOOL" "$PACKAGER" distro-sync -y
;;
*)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER.${RC}"
exit 1
;;
esac
}
checkEnv
checkEscalationTool
printf "%b\n" "${YELLOW}Select an option:${RC}"
printf "%b\n" "${GREEN}1. Upgrade to the next Fedora version${RC}"
printf "%b\n" "${GREEN}2. Run post-upgrade tasks${RC}"
read -r choice
case "$choice" in
1)
update
;;
2)
post_upgrade
;;
*)
printf "%b\n" "${RED}Invalid option. Please select 1 or 2.${RC}"
exit 1
;;
esac

View File

@ -21,12 +21,12 @@ installDepend() {
alsa-utils alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib giflib lib32-giflib libpng lib32-libpng \ alsa-utils alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib giflib lib32-giflib libpng lib32-libpng \
libldap lib32-libldap openal lib32-openal libxcomposite lib32-libxcomposite libxinerama lib32-libxinerama \ libldap lib32-libldap openal lib32-openal libxcomposite lib32-libxcomposite libxinerama lib32-libxinerama \
ncurses lib32-ncurses vulkan-icd-loader lib32-vulkan-icd-loader ocl-icd lib32-ocl-icd libva lib32-libva \ ncurses lib32-ncurses vulkan-icd-loader lib32-vulkan-icd-loader ocl-icd lib32-ocl-icd libva lib32-libva \
gst-plugins-base-libs lib32-gst-plugins-base-libs sdl2" gst-plugins-base-libs lib32-gst-plugins-base-libs sdl2 lib32-sdl2 v4l-utils lib32-v4l-utils sqlite lib32-sqlite"
$AUR_HELPER -S --needed --noconfirm $DEPENDENCIES $DISTRO_DEPS $AUR_HELPER -S --needed --noconfirm $DEPENDENCIES $DISTRO_DEPS
;; ;;
apt-get|nala) apt-get|nala)
DISTRO_DEPS="libasound2 libsdl2 wine64 wine32" DISTRO_DEPS="libasound2-plugins:i386 libsdl2-2.0-0:i386 libdbus-1-3:i386 libsqlite3-0:i386 wine64 wine32"
"$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" dpkg --add-architecture i386 "$ESCALATION_TOOL" dpkg --add-architecture i386
@ -50,7 +50,8 @@ installDepend() {
"$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES "$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES
;; ;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
exit 1
;; ;;
esac esac
} }
@ -95,6 +96,8 @@ installAdditionalDepend() {
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS "$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
exit 1
;; ;;
esac esac
} }

33
core/tabs/system-setup/system-cleanup.sh Normal file → Executable file
View File

@ -1,6 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../common-script.sh
. ../common-service-script.sh
cleanup_system() { cleanup_system() {
printf "%b\n" "${YELLOW}Performing system cleanup...${RC}" printf "%b\n" "${YELLOW}Performing system cleanup...${RC}"
@ -8,9 +9,7 @@ cleanup_system() {
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" clean "$ESCALATION_TOOL" "$PACKAGER" clean
"$ESCALATION_TOOL" "$PACKAGER" autoremove -y "$ESCALATION_TOOL" "$PACKAGER" autoremove -y
"$ESCALATION_TOOL" "$PACKAGER" autoclean
"$ESCALATION_TOOL" du -h /var/cache/apt "$ESCALATION_TOOL" du -h /var/cache/apt
"$ESCALATION_TOOL" "$PACKAGER" clean
;; ;;
zypper) zypper)
"$ESCALATION_TOOL" "$PACKAGER" clean -a "$ESCALATION_TOOL" "$PACKAGER" clean -a
@ -25,18 +24,28 @@ cleanup_system() {
"$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm "$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1 "$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""${RC}" printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
return 1
;; ;;
esac esac
} }
common_cleanup() { common_cleanup() {
"$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete if [ -d /var/tmp ]; then
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete "$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; fi
"$ESCALATION_TOOL" journalctl --vacuum-time=3d if [ -d /tmp ]; then
"$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete
fi
if [ -d /var/log ]; then
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
fi
if [ "$INIT_MANAGER" = "systemctl" ]; then
"$ESCALATION_TOOL" journalctl --vacuum-time=3d
fi
} }
clean_data() { clean_data() {
@ -45,8 +54,12 @@ clean_data() {
case $clean_response in case $clean_response in
y|Y) y|Y)
printf "%b\n" "${YELLOW}Cleaning up old cache files and emptying trash...${RC}" printf "%b\n" "${YELLOW}Cleaning up old cache files and emptying trash...${RC}"
find "$HOME/.cache/" -type f -atime +5 -delete if [ -d "$HOME/.cache" ]; then
find "$HOME/.local/share/Trash" -mindepth 1 -delete find "$HOME/.cache/" -type f -atime +5 -delete
fi
if [ -d "$HOME/.local/share/Trash" ]; then
find "$HOME/.local/share/Trash" -mindepth 1 -delete
fi
printf "%b\n" "${GREEN}Cache and trash cleanup completed.${RC}" printf "%b\n" "${GREEN}Cache and trash cleanup completed.${RC}"
;; ;;
*) *)

View File

@ -48,6 +48,9 @@ fastUpdate() {
"$ESCALATION_TOOL" "$PACKAGER" ref "$ESCALATION_TOOL" "$PACKAGER" ref
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup "$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" update
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1
@ -74,6 +77,9 @@ updateSystem() {
"$ESCALATION_TOOL" "$PACKAGER" ref "$ESCALATION_TOOL" "$PACKAGER" ref
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup "$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" upgrade
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1

View File

@ -1,5 +1,4 @@
name = "System Setup" name = "System Setup"
multi_selectable = false
[[data]] [[data]]
name = "Arch Linux" name = "Arch Linux"
@ -14,16 +13,40 @@ name = "Arch Server Setup"
description = "This command installs a minimal arch server setup under 5 minutes." description = "This command installs a minimal arch server setup under 5 minutes."
script = "arch/server-setup.sh" script = "arch/server-setup.sh"
task_list = "SI D" 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]] [[data.entries]]
name = "Paru AUR Helper" name = "Paru AUR Helper"
description = "Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction.\nTo know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers" 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"
script = "arch/paru-setup.sh" script = "arch/paru-setup.sh"
task_list = "I" 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]] [[data.entries]]
name = "Yay AUR Helper" name = "Yay AUR Helper"
description = "Yet Another Yogurt - An AUR Helper Written in Go.\nTo know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers" description = "Yet Another Yogurt - An AUR Helper Written in Go. To know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers"
script = "arch/yay-setup.sh" script = "arch/yay-setup.sh"
task_list = "I" task_list = "I"
@ -55,16 +78,33 @@ task_list = "I"
[[data.entries]] [[data.entries]]
name = "RPM Fusion" name = "RPM Fusion"
description = "RPM Fusion provides software that the Fedora Project or Red Hat doesn't want to ship.\nThat 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.\nFor more information visit: https://rpmfusion.org/" description = "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/"
script = "fedora/rpm-fusion-setup.sh" script = "fedora/rpm-fusion-setup.sh"
task_list = "MP" task_list = "MP"
[[data.entries]]
name = "Upgrade to a New Fedora Release"
description = "Upgrades system to the next Fedora release"
script = "fedora/fedora-upgrade.sh"
task_list = "MP"
[[data.entries]] [[data.entries]]
name = "Virtualization" name = "Virtualization"
description = "Enables Virtualization through dnf" description = "Enables Virtualization through dnf"
script = "fedora/virtualization.sh" script = "fedora/virtualization.sh"
task_list = "I" 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]] [[data]]
name = "Build Prerequisites" name = "Build Prerequisites"
description = "This script is designed to handle the installation of various software dependencies across different Linux distributions" description = "This script is designed to handle the installation of various software dependencies across different Linux distributions"
@ -76,12 +116,14 @@ name = "Full System Cleanup"
description = "This script is designed to remove unnecessary packages, clean old cache files, remove temporary files, and to empty the trash." description = "This script is designed to remove unnecessary packages, clean old cache files, remove temporary files, and to empty the trash."
script = "system-cleanup.sh" script = "system-cleanup.sh"
task_list = "RP PFM" task_list = "RP PFM"
multi_select = false
[[data]] [[data]]
name = "Full System Update" name = "Full System Update"
description = "This command updates your system to the latest packages available for your distro" description = "This command updates your system to the latest packages available for your distro"
script = "system-update.sh" script = "system-update.sh"
task_list = "PFM" task_list = "PFM"
multi_select = false
[[data]] [[data]]
name = "Gaming Dependencies" name = "Gaming Dependencies"

View File

@ -1,6 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../common-script.sh
. ../common-service-script.sh
# Function to check Bluez is installed # Function to check Bluez is installed
setupBluetooth() { setupBluetooth() {
@ -10,6 +11,9 @@ setupBluetooth() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm bluez-utils "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm bluez-utils
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add bluez
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y bluez "$ESCALATION_TOOL" "$PACKAGER" install -y bluez
;; ;;
@ -18,15 +22,7 @@ setupBluetooth() {
printf "%b\n" "${GREEN}Bluez is already installed.${RC}" printf "%b\n" "${GREEN}Bluez is already installed.${RC}"
fi fi
# Check if bluetooth service is running startService bluetooth
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
} }
# Function to display the main menu # Function to display the main menu

View File

@ -2,12 +2,7 @@
. ../common-script.sh . ../common-script.sh
# Function to display usage instructions CONFIGURATION_URL="https://github.com/quickemu-project/quickget_configs/releases/download/daily/quickget_data.json"
usage() {
printf "%b\n" "${RED} Usage: $0 ${RC}"
printf "%b\n" "No arguments needed. The script will prompt for ISO path and USB device."
exit 1
}
# Function to display all available block devices # Function to display all available block devices
list_devices() { list_devices() {
@ -17,53 +12,26 @@ list_devices() {
printf "\n" printf "\n"
} }
# Function to fetch the latest Arch Linux ISO # shellcheck disable=SC2086
fetch_arch_latest_iso() { installDependencies() {
ARCH_BASE_URL="https://archive.archlinux.org/iso/" DEPENDENCIES="xz gzip bzip2 jq"
ARCH_LATEST=$(curl -s "$ARCH_BASE_URL" | grep -oP '(?<=href=")[0-9]{4}\.[0-9]{2}\.[0-9]{2}(?=/)' | sort -V | tail -1) if ! command_exists ${DEPENDENCIES}; then
ARCH_URL="${ARCH_BASE_URL}${ARCH_LATEST}/archlinux-${ARCH_LATEST}-x86_64.iso" printf "%b\n" "${YELLOW}Installing dependencies...${RC}"
printf "%b\n" "${GREEN} Selected Arch Linux (latest) ISO URL: ${RC} $ARCH_URL" case "${PACKAGER}" in
} apt-get|nala)
"${ESCALATION_TOOL}" "${PACKAGER}" install -y xz-utils gzip bzip2 jq;;
# Function to fetch older Arch Linux ISOs and display in a table format dnf|zypper)
fetch_arch_older_isos() { "${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES};;
ARCH_BASE_URL="https://archive.archlinux.org/iso/" pacman)
ARCH_VERSIONS=$(curl -s "$ARCH_BASE_URL" | grep -oP '(?<=href=")[0-9]{4}\.[0-9]{2}\.[0-9]{2}(?=/)' | sort -V) "${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES};;
apk)
# Filter versions to include only those from 2017-04-01 and later "${ESCALATION_TOOL}" "${PACKAGER}" add ${DEPENDENCIES};;
MIN_DATE="2017.04.01" *)
ARCH_VERSIONS=$(echo "$ARCH_VERSIONS" | awk -v min_date="$MIN_DATE" '$0 >= min_date') printf "%b\n" "${RED}Unsupported package manager.${RC}"
exit 1
if [ -z "$ARCH_VERSIONS" ]; then ;;
printf "%b\n" "${RED}No Arch Linux versions found from ${MIN_DATE} onwards.${RC}" esac
exit 1
fi fi
printf "%b\n" "${YELLOW}Available Arch Linux versions from ${MIN_DATE} onwards:${RC}"
COUNTER=1
ROW_ITEMS=6 # Number of versions to show per row
for VERSION in $ARCH_VERSIONS; do
printf "%-5s${YELLOW}%-15s ${RC}" "$COUNTER)" "$VERSION"
if [ $(( COUNTER % ROW_ITEMS )) -eq 0 ]; then
printf "\n" # New line after every 6 versions
fi
COUNTER=$((COUNTER + 1))
done
printf "\n" # New line after the last row
printf "%b" "Select an Arch Linux version (1-$((COUNTER - 1))): "
read -r ARCH_OPTION
ARCH_DIR=$(echo "$ARCH_VERSIONS" | sed -n "${ARCH_OPTION}p")
ARCH_URL="${ARCH_BASE_URL}${ARCH_DIR}/archlinux-${ARCH_DIR}-x86_64.iso"
printf "%b\n" "${GREEN}Selected Arch Linux (older) ISO URL: $ARCH_URL${RC}"
}
# Function to fetch the latest Debian Linux ISO
fetch_debian_latest_iso() {
DEBIAN_URL=$(curl -s https://www.debian.org/distrib/netinst | grep -oP '(?<=href=")[^"]+debian-[0-9.]+-amd64-netinst.iso(?=")' | head -1)
printf "%b\n" "${GREEN} Selected Debian Linux (latest) ISO URL: ${RC} $DEBIAN_URL"
} }
# Function to ask whether to use local or online ISO # Function to ask whether to use local or online ISO
@ -77,7 +45,7 @@ choose_iso_source() {
case $ISO_SOURCE_OPTION in case $ISO_SOURCE_OPTION in
1) 1)
fetch_iso_urls # Call the function to fetch online ISO URLs get_online_iso
;; ;;
2) 2)
printf "Enter the path to the already downloaded ISO file: " printf "Enter the path to the already downloaded ISO file: "
@ -94,45 +62,156 @@ choose_iso_source() {
esac esac
} }
# Function to fetch ISO URLs decompress_iso() {
fetch_iso_urls() { printf "%b\n" "${YELLOW}Decompressing ISO file...${RC}"
clear case "${ISO_ARCHIVE_FORMAT}" in
printf "%b\n" "${YELLOW}Available ISOs for download:${RC}" xz)
printf "%b\n" "1) Arch Linux (latest)" xz -d "${ISO_PATH}"
printf "%b\n" "2) Arch Linux (older versions)" ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.xz//')";;
printf "%b\n" "3) Debian Linux (latest)" gz)
printf "\n" gzip -d "${ISO_PATH}"
printf "%b" "Select the ISO you want to download (1-3): " ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.gz//')";;
read -r ISO_OPTION bz2)
bzip2 -d "${ISO_PATH}"
case $ISO_OPTION in ISO_PATH="$(echo "${ISO_PATH}" | sed 's/\.bz2//')";;
1)
fetch_arch_latest_iso
ISO_URL=$ARCH_URL
;;
2)
fetch_arch_older_isos
ISO_URL=$ARCH_URL
;;
3)
fetch_debian_latest_iso
ISO_URL=$DEBIAN_URL
;;
*) *)
printf "%b\n" "${RED}Invalid option selected.${RC}" printf "%b\n" "${RED}Unsupported archive format. Try manually decompressing the ISO and choosing it as a local file instead.${RC}"
exit 1 exit 1
;; ;;
esac esac
ISO_PATH=$(basename "$ISO_URL") printf "%b\n" "${GREEN}ISO file decompressed successfully.${RC}"
printf "%b\n" "${YELLOW}Downloading ISO...${RC}" }
curl -L -o "$ISO_PATH" "$ISO_URL"
if [ $? -ne 0 ]; then check_hash() {
case "${#ISO_CHECKSUM}" in
32) HASH_ALGO="md5sum";;
40) HASH_ALGO="sha1sum";;
64) HASH_ALGO="sha256sum";;
128) HASH_ALGO="sha512sum";;
*) printf "%b\n" "${RED}Invalid checksum length. Skipping checksum verification.${RC}"
return;;
esac
printf "%b\n" "Checking ISO integrity using ${HASH_ALGO}..."
if ! echo "${ISO_CHECKSUM} ${ISO_PATH}" | "${HASH_ALGO}" --check --status; then
printf "%b\n" "${RED}Checksum verification failed.${RC}"
exit 1
else
printf "%b\n" "${GREEN}Checksum verification successful.${RC}"
fi
}
download_iso() {
printf "\n%b\n" "${YELLOW}Found URL: ${ISO_URL}${RC}"
printf "%b\n" "${YELLOW}Downloading ISO to ${ISO_PATH}...${RC}"
if ! curl -L -o "$ISO_PATH" "$ISO_URL"; then
printf "%b\n" "${RED}Failed to download the ISO file.${RC}" printf "%b\n" "${RED}Failed to download the ISO file.${RC}"
exit 1 exit 1
fi fi
} }
get_architecture() {
printf "%b\n" "${YELLOW}Select the architecture of the ISO to flash${RC}"
printf "%b\n" "1) x86_64"
printf "%b\n" "2) AArch64"
printf "%b\n" "3) riscv64"
printf "%b" "Select an option (1-3): "
read -r ARCH
case "${ARCH}" in
1) ARCH="x86_64";;
2) ARCH="aarch64";;
3) ARCH="riscv64";;
*)
printf "%b\n" "${RED}Invalid architecture selected. ${RC}"
exit 1
;;
esac
}
comma_delimited_list() {
echo "${1}" | tr '\n' ',' | sed 's/,/, /g; s/, $//'
}
get_online_iso() {
get_architecture
printf "%b\n" "${YELLOW}Fetching available operating systems...${RC}"
clear
# Download available operating systems, filter to to those that match requirements
# Remove entries with more than 1 ISO or any other medium, they could cause issues
OS_JSON="$(curl -L -s "$CONFIGURATION_URL" | jq -c "[.[] | \
.releases |= map(select( \
(.arch // \"x86_64\") == "\"${ARCH}\"" \
and (.iso | length == 1) and (.iso[0] | has(\"web\")) \
and .img == null and .fixed_iso == null and .floppy == null and .disk_images == null)) \
| select(.releases | length > 0)]")"
if echo "${OS_JSON}" | jq -e 'length == 0' >/dev/null; then
printf "%b\n" "${RED}No operating systems found.${RC}"
exit 1
fi
printf "%b\n" "${YELLOW}Available Operating Systems:${RC}"
comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.[].name')"
printf "\n%b" "Select an operating system: "
read -r OS
OS_JSON="$(echo "${OS_JSON}" | jq --arg os "${OS}" -c '.[] | select(.name == $os)')"
if [ -z "${OS_JSON}" ]; then
printf "%b\n" "${RED}Invalid operating system selected.${RC}"
exit 1
fi
PRETTY_NAME="$(echo "${OS_JSON}" | jq -r '.pretty_name')"
printf "\n%b\n" "${YELLOW}Available releases for ${PRETTY_NAME}:${RC}"
comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.releases[].release' | sort -Vur)"
printf "\n%b" "Select a release: "
read -r RELEASE
printf "\n"
OS_JSON="$(echo "${OS_JSON}" | jq --arg release "${RELEASE}" -c '.releases |= map(select(.release == $release))')"
if echo "${OS_JSON}" | jq -e '.releases | length == 0' >/dev/null; then
printf "%b\n" "${RED}Invalid release selected.${RC}"
exit 1
fi
if echo "${OS_JSON}" | jq -e '.releases[] | select(.edition != null) | any' >/dev/null; then
printf "%b\n" "${YELLOW}Available editions for ${PRETTY_NAME} ${RELEASE}:${RC}"
comma_delimited_list "$(echo "${OS_JSON}" | jq -r '.releases[].edition' | sort -Vur)"
printf "\n%b" "Select an edition: "
read -r EDITION
ENTRY="$(echo "${OS_JSON}" | jq --arg edition "${EDITION}" -c '.releases[] | select(.edition == $edition)')"
else
ENTRY="$(echo "${OS_JSON}" | jq -c '.releases[0]')"
fi
if [ -z "${ENTRY}" ]; then
printf "%b\n" "${RED}Invalid edition selected.${RC}"
exit 1
fi
WEB_DATA="$(echo "${ENTRY}" | jq -c '.iso[0].web')"
ISO_URL="$(echo "${WEB_DATA}" | jq -r '.url')"
ISO_CHECKSUM="$(echo "${WEB_DATA}" | jq -r '.checksum')"
ISO_ARCHIVE_FORMAT="$(echo "${WEB_DATA}" | jq -r '.archive_format')"
ISO_FILENAME="$(echo "${WEB_DATA}" | jq -r '.file_name')"
if [ "${ISO_FILENAME}" = "null" ]; then
ISO_FILENAME="$(basename "${ISO_URL}")"
fi
ISO_PATH="${HOME}/Downloads/${ISO_FILENAME}"
download_iso
if [ "${ISO_CHECKSUM}" != "null" ]; then
check_hash
fi
if [ "${ISO_ARCHIVE_FORMAT}" != "null" ]; then
decompress_iso
fi
}
write_iso(){ write_iso(){
clear clear
@ -191,4 +270,5 @@ write_iso(){
checkEnv checkEnv
checkEscalationTool checkEscalationTool
installDependencies
write_iso write_iso

View File

@ -8,7 +8,7 @@ printf "%b\n" "${YELLOW}Ensuring OpenSSL is installed...${RC}"
if ! command_exists openssl; then if ! command_exists openssl; then
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -Syu --noconfirm openssl "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm --needed openssl
;; ;;
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y openssl "$ESCALATION_TOOL" "$PACKAGER" install -y openssl
@ -19,6 +19,9 @@ if ! command_exists openssl; then
zypper) zypper)
"$ESCALATION_TOOL" "$PACKAGER" install openssl "$ESCALATION_TOOL" "$PACKAGER" install openssl
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add openssl
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -13,7 +13,7 @@ change_orientation() {
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b\n" "${YELLOW} Change Monitor Orientation${RC}" printf "%b\n" "${YELLOW} Change Monitor Orientation${RC}"
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b" "${YELLOW}Choose a monitor to configure: ${RC}" printf "%b\n" "${YELLOW}Choose a monitor to configure: ${RC}"
i=1 i=1
for monitor in $monitor_array; do for monitor in $monitor_array; do
printf "%b\n" "$i. ${GREEN}$monitor${RC}" printf "%b\n" "$i. ${GREEN}$monitor${RC}"

View File

@ -13,7 +13,7 @@ disable_monitor() {
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b\n" "${YELLOW} Disable Monitor${RC}" printf "%b\n" "${YELLOW} Disable Monitor${RC}"
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b" "Choose a monitor to disable: " printf "%b\n" "Choose a monitor to disable: "
i=1 i=1
for monitor in $monitor_array; do for monitor in $monitor_array; do
printf "%b\n" "$i. ${GREEN}$monitor${RC}" printf "%b\n" "$i. ${GREEN}$monitor${RC}"

View File

@ -13,7 +13,7 @@ enable_monitor() {
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b\n" "${YELLOW} Enable Monitor${RC}" printf "%b\n" "${YELLOW} Enable Monitor${RC}"
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b" "${YELLOW}Choose a monitor to enable: ${RC}" printf "%b\n" "${YELLOW}Choose a monitor to enable: ${RC}"
i=1 i=1
for monitor in $monitor_array; do for monitor in $monitor_array; do

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
. ./utility_functions.sh . ../utility_functions.sh
. ../../common-script.sh . ../../common-script.sh

View File

@ -13,10 +13,10 @@ manage_arrangement() {
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b\n" "${YELLOW} Manage Monitor Arrangement${RC}" printf "%b\n" "${YELLOW} Manage Monitor Arrangement${RC}"
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b" "${YELLOW}Choose the monitor to arrange: ${RC}" printf "%b\n" "${YELLOW}Choose the monitor to arrange: ${RC}"
i=1 i=1
for monitor in $monitor_array; do for monitor in $monitor_array; do
printf "%b\n" "$i. ${YELLOW}$monitor${RC}" printf "%b\n" "$i. ${GREEN}$monitor${RC}"
i=$((i + 1)) i=$((i + 1))
done done

12
core/tabs/utils/monitor-control/set_brightness.sh Normal file → Executable file
View File

@ -6,8 +6,6 @@
adjust_monitor_brightness() { adjust_monitor_brightness() {
while true; do while true; do
monitor_list=$(detect_connected_monitors) monitor_list=$(detect_connected_monitors)
monitor_array=$(echo "$monitor_list" | tr '\n' ' ')
set -- "$monitor_array"
count=1 count=1
clear clear
@ -15,7 +13,7 @@ adjust_monitor_brightness() {
printf "%b\n" "${YELLOW} Adjust Monitor Brightness${RC}" printf "%b\n" "${YELLOW} Adjust Monitor Brightness${RC}"
printf "%b\n" "${YELLOW}=========================================${RC}" printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b\n" "${YELLOW}Choose a monitor to adjust brightness:${RC}" printf "%b\n" "${YELLOW}Choose a monitor to adjust brightness:${RC}"
for monitor in "$@"; do echo "$monitor_list" | while IFS= read -r monitor; do
echo "$count. $monitor" echo "$count. $monitor"
count=$((count + 1)) count=$((count + 1))
done done
@ -35,18 +33,18 @@ adjust_monitor_brightness() {
continue continue
fi fi
if [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$#" ]; then monitor_count=$(echo "$monitor_list" | wc -l)
if [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$monitor_count" ]; then
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}" printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
printf "Press [Enter] to continue..." printf "Press [Enter] to continue..."
read -r dummy read -r dummy
continue continue
fi fi
monitor_name=$(eval echo "\${$monitor_choice}") monitor_name=$(echo "$monitor_list" | sed -n "${monitor_choice}p")
current_brightness=$(get_current_brightness "$monitor_name") current_brightness=$(get_current_brightness "$monitor_name")
# Correctly calculate the brightness percentage current_brightness_percentage=$(awk -v brightness="$current_brightness" 'BEGIN {printf "%.0f", brightness * 100}')
current_brightness_percentage=$(awk "BEGIN {printf \"%.0f\", $current_brightness * 100}")
printf "%b\n" "${YELLOW}Current brightness for $monitor_name${RC}: ${GREEN}$current_brightness_percentage%${RC}" printf "%b\n" "${YELLOW}Current brightness for $monitor_name${RC}: ${GREEN}$current_brightness_percentage%${RC}"
while true; do while true; do

View File

@ -16,7 +16,7 @@ set_primary_monitor() {
printf "%b\n" "${YELLOW}Choose a monitor to set as primary:${RC}" printf "%b\n" "${YELLOW}Choose a monitor to set as primary:${RC}"
i=1 i=1
for monitor in $monitor_array; do for monitor in $monitor_array; do
printf "%b\n" "$i. ${YELLOW}$monitor${RC}" printf "%b\n" "$i. ${GREEN}$monitor${RC}"
i=$((i + 1)) i=$((i + 1))
done done

View File

@ -1,15 +1,11 @@
#!/bin/sh -e #!/bin/sh -e
. ../common-script.sh . ../common-script.sh
. ../common-service-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() { create_file() {
printf "%b\n" "Creating script..." printf "%b\n" "Creating script..."
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF' "$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
#!/bin/bash #!/bin/bash
for tty in /dev/tty{1..6} for tty in /dev/tty{1..6}
@ -18,13 +14,12 @@ do
done done
EOF EOF
"$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock "$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock
} }
# Create a systemd service to run the script on boot
create_service() { create_service() {
printf "%b\n" "Creating service..." printf "%b\n" "Creating service..."
"$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF' "$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
[Unit] [Unit]
Description=numlock Description=numlock
@ -39,24 +34,28 @@ EOF
} }
numlockSetup() { numlockSetup() {
# Check if the script and service files exists if [ "$INIT_MANAGER" = "rc-service" ]; then
if [ ! -f "/usr/local/bin/numlock" ]; then printf "%b\n" "${RED}Unsupported init system.${RC}"
create_file exit 1
fi fi
if [ ! -f "/etc/systemd/system/numlock.service" ]; then if [ ! -f "/usr/local/bin/numlock" ]; then
create_service create_file
fi fi
printf "%b" "Do you want to enable Numlock on boot? (y/N): " if [ ! -f "/etc/systemd/system/numlock.service" ]; then
read -r confirm create_service
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then fi
"$ESCALATION_TOOL" systemctl enable numlock.service --quiet
printf "%b\n" "Numlock will be enabled on boot" printf "%b" "Do you want to enable Numlock on boot? (y/N): "
else read -r confirm
"$ESCALATION_TOOL" systemctl disable numlock.service --quiet if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
printf "%b\n" "Numlock will not be enabled on boot" enableService numlock
fi printf "%b\n" "Numlock will be enabled on boot"
else
disableService numlock
printf "%b\n" "Numlock will not be enabled on boot"
fi
} }
checkEnv checkEnv

View File

@ -10,8 +10,8 @@ installollama() {
printf "%b\n" "${GREEN}ollama is already installed.${RC}" printf "%b\n" "${GREEN}ollama is already installed.${RC}"
else else
printf "%b\n" "${YELLOW}Installing ollama...${RC}" printf "%b\n" "${YELLOW}Installing ollama...${RC}"
curl -fsSL https://ollama.com/install.sh | sh curl -fsSL https://ollama.com/install.sh | "$ESCALATION_TOOL" sh
"$ESCALATION_TOOL" systemctl start ollama "$ESCALATION_TOOL" startService ollama
fi fi
} }

View File

@ -19,6 +19,9 @@ installAutoCpufreq() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm git "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm git
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add git
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y git "$ESCALATION_TOOL" "$PACKAGER" install -y git
;; ;;

View 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

View 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

View File

@ -11,6 +11,9 @@ install_package() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE" "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE"
;; ;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add "$PACKAGE"
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE" "$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"
;; ;;
@ -34,23 +37,23 @@ setup_ssh() {
install_package openssh install_package openssh
SSH_SERVICE="sshd" SSH_SERVICE="sshd"
;; ;;
apk)
install_package openssh
SSH_SERVICE="sshd"
;;
*) *)
install_package openssh-server install_package openssh-server
SSH_SERVICE="sshd" SSH_SERVICE="sshd"
;; ;;
esac esac
# Enable and start the appropriate SSH service startAndEnableService "$SSH_SERVICE"
"$ESCALATION_TOOL" systemctl enable "$SSH_SERVICE"
"$ESCALATION_TOOL" systemctl start "$SSH_SERVICE"
# Get the local IP address
LOCAL_IP=$(ip -4 addr show | awk '/inet / {print $2}' | tail -n 1) 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}" printf "%b\n" "${GREEN}Your local IP address is: $LOCAL_IP${RC}"
# Check if SSH is running if isServiceActive "$SSH_SERVICE"; then
if systemctl is-active --quiet "$SSH_SERVICE"; then
printf "%b\n" "${GREEN}SSH is up and running.${RC}" printf "%b\n" "${GREEN}SSH is up and running.${RC}"
else else
printf "%b\n" "${RED}Failed to start SSH.${RC}" printf "%b\n" "${RED}Failed to start SSH.${RC}"
@ -130,12 +133,11 @@ setup_samba() {
EOL EOL
fi fi
# Enable and start Samba services for service in smb nmb; do
"$ESCALATION_TOOL" systemctl enable smb nmb startAndEnableService "$service"
"$ESCALATION_TOOL" systemctl start smb nmb done
# Check if Samba is running if isServiceActive smb && isServiceActive nmb; then
if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then
printf "%b\n" "${GREEN}Samba is up and running.${RC}" printf "%b\n" "${GREEN}Samba is up and running.${RC}"
printf "%b\n" "${YELLOW}Samba share available at: $SHARED_DIR${RC}" printf "%b\n" "${YELLOW}Samba share available at: $SHARED_DIR${RC}"
else else

View File

@ -4,14 +4,15 @@
# Check if ~/.ssh/config exists, if not, create it # Check if ~/.ssh/config exists, if not, create it
if [ ! -f ~/.ssh/config ]; then if [ ! -f ~/.ssh/config ]; then
touch ~/.ssh/config mkdir -p "$HOME/.ssh"
chmod 600 ~/.ssh/config touch "$HOME/.ssh/config"
chmod 600 "$HOME/.ssh/config"
fi fi
# Function to show available hosts from ~/.ssh/config # Function to show available hosts from ~/.ssh/config
show_available_hosts() { show_available_hosts() {
printf "%b\n" "Available Systems:" printf "%b\n" "Available Systems:"
grep -E "^Host " ~/.ssh/config | awk '{print $2}' grep -E "^Host " "$HOME/.ssh/config" | awk '{print $2}'
printf "%b\n" "-------------------" printf "%b\n" "-------------------"
} }

View File

@ -1,8 +1,8 @@
name = "Utilities" name = "Utilities"
multi_selectable = false
[[data]] [[data]]
name = "Monitor Control" name = "Monitor Control"
multi_select = false
[[data.preconditions]] [[data.preconditions]]
matches = true matches = true
@ -76,8 +76,24 @@ name = "Set Resolution"
description = "This script is designed to change the resolution of monitors connected to your system" description = "This script is designed to change the resolution of monitors connected to your system"
script = "monitor-control/set_resolutions.sh" 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]] [[data]]
name = "User Account Manager" name = "User Account Manager"
multi_select = false
[[data.entries]] [[data.entries]]
name = "Add User" name = "Add User"
@ -104,6 +120,7 @@ name = "Auto Mount Drive"
description = "This utility is designed to help with automating the process of mounting a drive on to your system." description = "This utility is designed to help with automating the process of mounting a drive on to your system."
script = "auto-mount.sh" script = "auto-mount.sh"
task_list = "PFM" task_list = "PFM"
multi_select = false
[[data]] [[data]]
name = "Auto Login" name = "Auto Login"
@ -120,6 +137,7 @@ name = "Bluetooth Manager"
description = "This utility is designed to manage bluetooth in your system" description = "This utility is designed to manage bluetooth in your system"
script = "bluetooth-control.sh" script = "bluetooth-control.sh"
task_list = "I SS" task_list = "I SS"
multi_select = false
[[data]] [[data]]
name = "Bootable USB Creator" name = "Bootable USB Creator"
@ -133,7 +151,7 @@ task_list = "I FM"
[[data]] [[data]]
name = "Numlock on Startup" 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" script = "numlock.sh"
task_list = "PFM SS" task_list = "PFM SS"
@ -164,6 +182,11 @@ name = "Timeshift Backup"
script = "timeshift.sh" script = "timeshift.sh"
task_list = "I" task_list = "I"
[[data.preconditions]]
matches = false
data = "command_exists"
values = [ "dnf" ]
[[data]] [[data]]
name = "WiFi Manager" name = "WiFi Manager"
description = "This utility is designed to manage wifi in your system" description = "This utility is designed to manage wifi in your system"

Some files were not shown because too many files have changed in this diff Show More