mirror of
https://github.com/Snigdha-OS/snigdhaos-pkgbuilds.git
synced 2025-09-21 12:04:59 +02:00
man: fix rebase manually
This commit is contained in:
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1,3 +1,3 @@
|
|||||||
# https://help.github.com/articles/about-codeowners/
|
# https://help.github.com/articles/about-codeowners/
|
||||||
|
|
||||||
* @eshanized @iconized
|
* @eshanized @iconized @d3v1l0n
|
@@ -1,14 +1,15 @@
|
|||||||
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
||||||
|
# Contributor: d3v1l0n <d3v1l0n@outlook.in>
|
||||||
|
|
||||||
pkgname=snigdhaos-assistant
|
pkgname=snigdhaos-assistant
|
||||||
pkgver=r251.f2df36f4
|
pkgver=r251.f2df36f4
|
||||||
_pkgver=a1.0.0
|
_pkgver=$(curl -s https://api.github.com/repos/Snigdha-OS/snigdhaos-assistant/releases/latest | jq -r .tag_name)
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="A setup utility for Snigdha OS which helps setting up & installing applications"
|
pkgdesc="A setup utility for Snigdha OS which helps setting up & installing applications"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://gitlab.com/snigdhaos/snigdhaos-assistant/"
|
url="https://gitlab.com/snigdhaos/snigdhaos-assistant/"
|
||||||
license=('MIT')
|
license=('MIT')
|
||||||
depends=('yad' 'wget' 'qt5-base')
|
depends=('yad' 'wget' 'qt5-base' 'curl' 'jq')
|
||||||
optdepends=('pamac')
|
optdepends=('pamac')
|
||||||
makedepends=('git' 'cmake')
|
makedepends=('git' 'cmake')
|
||||||
groups=()
|
groups=()
|
||||||
@@ -16,8 +17,8 @@ source=("https://github.com/Snigdha-OS/${pkgname}/archive/refs/tags/${_pkgver}.t
|
|||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
# cd "$srcdir/$pkgname" || exit
|
# Print package version as 'rX.XXXX'
|
||||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
printf "%s" "${_pkgver#v}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
||||||
|
# Contributor: d3v1l0n <d3v1l0n@outlook.in>
|
||||||
|
|
||||||
pkgname=snigdhaos-libs
|
pkgname=snigdhaos-libs
|
||||||
org=Snigdha-OS
|
org=Snigdha-OS
|
||||||
@@ -10,7 +11,7 @@ license=('MIT')
|
|||||||
depends=(
|
depends=(
|
||||||
'libnotify'
|
'libnotify'
|
||||||
'expect'
|
'expect'
|
||||||
)
|
)
|
||||||
source=(
|
source=(
|
||||||
"exec-termianl"
|
"exec-termianl"
|
||||||
"snigdhaos.shlib"
|
"snigdhaos.shlib"
|
||||||
@@ -18,14 +19,15 @@ source=(
|
|||||||
"install-package"
|
"install-package"
|
||||||
"org.snigdhaos.libs.pkexec.policy"
|
"org.snigdhaos.libs.pkexec.policy"
|
||||||
"pkexec-gui"
|
"pkexec-gui"
|
||||||
)
|
)
|
||||||
sha256sums=(
|
sha256sums=(
|
||||||
'SKIP'
|
'SKIP'
|
||||||
'SKIP'
|
'SKIP'
|
||||||
'SKIP'
|
'SKIP'
|
||||||
'SKIP'
|
'SKIP'
|
||||||
'SKIP'
|
'SKIP'
|
||||||
)
|
)
|
||||||
|
|
||||||
pkgver(){
|
pkgver(){
|
||||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if grep -qE 'subvol=@/.snapshots/[0-9]+/snapshot' /proc/cmdline; then
|
if [[ -f /proc/cmdline ]]; then
|
||||||
exit 0
|
if grep -qE 'subvol=@/.snapshots/[0-9]+/snapshot' /proc/cmdline; then
|
||||||
|
echo "Booting from a Btrfs snapshot."
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Not booting from a Btrfs snapshot."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "/proc/cmdline not found."
|
||||||
|
exit 2
|
||||||
fi
|
fi
|
||||||
exit 1
|
|
||||||
|
@@ -7,9 +7,9 @@
|
|||||||
<vendor_url>https://snigdhaos.org</vendor_url>
|
<vendor_url>https://snigdhaos.org</vendor_url>
|
||||||
|
|
||||||
<action id="org.snigdhaos.libs.install-package.pkexec.policy.run">
|
<action id="org.snigdhaos.libs.install-package.pkexec.policy.run">
|
||||||
<description>Install software with pacman</description>
|
<description>Install software using the pacman package manager</description>
|
||||||
<message>Authentication is required to install software.</message>
|
<message>Authentication is required to install software with pacman.</message>
|
||||||
<icon_name>snigdha-os</icon_name>
|
<icon_name>snigdhaos-pacman</icon_name>
|
||||||
<defaults>
|
<defaults>
|
||||||
<allow_any>no</allow_any>
|
<allow_any>no</allow_any>
|
||||||
<allow_inactive>no</allow_inactive>
|
<allow_inactive>no</allow_inactive>
|
||||||
@@ -18,9 +18,11 @@
|
|||||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/snigdhaos/install-package</annotate>
|
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/snigdhaos/install-package</annotate>
|
||||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action id="org.garuda.libs.pkexec-gui.pkexec.policy.run">
|
<action id="org.garuda.libs.pkexec-gui.pkexec.policy.run">
|
||||||
<description>Run GUI program as root</description>
|
<description>Run a graphical program as root</description>
|
||||||
<message>Authentication is required to run a GUI program as root.</message>
|
<message>Authentication is required to run a graphical program with elevated privileges.</message>
|
||||||
|
<icon_name>gnome-session</icon_name>
|
||||||
<defaults>
|
<defaults>
|
||||||
<allow_any>no</allow_any>
|
<allow_any>no</allow_any>
|
||||||
<allow_inactive>no</allow_inactive>
|
<allow_inactive>no</allow_inactive>
|
||||||
|
@@ -7,21 +7,25 @@ if ! command -v pkexec &>/dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if running as root
|
# Check if running as root
|
||||||
if [ $EUID -ne 0 ]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
# Attempt to execute the script as root via pkexec
|
||||||
exec pkexec /usr/lib/snigdhaos/pkexec-gui "$@"
|
exec pkexec /usr/lib/snigdhaos/pkexec-gui "$@"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Need some previous vars
|
# Shellcheck disable: Read environment variables from parent process
|
||||||
# shellcheck disable=SC2163
|
# shellcheck disable=SC2163
|
||||||
while IFS= read -rd '' var; do export "$var"; done < <(grep --null-data -ae "^\($XDG_CURRENT_DESKTOP\|WAYLAND_DISPLAY\|XDG_RUNTIME_DIR\|XDG_SESSION_TYPE\|XCURSOR_SIZE\|LC_*\|LANG\|LANGUAGE\|QT_WAYLAND_FORCE_DPI\|QT_QPA_PLATFORMTHEME\|QT_STYLE-OVERRIDE\|\)=.*\$" /proc/$PPID/environ)
|
# Read the necessary environment variables from the parent process
|
||||||
|
while IFS= read -rd '' var; do
|
||||||
|
export "$var"
|
||||||
|
done < <(grep --null-data -ae "^\($XDG_CURRENT_DESKTOP\|WAYLAND_DISPLAY\|XDG_RUNTIME_DIR\|XDG_SESSION_TYPE\|XCURSOR_SIZE\|LC_*\|LANG\|LANGUAGE\|QT_WAYLAND_FORCE_DPI\|QT_QPA_PLATFORMTHEME\|QT_STYLE-OVERRIDE\|\)=.*\$" /proc/$PPID/environ)
|
||||||
|
|
||||||
# If on Wayland, adjust WAYLAND_DISPLAY variable
|
# Adjust WAYLAND_DISPLAY if running on Wayland
|
||||||
if [[ -v WAYLAND_DISPLAY ]]; then
|
if [[ -n "$WAYLAND_DISPLAY" ]]; then
|
||||||
export WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
|
export WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set root's runtime directory
|
# Set the root user's XDG_RUNTIME_DIR
|
||||||
export XDG_RUNTIME_DIR="/run/user/0"
|
export XDG_RUNTIME_DIR="/run/user/0"
|
||||||
|
|
||||||
# Execute the provided command with root privileges
|
# Execute the provided command with root privileges
|
||||||
|
@@ -2,14 +2,29 @@
|
|||||||
|
|
||||||
snigdhaoslib_add_update_notice() {
|
snigdhaoslib_add_update_notice() {
|
||||||
# Ensure the directory exists
|
# Ensure the directory exists
|
||||||
mkdir -p /var/lib/snigdhaos/tmp
|
if ! mkdir -p /var/lib/snigdhaos/tmp; then
|
||||||
|
echo "Error: Failed to create directory /var/lib/snigdhaos/tmp" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Get the current date
|
# Get the current date
|
||||||
current_date=$(date +%F)
|
current_date=$(date +%F)
|
||||||
|
|
||||||
# Replace multiple spaces with a single space in the input string
|
# Ensure the input message is not empty
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Error: No update message provided." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Replace multiple spaces with a single space
|
||||||
message="${1//[[:space:]]+/ }"
|
message="${1//[[:space:]]+/ }"
|
||||||
|
|
||||||
# Append the message to the file with the current date
|
# Append the message to the file with the current date
|
||||||
echo "$current_date $message" >> /var/lib/snigdhaos/tmp/update_notices
|
if ! printf "%s %s\n" "$current_date" "$message" >> /var/lib/snigdhaos/tmp/update_notices; then
|
||||||
|
echo "Error: Failed to write to /var/lib/snigdhaos/tmp/update_notices" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Optionally, display a success message (for debugging/logging purposes)
|
||||||
|
echo "Update notice successfully added for $current_date."
|
||||||
}
|
}
|
||||||
|
37
snigdhaos-lsb-release/PKGBUILD
Normal file
37
snigdhaos-lsb-release/PKGBUILD
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Maintainer : RiO <d3v1l0n@outlook.in>
|
||||||
|
|
||||||
|
pkgname=snigdhaos-lsb-release
|
||||||
|
pkgver=2.0.r55.a25a4fc
|
||||||
|
_commit=a25a4fcd73c79bd5af0dd8d948a7c96dcbfd2d07
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='LSB version query program for Snigdha OS'
|
||||||
|
arch=('any')
|
||||||
|
url='https://refspecs.linuxfoundation.org/lsb.shtml'
|
||||||
|
license=('GPL-2.0-or-later')
|
||||||
|
depends=('sh')
|
||||||
|
makedepends=('git')
|
||||||
|
source=("git+https://github.com/LinuxStandardBase/lsb-samples.git#commit=${_commit}"
|
||||||
|
'lsb-release'
|
||||||
|
'lsb_release_make_man_page_reproducible.patch')
|
||||||
|
sha256sums=('SKIP'
|
||||||
|
'SKIP'
|
||||||
|
'SKIP')
|
||||||
|
|
||||||
|
pkgver() {
|
||||||
|
cd lsb-samples/lsb_release/src
|
||||||
|
printf '%s.r%s.%s' "$(grep -Po 'SCRIPTVERSION="\K[^"]*' lsb_release)" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
patch -d lsb-samples/lsb_release/src -Np1 -i "${srcdir}/lsb_release_make_man_page_reproducible.patch"
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
make -C lsb-samples/lsb_release/src
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
install -D -m755 lsb-samples/lsb_release/src/lsb_release -t "${pkgdir}/usr/bin"
|
||||||
|
install -D -m644 lsb-samples/lsb_release/src/lsb_release.1.gz -t "${pkgdir}/usr/share/man/man1"
|
||||||
|
install -D -m644 lsb-release -t "${pkgdir}/etc"
|
||||||
|
}
|
3
snigdhaos-lsb-release/lsb-release
Normal file
3
snigdhaos-lsb-release/lsb-release
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
DISTRIB_ID="Arch"
|
||||||
|
DISTRIB_RELEASE="rolling"
|
||||||
|
DISTRIB_DESCRIPTION="Snigdha OS"
|
@@ -0,0 +1,34 @@
|
|||||||
|
From 1f5eb29ad59e7302e0407855333fbf1377f6f127 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jonas Witschel <diabonas@archlinux.org>
|
||||||
|
Date: Sat, 11 Jul 2020 17:02:59 +0200
|
||||||
|
Subject: [PATCH] Make man page reproducible
|
||||||
|
|
||||||
|
Respect SOURCE_DATE_EPOCH and remove the embedded timestamp from the gzipped
|
||||||
|
man page.
|
||||||
|
---
|
||||||
|
Makefile | 2 +-
|
||||||
|
help2man | 2 +-
|
||||||
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -22,7 +22,7 @@ man: lsb_release.1.gz
|
||||||
|
|
||||||
|
lsb_release.1.gz: lsb_release
|
||||||
|
@./help2man -N --include ./lsb_release.examples --alt_version_key=program_version ./lsb_release >lsb_release.1
|
||||||
|
- @gzip -9f lsb_release.1
|
||||||
|
+ @gzip -9f -n lsb_release.1
|
||||||
|
|
||||||
|
install: all
|
||||||
|
install -D -m 644 lsb_release.1.gz ${mandir}/man1/lsb_release.1.gz
|
||||||
|
--- a/help2man
|
||||||
|
+++ b/help2man
|
||||||
|
@@ -173,7 +173,7 @@ my ($help_text, $version_text) = map {
|
||||||
|
or die "$this_program: can't get `--$_' info from $ARGV[0]\n"
|
||||||
|
} qw(help), $opt_version_key;
|
||||||
|
|
||||||
|
-my $date = strftime "%B %Y", localtime;
|
||||||
|
+my $date = strftime "%B %Y", gmtime($ENV{SOURCE_DATE_EPOCH} || time);
|
||||||
|
(my $program = $ARGV[0]) =~ s!.*/!!;
|
||||||
|
my $package = $program;
|
||||||
|
my $version;
|
@@ -1,33 +1,25 @@
|
|||||||
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
||||||
|
# Contributor: d3v1l0n <d3v1l0n@outlook.in>
|
||||||
|
|
||||||
pkgname=snigdhaos-powershell
|
pkgname=snigdhaos-powershell
|
||||||
org="Snigdha-OS"
|
org="Snigdha-OS"
|
||||||
branch="master"
|
branch="master"
|
||||||
pkgver=r75.ba4f5f5
|
pkgver=r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Snigdha OS PowerShell Config!"
|
pkgdesc="Snigdha OS PowerShell Config"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
license=('MIT')
|
license=('MIT')
|
||||||
depends=(
|
depends=('powershell-bin')
|
||||||
'powershell-bin'
|
|
||||||
)
|
|
||||||
source=(
|
source=(
|
||||||
"$pkgname.tar.xz"
|
"$pkgname.tar.xz"
|
||||||
"${pkgname}.desktop"
|
"${pkgname}.desktop"
|
||||||
)
|
)
|
||||||
sha256sums=(
|
sha256sums=('SKIP' 'SKIP')
|
||||||
'SKIP'
|
|
||||||
)
|
|
||||||
install=$pkgname.install
|
install=$pkgname.install
|
||||||
|
|
||||||
pkgver(){
|
package() {
|
||||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
mkdir -p "${pkgdir}/etc/skel/.config"
|
||||||
}
|
cp -r "${srcdir}/etc/skel/.config"/* "${pkgdir}/etc/skel/.config/"
|
||||||
|
|
||||||
package(){
|
install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
|
||||||
mkdir -p "${pkgdir}/etc/skel"
|
|
||||||
cp -rf "${srcdir}/etc/skel/.config" "${pkgdir}/etc/skel/"
|
|
||||||
|
|
||||||
# rm "${pkgdir}/usr/share/applications/snigdhaos-powershell.desktop"
|
|
||||||
# install -Dm644 "${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,15 @@
|
|||||||
$Host.UI.RawUI.WindowTitle = "SNIGDHA OS > PowerShell🔥"
|
$Host.UI.RawUI.WindowTitle = "SNIGDHA OS > PowerShell🔥"
|
||||||
function prompt()
|
|
||||||
{
|
function prompt {
|
||||||
$ESC=$([char]27)
|
$ESC = [char]27
|
||||||
"$ESC[0;36m┌──I'm $(whoami)➜ $ESC[0;31m$($executionContext.SessionState.Path.CurrentLocation)$("`r`n$ESC[0;36m└──eshanized PowerShell🔥>$ESC[00m" * ($nestedPromptLevel + 1)) ";
|
$user = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
|
||||||
|
$currentLocation = $executionContext.SessionState.Path.CurrentLocation
|
||||||
|
$gitBranch = ""
|
||||||
|
if (Test-Path .git -or (Get-Command git -ErrorAction SilentlyContinue)) {
|
||||||
|
$gitBranch = $(git rev-parse --abbrev-ref HEAD 2>$null)
|
||||||
|
if ($gitBranch) {
|
||||||
|
$gitBranch = " ($gitBranch)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"$ESC[0;36m┌── $user $gitBranch ➜ $ESC[0;31m$currentLocation$($([char]13))`n$ESC[0;36m└── 🌟 SnigdhaOS PowerShell 🔥 > $ESC[00m"
|
||||||
}
|
}
|
||||||
|
10
snigdhaos-powershell/snigdhaos-powershell.desktop
Normal file
10
snigdhaos-powershell/snigdhaos-powershell.desktop
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
|
Name=Snigdha OS PowerShell
|
||||||
|
Comment=PowerShell Configuration for Snigdha OS
|
||||||
|
Exec=pwsh -NoExit -Command "& {if (Test-Path '$HOME/.config/powershell/Microsoft.PowerShell_profile.ps1') { . '$HOME/.config/powershell/Microsoft.PowerShell_profile.ps1' } }"
|
||||||
|
Icon=/usr/share/pixmaps/snigdhaos-powershell.png
|
||||||
|
Terminal=true
|
||||||
|
Type=Application
|
||||||
|
Categories=Utility;System;Development;
|
||||||
|
StartupNotify=true
|
@@ -1,160 +1,130 @@
|
|||||||
post_install(){
|
#!/bin/bash
|
||||||
tput setaf 3;
|
|
||||||
echo
|
# Function to display a warning message
|
||||||
echo "[WARNING] WARNING!"
|
warn() {
|
||||||
echo
|
tput setaf 3
|
||||||
echo "If you are on Grub, please install the following package..."
|
echo "[WARNING] $1"
|
||||||
echo "sudo pacman -S snigdhaos-bootloader-grub"
|
tput sgr0
|
||||||
echo
|
}
|
||||||
echo "If you are using systemd-boot then isntall the following package..."
|
|
||||||
echo "sudo pacman -S snigdhaos-bootloader-systemd"
|
# Function to display an informational message
|
||||||
echo
|
info() {
|
||||||
echo "[WARNING] WARNING!"
|
tput setaf 2
|
||||||
echo
|
echo "$1"
|
||||||
tput setaf 2;
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to display a success message
|
||||||
|
success() {
|
||||||
|
tput setaf 6
|
||||||
|
echo "$1"
|
||||||
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to display an error message
|
||||||
|
error() {
|
||||||
|
tput setaf 1
|
||||||
|
echo "[ERROR] $1"
|
||||||
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to check if a package is installed
|
||||||
|
package_installed() {
|
||||||
|
if pacman -Qi "$1" &> /dev/null; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle package installation confirmation
|
||||||
|
confirm_package_installed() {
|
||||||
|
local package=$1
|
||||||
|
if package_installed "$package"; then
|
||||||
|
success "$package found!"
|
||||||
|
info "Bootloader is safe!"
|
||||||
|
else
|
||||||
|
error "$package not found!"
|
||||||
|
warn "Install the package for your safety!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle post-install tasks
|
||||||
|
post_install() {
|
||||||
|
warn "If you are on Grub, please install the following package..."
|
||||||
|
info "sudo pacman -S snigdhaos-bootloader-grub"
|
||||||
|
warn "If you are using systemd-boot then install the following package..."
|
||||||
|
info "sudo pacman -S snigdhaos-bootloader-systemd"
|
||||||
|
|
||||||
bootloader=$(bootctl status | grep "Product" | awk '{print $2}')
|
bootloader=$(bootctl status | grep "Product" | awk '{print $2}')
|
||||||
|
|
||||||
if [ "$bootloader" = "systemd-boot" ]; then
|
if [ "$bootloader" = "systemd-boot" ]; then
|
||||||
echo
|
info "systemd-bootloader found!"
|
||||||
echo "systemd-bootloader found!"
|
info "Install the following package for your safety!"
|
||||||
echo "Install the following package for your safety!"
|
info "sudo pacman -S snigdhaos-bootloader-systemd"
|
||||||
echo
|
info "It has all the pacman-hooks which are essentials."
|
||||||
echo "sudo pacman -S snigdhaos-bootloader-systemd"
|
elif [ "$bootloader" = "GRUB" ]; then
|
||||||
echo "It has all the pacman-hooks which are essentials."
|
info "GRUB bootloader found!"
|
||||||
echo
|
info "Install the following package for your safety!"
|
||||||
elif [ $bootloader = "GRUB" ]; then
|
info "sudo pacman -S snigdhaos-bootloader-grub"
|
||||||
echo
|
info "It has all the pacman-hooks which are essentials."
|
||||||
echo "GRUB bootloader found!"
|
|
||||||
echo "Install the following package for your safety!"
|
|
||||||
echo
|
|
||||||
echo "sudo pacman -S snigdhaos-bootloader-grub"
|
|
||||||
echo "It has all the pacman-hooks which are essentials."
|
|
||||||
echo
|
|
||||||
fi
|
fi
|
||||||
tput sgr0
|
|
||||||
|
|
||||||
# Confirmation for package installation
|
confirm_package_installed "snigdhaos-bootloader-grub"
|
||||||
package_installed(){
|
confirm_package_installed "snigdhaos-bootloader-systemd"
|
||||||
if pacman -Qi "$1" &> /dev/null; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
tput setaf 6;
|
if ! package_installed "snigdhaos-bootloader-systemd" && ! package_installed "snigdhaos-bootloader-grub"; then
|
||||||
if package_installed snigdhaos-bootloader-grub; then
|
error "snigdhaos-bootloader-systemd or snigdhaos-bootloader-grub not found!"
|
||||||
echo
|
warn "Install the package for systemd or grub!"
|
||||||
echo "snigdhaos-bootloader-grub found!"
|
|
||||||
echo "Bootloader is safe!"
|
|
||||||
echo
|
|
||||||
fi
|
fi
|
||||||
tput sgr0
|
|
||||||
|
|
||||||
tput setaf 6;
|
|
||||||
if package_installed snigdhaos-bootloader-systemd; then
|
|
||||||
echo
|
|
||||||
echo "snigdhaos-bootloader-systemd found!"
|
|
||||||
echo "Bootloader is safe!"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
tput sgr0
|
|
||||||
|
|
||||||
tput setaf 1;
|
|
||||||
if ! package_installed snigdhaos-bootloader-systemd && ! package_installed snigdhaos-bootloader-grub; then
|
|
||||||
echo
|
|
||||||
echo "snigdhaos-bootloader-systemd or snigdhaos-bootloader-grub not found!"
|
|
||||||
echo "[WARNING] WARNING!"
|
|
||||||
echo "Install the package for systemd or grub!"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
tput sgr0
|
|
||||||
|
|
||||||
if systemctl --all --type service | grep -q "virtual-machine-check"; then
|
if systemctl --all --type service | grep -q "virtual-machine-check"; then
|
||||||
systemctl disable virtual-machine-check.service
|
systemctl disable virtual-machine-check.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sh /usr/local/bin/snigdhaos-lsb-release
|
sh /usr/local/bin/snigdhaos-lsb-release
|
||||||
sh /usr/local/bin/snigdhaos-os-release
|
sh /usr/local/bin/snigdhaos-os-release
|
||||||
}
|
}
|
||||||
|
|
||||||
post_upgrade(){
|
# Function to handle post-upgrade tasks
|
||||||
tput setaf 3;
|
post_upgrade() {
|
||||||
echo
|
warn "If you are on Grub, please install the following package..."
|
||||||
echo "[WARNING] WARNING!"
|
info "sudo pacman -S snigdhaos-bootloader-grub"
|
||||||
echo
|
warn "If you are using systemd-boot then install the following package..."
|
||||||
echo "If you are on Grub, please install the following package..."
|
info "sudo pacman -S snigdhaos-bootloader-systemd"
|
||||||
echo "sudo pacman -S snigdhaos-bootloader-grub"
|
|
||||||
echo
|
|
||||||
echo "If you are using systemd-boot then isntall the following package..."
|
|
||||||
echo "sudo pacman -S snigdhaos-bootloader-systemd"
|
|
||||||
echo
|
|
||||||
echo "[WARNING] WARNING!"
|
|
||||||
echo
|
|
||||||
tput setaf 2;
|
|
||||||
bootloader=$(bootctl status | grep "Product" | awk '{print $2}')
|
bootloader=$(bootctl status | grep "Product" | awk '{print $2}')
|
||||||
|
|
||||||
if [ "$bootloader" = "systemd-boot" ]; then
|
if [ "$bootloader" = "systemd-boot" ]; then
|
||||||
echo
|
info "systemd-bootloader found!"
|
||||||
echo "systemd-bootloader found!"
|
info "Install the following package for your safety!"
|
||||||
echo "Install the following package for your safety!"
|
info "sudo pacman -S snigdhaos-bootloader-systemd"
|
||||||
echo
|
info "It has all the pacman-hooks which are essentials."
|
||||||
echo "sudo pacman -S snigdhaos-bootloader-systemd"
|
elif [ "$bootloader" = "GRUB" ]; then
|
||||||
echo "It has all the pacman-hooks which are essentials."
|
info "GRUB bootloader found!"
|
||||||
echo
|
info "Install the following package for your safety!"
|
||||||
elif [ $bootloader = "GRUB" ]; then
|
info "sudo pacman -S snigdhaos-bootloader-grub"
|
||||||
echo
|
info "It has all the pacman-hooks which are essentials."
|
||||||
echo "GRUB bootloader found!"
|
|
||||||
echo "Install the following package for your safety!"
|
|
||||||
echo
|
|
||||||
echo "sudo pacman -S snigdhaos-bootloader-grub"
|
|
||||||
echo "It has all the pacman-hooks which are essentials."
|
|
||||||
echo
|
|
||||||
fi
|
fi
|
||||||
tput sgr0
|
|
||||||
|
|
||||||
# Confirmation for package installation
|
confirm_package_installed "snigdhaos-bootloader-grub"
|
||||||
package_installed(){
|
confirm_package_installed "snigdhaos-bootloader-systemd"
|
||||||
if pacman -Qi "$1" &> /dev/null; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
tput setaf 6;
|
if ! package_installed "snigdhaos-bootloader-systemd" && ! package_installed "snigdhaos-bootloader-grub"; then
|
||||||
if package_installed snigdhaos-bootloader-grub; then
|
error "snigdhaos-bootloader-systemd or snigdhaos-bootloader-grub not found!"
|
||||||
echo
|
warn "Install the package for systemd or grub!"
|
||||||
echo "snigdhaos-bootloader-grub found!"
|
|
||||||
echo "Bootloader is safe!"
|
|
||||||
echo
|
|
||||||
fi
|
fi
|
||||||
tput sgr0
|
|
||||||
|
|
||||||
tput setaf 6;
|
|
||||||
if package_installed snigdhaos-bootloader-systemd; then
|
|
||||||
echo
|
|
||||||
echo "snigdhaos-bootloader-systemd found!"
|
|
||||||
echo "Bootloader is safe!"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
tput sgr0
|
|
||||||
|
|
||||||
tput setaf 1;
|
|
||||||
if ! package_installed snigdhaos-bootloader-systemd && ! package_installed snigdhaos-bootloader-grub; then
|
|
||||||
echo
|
|
||||||
echo "snigdhaos-bootloader-systemd or snigdhaos-bootloader-grub not found!"
|
|
||||||
echo "[WARNING] WARNING!"
|
|
||||||
echo "Install the package for systemd or grub!"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
tput sgr0
|
|
||||||
|
|
||||||
if systemctl --all --type service | grep -q "virtual-machine-check"; then
|
if systemctl --all --type service | grep -q "virtual-machine-check"; then
|
||||||
systemctl disable virtual-machine-check.service
|
systemctl disable virtual-machine-check.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sh /usr/local/bin/snigdhaos-lsb-release
|
sh /usr/local/bin/snigdhaos-lsb-release
|
||||||
sh /usr/local/bin/snigdhaos-os-release
|
sh /usr/local/bin/snigdhaos-os-release
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_remove(){
|
# Function to handle pre-remove tasks
|
||||||
|
pre_remove() {
|
||||||
if systemctl --all --type service | grep -q "virtual-machine-check"; then
|
if systemctl --all --type service | grep -q "virtual-machine-check"; then
|
||||||
systemctl disable virtual-machine-check.service
|
systemctl disable virtual-machine-check.service
|
||||||
fi
|
fi
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
||||||
|
# Contributor: [Contributor Name] <[Contributor Email]>
|
||||||
|
|
||||||
pkgname=snigdhaos-system-installation
|
pkgname=snigdhaos-system-installation
|
||||||
org=Snigdha-OS
|
org=Snigdha-OS
|
||||||
@@ -22,8 +23,8 @@ sha256sums=('SKIP')
|
|||||||
install="${pkgname}.install"
|
install="${pkgname}.install"
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
# cd "$srcdir/$pkgname"
|
# cd "$srcdir/$pkgname"
|
||||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
@@ -38,4 +39,4 @@ package() {
|
|||||||
|
|
||||||
install -dm755 "$pkgdir$_destname3"
|
install -dm755 "$pkgdir$_destname3"
|
||||||
cp -r "$srcdir/$pkgname/$_destname3/"* "$pkgdir/$_destname3"
|
cp -r "$srcdir/$pkgname/$_destname3/"* "$pkgdir/$_destname3"
|
||||||
}
|
}
|
||||||
|
@@ -1,14 +1,71 @@
|
|||||||
|
# Function to display a warning message
|
||||||
|
warn() {
|
||||||
|
tput setaf 3
|
||||||
|
echo "[WARNING] $1"
|
||||||
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to display an informational message
|
||||||
|
info() {
|
||||||
|
tput setaf 2
|
||||||
|
echo "$1"
|
||||||
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to display a success message
|
||||||
|
success() {
|
||||||
|
tput setaf 6
|
||||||
|
echo "$1"
|
||||||
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to display an error message
|
||||||
|
error() {
|
||||||
|
tput setaf 1
|
||||||
|
echo "[ERROR] $1"
|
||||||
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle enabling/disabling a service
|
||||||
|
manage_service() {
|
||||||
|
local service=$1
|
||||||
|
local action=$2
|
||||||
|
|
||||||
|
if systemctl $action $service; then
|
||||||
|
success "Service $service ${action}d successfully."
|
||||||
|
else
|
||||||
|
error "Failed to ${action} service $service."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle starting/stopping a service
|
||||||
|
manage_service_start() {
|
||||||
|
local service=$1
|
||||||
|
local action=$2
|
||||||
|
|
||||||
|
if systemctl $action $service; then
|
||||||
|
success "Service $service ${action}ed successfully."
|
||||||
|
else
|
||||||
|
error "Failed to ${action} service $service."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle post-install tasks
|
||||||
post_install() {
|
post_install() {
|
||||||
systemctl enable snigdhaos-graphical-target.service
|
info "Enabling and starting snigdhaos-graphical-target.service..."
|
||||||
systemctl start snigdhaos-graphical-target.service
|
manage_service "snigdhaos-graphical-target.service" "enable"
|
||||||
|
manage_service_start "snigdhaos-graphical-target.service" "start"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to handle post-upgrade tasks
|
||||||
post_upgrade() {
|
post_upgrade() {
|
||||||
systemctl enable snigdhaos-graphical-target.service
|
info "Enabling and starting snigdhaos-graphical-target.service..."
|
||||||
systemctl start snigdhaos-graphical-target.service
|
manage_service "snigdhaos-graphical-target.service" "enable"
|
||||||
|
manage_service_start "snigdhaos-graphical-target.service" "start"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to handle pre-remove tasks
|
||||||
pre_remove() {
|
pre_remove() {
|
||||||
systemctl disable snigdhaos-graphical-target.service
|
info "Disabling snigdhaos-graphical-target.service..."
|
||||||
|
manage_service "snigdhaos-graphical-target.service" "disable"
|
||||||
}
|
}
|
@@ -1,7 +1,28 @@
|
|||||||
post_install() {
|
# Function to display a success message
|
||||||
echo -e "\n** The files have been installed in /usr/share/tabliss/tabliss.json **\n"
|
success() {
|
||||||
|
tput setaf 6
|
||||||
|
echo "$1"
|
||||||
|
tput sgr0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to display an informational message
|
||||||
|
info() {
|
||||||
|
tput setaf 2
|
||||||
|
echo "$1"
|
||||||
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle post-install tasks
|
||||||
|
post_install() {
|
||||||
|
info "The files have been installed in /usr/share/tabliss/tabliss.json"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle post-upgrade tasks
|
||||||
post_upgrade() {
|
post_upgrade() {
|
||||||
post_install
|
post_install
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle pre-remove tasks
|
||||||
|
pre_remove() {
|
||||||
|
info "Preparing to remove the files from /usr/share/tabliss/tabliss.json"
|
||||||
}
|
}
|
146
snigdhaos-utils/snigdhaos-fastest-mirror.sh
Executable file
146
snigdhaos-utils/snigdhaos-fastest-mirror.sh
Executable file
@@ -0,0 +1,146 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Define color codes
|
||||||
|
RESET='\033[0m'
|
||||||
|
BOLD='\033[1m'
|
||||||
|
RED='\033[31m'
|
||||||
|
GREEN='\033[32m'
|
||||||
|
YELLOW='\033[33m'
|
||||||
|
BLUE='\033[34m'
|
||||||
|
|
||||||
|
# Define the mirror list files
|
||||||
|
ARCH_MIRROR_LIST="/etc/pacman.d/mirrorlist"
|
||||||
|
BLACKARCH_MIRROR_LIST="/etc/pacman.d/blackarch-mirrorlist"
|
||||||
|
CHAOTIC_AUR_MIRROR_LIST="/etc/pacman.d/chaotic-mirrorlist"
|
||||||
|
|
||||||
|
# Define a backup directory for safety
|
||||||
|
BACKUP_DIR="/tmp/backup_mirrorlists_$(date +%Y%m%d_%H%M%S)"
|
||||||
|
|
||||||
|
# Error handling function
|
||||||
|
error_exit() {
|
||||||
|
echo -e "${RED}ERROR: $1${RESET}" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create backup directory safely
|
||||||
|
mkdir -p "$BACKUP_DIR" || error_exit "Failed to create backup directory"
|
||||||
|
|
||||||
|
# Function to check if rankmirrors is installed
|
||||||
|
check_rankmirrors_installed() {
|
||||||
|
if ! command -v rankmirrors &> /dev/null; then
|
||||||
|
echo -e "${RED}rankmirrors is not installed.${RESET}"
|
||||||
|
read -p "Would you like to install rankmirrors now? (y/n): " choice
|
||||||
|
if [[ "$choice" =~ ^[yY]$ ]]; then
|
||||||
|
echo -e "${BLUE}Installing rankmirrors...${RESET}"
|
||||||
|
sudo pacman -S --noconfirm pacman-contrib || error_exit "Failed to install rankmirrors"
|
||||||
|
echo -e "${GREEN}rankmirrors installed successfully!${RESET}"
|
||||||
|
else
|
||||||
|
error_exit "rankmirrors is required to proceed."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to auto-detect the country based on the system's timezone
|
||||||
|
get_country_from_timezone() {
|
||||||
|
local timezone
|
||||||
|
# Try multiple methods to get timezone
|
||||||
|
timezone=$(timedatectl show --property=Timezone --value 2>/dev/null) ||
|
||||||
|
timezone=$(cat /etc/timezone 2>/dev/null) ||
|
||||||
|
timezone=$(readlink -f /etc/localtime 2>/dev/null)
|
||||||
|
|
||||||
|
# Extract country from timezone
|
||||||
|
local country
|
||||||
|
country=$(echo "$timezone" | sed -E 's:.*/([^/]+):\1:' | cut -d'_' -f1)
|
||||||
|
|
||||||
|
# Fallback to default if country can't be determined
|
||||||
|
if [[ -z "$country" || "$country" == "Etc" || "$country" == "GMT" ]]; then
|
||||||
|
country="United States"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$country"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main script execution
|
||||||
|
main() {
|
||||||
|
# Get the country based on the system's timezone
|
||||||
|
local country
|
||||||
|
country=$(get_country_from_timezone)
|
||||||
|
echo -e "${BLUE}Detected country based on timezone: ${GREEN}$country${RESET}"
|
||||||
|
|
||||||
|
# Check for root/sudo permissions
|
||||||
|
if [[ $EUID -eq 0 ]]; then
|
||||||
|
error_exit "Do not run this script as root. Use sudo if needed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if rankmirrors is installed
|
||||||
|
check_rankmirrors_installed
|
||||||
|
|
||||||
|
# Backup current mirror lists
|
||||||
|
echo -e "${BLUE}Backing up current mirror lists...${RESET}"
|
||||||
|
for list in "$ARCH_MIRROR_LIST" "$BLACKARCH_MIRROR_LIST" "$CHAOTIC_AUR_MIRROR_LIST"; do
|
||||||
|
if [[ -f "$list" ]]; then
|
||||||
|
cp "$list" "$BACKUP_DIR/$(basename "$list").bak" || error_exit "Failed to backup $list"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Ensure backup was successful
|
||||||
|
[[ "$(ls -A "$BACKUP_DIR")" ]] || error_exit "No mirror lists were backed up"
|
||||||
|
|
||||||
|
# Update system packages
|
||||||
|
echo -e "${YELLOW}Updating system packages...${RESET}"
|
||||||
|
sudo pacman -Sy || error_exit "Failed to update package databases"
|
||||||
|
|
||||||
|
# Prepare temporary directory for new mirror lists
|
||||||
|
temp_dir=$(mktemp -d) || error_exit "Failed to create temporary directory"
|
||||||
|
trap 'rm -rf "$temp_dir"' EXIT
|
||||||
|
|
||||||
|
# Use rankmirrors to generate new mirror lists
|
||||||
|
echo -e "${GREEN}Selecting fastest mirrors using rankmirrors...${RESET}"
|
||||||
|
|
||||||
|
# Rank and save Arch Linux mirror list
|
||||||
|
sudo rankmirrors -n 6 /etc/pacman.d/mirrorlist | tee "$temp_dir/mirrorlist" ||
|
||||||
|
error_exit "Failed to generate Arch mirror list"
|
||||||
|
|
||||||
|
# Rank and save BlackArch mirror list
|
||||||
|
sudo rankmirrors -n 6 /etc/pacman.d/blackarch-mirrorlist | tee "$temp_dir/blackarch-mirrorlist" ||
|
||||||
|
error_exit "Failed to generate BlackArch mirror list"
|
||||||
|
|
||||||
|
# Rank and save Chaotic-AUR mirror list
|
||||||
|
sudo rankmirrors -n 6 /etc/pacman.d/chaotic-mirrorlist | tee "$temp_dir/chaotic-mirrorlist" ||
|
||||||
|
error_exit "Failed to generate Chaotic-AUR mirror list"
|
||||||
|
|
||||||
|
# Check if the files exist before copying
|
||||||
|
if [[ -f "$temp_dir/mirrorlist" ]]; then
|
||||||
|
sudo cp "$temp_dir/mirrorlist" "$ARCH_MIRROR_LIST" || error_exit "Failed to copy Arch mirror list"
|
||||||
|
else
|
||||||
|
error_exit "Arch mirror list not found in $temp_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f "$temp_dir/blackarch-mirrorlist" ]]; then
|
||||||
|
sudo cp "$temp_dir/blackarch-mirrorlist" "$BLACKARCH_MIRROR_LIST" || error_exit "Failed to copy BlackArch mirror list"
|
||||||
|
else
|
||||||
|
error_exit "BlackArch mirror list not found in $temp_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f "$temp_dir/chaotic-mirrorlist" ]]; then
|
||||||
|
sudo cp "$temp_dir/chaotic-mirrorlist" "$CHAOTIC_AUR_MIRROR_LIST" || error_exit "Failed to copy Chaotic-AUR mirror list"
|
||||||
|
else
|
||||||
|
error_exit "Chaotic-AUR mirror list not found in $temp_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Success messages
|
||||||
|
echo -e "${GREEN}Mirror lists have been updated successfully!${RESET}"
|
||||||
|
echo -e "${BLUE}Your system's mirror lists have been optimized.${RESET}"
|
||||||
|
|
||||||
|
# Optional system update
|
||||||
|
read -p "Would you like to perform a full system update now? (y/n): " choice
|
||||||
|
if [[ "$choice" =~ ^[yY]$ ]]; then
|
||||||
|
sudo pacman -Syu
|
||||||
|
echo -e "${GREEN}System update completed!${RESET}"
|
||||||
|
else
|
||||||
|
echo -e "${YELLOW}Mirror update complete. You can run 'sudo pacman -Syu' later.${RESET}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Run the main function
|
||||||
|
main
|
74
snigdhaos-utils/snigdhaos-reset.sh
Executable file
74
snigdhaos-utils/snigdhaos-reset.sh
Executable file
@@ -0,0 +1,74 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# ✨ Script Developed by: D3V1L0N ✨
|
||||||
|
# 🌟 Version: 1.0 🌟
|
||||||
|
|
||||||
|
echo "────────────────────────────────────────────────────────────────────"
|
||||||
|
echo "🎉 Hard Reset Script for Snigdha OS 🎉"
|
||||||
|
echo "👨💻 Developed by: D3V1L0N"
|
||||||
|
echo "────────────────────────────────────────────────────────────────────"
|
||||||
|
|
||||||
|
read -p "⚠️ WARNING: This script will reset the system by removing non-essential packages and overwriting configurations. Do you want to continue? (y/n): " confirm
|
||||||
|
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
|
||||||
|
echo "🚨 Operation aborted by user. Exiting... 🚨"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
essential_packages=(
|
||||||
|
base
|
||||||
|
base-devel
|
||||||
|
linux
|
||||||
|
linux-firmware
|
||||||
|
systemd
|
||||||
|
grub
|
||||||
|
mkinitcpio
|
||||||
|
udev
|
||||||
|
vi
|
||||||
|
coreutils
|
||||||
|
bash
|
||||||
|
)
|
||||||
|
|
||||||
|
is_essential() {
|
||||||
|
for pkg in "${essential_packages[@]}"; do
|
||||||
|
if [[ "$1" == "$pkg" ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "🌐 Updating package database..."
|
||||||
|
pacman -Sy --noconfirm
|
||||||
|
|
||||||
|
installed_packages=$(pacman -Qq)
|
||||||
|
|
||||||
|
echo "🧹 Cleaning up: Removing non-essential packages..."
|
||||||
|
for pkg in $installed_packages; do
|
||||||
|
if ! is_essential "$pkg"; then
|
||||||
|
echo "🗑️ Removing package: $pkg"
|
||||||
|
pacman -Rns --noconfirm "$pkg"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "⚙️ Resetting configuration files..."
|
||||||
|
echo "⚠️ WARNING: Resetting /etc will overwrite existing configurations! Backup any important configs before proceeding."
|
||||||
|
read -p "Are you sure you want to continue with the hard reset and overwrite /etc configuration files? (y/n): " confirm
|
||||||
|
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
|
||||||
|
echo "🚨 Operation aborted by user. Exiting... 🚨"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf /etc/*
|
||||||
|
cp -r /etc/skel/* /etc/
|
||||||
|
|
||||||
|
echo "🔄 Reinstalling essential packages..."
|
||||||
|
for pkg in "${essential_packages[@]}"; do
|
||||||
|
pacman -S --noconfirm --needed "$pkg"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "🔧 Rebuilding initramfs..."
|
||||||
|
mkinitcpio -P
|
||||||
|
|
||||||
|
echo "🎉 Hard reset complete! Essential packages reinstalled, system cleaned, and ready to go. 🚀"
|
||||||
|
|
||||||
|
echo "🔄 It's recommended to reboot your system now for changes to take effect."
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
|
||||||
|
# Contributor: RiO <d3v1l0n@outlook.in>
|
||||||
|
|
||||||
pkgname=snigdhaos-welcome
|
pkgname=snigdhaos-welcome
|
||||||
_pkgname=snigdhaos-welcome
|
_pkgname=snigdhaos-welcome
|
||||||
@@ -24,19 +24,29 @@ provides=("${pkgname}")
|
|||||||
conflicts=('snigdhaos-welcome-dev')
|
conflicts=('snigdhaos-welcome-dev')
|
||||||
install=$pkgname.install
|
install=$pkgname.install
|
||||||
options=(!strip !emptydirs)
|
options=(!strip !emptydirs)
|
||||||
source=(${_pkgname}::"git+${url}")
|
source=("${pkgname}::git+${url}")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
cd "$srcdir/$pkgname"
|
cd "$srcdir/$pkgname"
|
||||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
# Retrieve the version based on Git commits
|
||||||
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
install -dm755 ${pkgdir}${_licensedir}${_pkgname}
|
# Create directories for the license and app data
|
||||||
install -m644 ${srcdir}/${_pkgname}/LICENSE ${pkgdir}${_licensedir}${_pkgname}
|
install -dm755 ${pkgdir}${_licensedir}${_pkgname}
|
||||||
mkdir -p "${pkgdir}${_destname1}"
|
install -m644 ${srcdir}/${_pkgname}/LICENSE ${pkgdir}${_licensedir}${_pkgname}
|
||||||
cp -r "${srcdir}/${_pkgname}/${_destname1}/"* "${pkgdir}${_destname1}"
|
|
||||||
mkdir -p "${pkgdir}${_destname2}"
|
# Install configuration files to the user's default skeleton directory
|
||||||
cp -r "${srcdir}/${_pkgname}/${_destname2}/"* "${pkgdir}${_destname2}"
|
mkdir -p "${pkgdir}${_destname1}"
|
||||||
}
|
cp -r "${srcdir}/${_pkgname}/${_destname1}/"* "${pkgdir}${_destname1}"
|
||||||
|
|
||||||
|
# Install the main application files to /usr
|
||||||
|
mkdir -p "${pkgdir}${_destname2}"
|
||||||
|
cp -r "${srcdir}/${_pkgname}/${_destname2}/"* "${pkgdir}${_destname2}"
|
||||||
|
|
||||||
|
# Optionally clean up any unnecessary files (e.g., .git, build files, etc.)
|
||||||
|
# This ensures the final package only contains the necessary files
|
||||||
|
find "$pkgdir" -type f -name "*.git*" -exec rm -f {} \;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user