refactor(rmv): clean dir

This commit is contained in:
Eshan Roy (Eshanized)
2024-05-12 17:23:04 +00:00
parent 0e80f5f673
commit 5bcde31f3b
32999 changed files with 0 additions and 3101016 deletions

View File

@@ -1,42 +0,0 @@
# Maintainer: Eshan Roy <eshan@snigdhaos.org>
pkgname=snigdhaos-libs
org=Snigdha-OS
pkgdesc="Libs for Snigdha OS"
pkgver=1
pkgrel=1
arch=('any')
license=('MIT')
depends=(
'libnotify'
'expect'
)
source=(
"exec-termianl"
"snigdhaos.shlib"
"check-snpashot-boot"
"install-package"
"org.snigdhaos.libs.pkexec.policy"
"pkexec-gui"
)
sha256sums=(
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
pkgver(){
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
install -Dm755 exec-terminal "$pkgdir"/usr/lib/snigdhaos/exec-terminal
install -Dm755 install-package "$pkgdir"/usr/lib/snigdhaos/install-package
install -Dm755 check-snpashot-boot "$pkgdir"/usr/lib/snigdhaos/check-snpashot-boot
install -Dm755 pkexec-gui "$pkgdir"/usr/lib/snigdhaos/pkexec-gui
install -Dm644 snigdhaos.shlib "$pkgdir"/usr/lib/snigdhaos/snigdhaos.shlib
install -d "$pkgdir"/var/lib/snigdhaos/tmp
install -Dm0644 org.snigdhaos.libs.pkexec.policy "$pkgdir/usr/share/polkit-1/actions/org.snigdhaos.libs.pkexec.policy"
}

View File

@@ -1,6 +0,0 @@
#!/bin/bash
if grep -qE 'subvol=@/.snapshots/[0-9]+/snapshot' /proc/cmdline; then
exit 0
fi
exit 1

View File

@@ -1,99 +0,0 @@
#!/bin/bash
set -e
LAUNCH_TERMINAL_SHELL=bash
usage(){
echo "Usage: ${0##*/} [cmd]"
echo ' -s [shell] Change shell to [shell]'
echo ' -h This help'
exit 1
}
opts='s:h'
while getopts "${opts}" arg; do
case "${arg}" in
s) LAUNCH_TERMINAL_SHELL="$OPTARGS" ;;
h | ?) usage 0 ;;
*)
echo "Invalid arguments '${arg}'"
usage 1 ;;
esac
done
shift $((OPTIND - 1))
initfile="$(mktemp)"
codefile="$initfile"
echo "#!/usr/bin/env bash" >"$initfile"
if [ "$LAUNCH_TERMINAL_SHELL" != "bash" ]; then
codefile="$(mktemp)"
echo "$LAUNCH_TERMINAL_SHELL $codefile" >>"$initfile"
fi
echo "$1" >>"$codefile"
chmod +x "$initfile"
cmd="\"$initfile\""
terminal=""
declare -A terminals=(["alacritty"]="alacritty -e $cmd || LIBGL_ALWAYS_SOFTWARE=1 alacritty -e $cmd" ["konsole"]="konsole -e $cmd" ["kgx"]="kgx -e $cmd" ["gnome-terminal"]="gnome-terminal --wait -- $cmd" ["xfce4-terminal"]="xfce4-terminal --disable-server --command '$cmd'" ["qterminal"]="qterminal -e $cmd" ["lxterminal"]="lxterminal -e $cmd" ["mate-terminal"]="mate-terminal --disable-factory -e $cmd" ["xterm"]="xterm -e $cmd" ["foot"]="foot -T exec-terminal -e $cmd")
declare -a term_order=("alacritty" "knosole" "kgx" "gnome-terminal" "mate-terminal" "xfce4-terminal" "qterminal" "lxterminal" "xterm" "foot")
case "$XDG_CURRENT_DESKTOP" in
KDE)
terminal="konsole"
;;
GNOME)
if command -v "kgx" &>/dev/null; then
terminal=kgx
else
terminal=gnome-terminal
fi
;;
XFCE)
terminal=xfce4-terminal
;;
LXQt)
terminal=qterminal
;;
MATE)
terminal=mate-terminal
;;
esac
if [ -z "$terminal" ] || ! command -v "$terminal" &>/dev/null; then
# shellcheck disable=SC2068
for i in ${term_order[@]}; do
if command -v "$i" &>/dev/null; then
terminal="$i"
break
fi
done
fi
if [ -z "$terminal" ]; then
notify-send -t 1500 --app-name=Snigdha\ OS "No Terminal Found!"
exit 1
fi
if [ "$terminal" == "kgx" ]; then
# shellcheck disable=SC2086
sed -i '2i sleep 0.1' $initfile
# shellcheck disable=SC2016
# shellcheck disable=SC2086
echo 'Kill -SIGNINT $PPID' >>$initfile
fi
eval "${terminals[${terminal}]}" || {
exitcode=$?
}
rm "$initfile"
if [ "$codefile" != "$initfile" ]; then
rm "$codefile"
fi
if [ ! -z "$exitcode" ] && [ "$exitcode" != 130 ]; then
exit 2
fi

View File

@@ -1,15 +0,0 @@
#!/bin/bash
set -e
SNIGDHAOSLIB_GUI="${SNIGDHAOSLIB_GUI:-true}"
if [ -z "$DISPLAY" ]; then
SNIGDHAOSLIB_GUI=false
fi
if [[ $EUID -ne 0 ]] && [ "$SNIGDHAOSLIB_GUI" == "true" ]; then
exec pkexec /usr/lib/snigdhaos/install-package "$@"
exit 1
fi
sudo pacman -S --noconfirm "$@"

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD polkit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
<policyconfig>
<vendor>Snigdha OS</vendor>
<vendor_url>https://snigdhaos.org</vendor_url>
<action id="org.snigdhaos.libs.install-package.pkexec.policy.run">
<description>Install software with pacman</description>
<message>Authentication is required to install software.</message>
<icon_name>snigdha-os</icon_name>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/snigdhaos/install-package</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
<action id="org.garuda.libs.pkexec-gui.pkexec.policy.run">
<description>Run GUI program as root</description>
<message>Authentication is required to run a GUI program as root.</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/snigdhaos/pkexec-gui</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@@ -1,15 +0,0 @@
#!/bin/bash
if [ $EUID -ne 0 ]; then
exec pkexec /usr/lib/snigdhaos/pkexec-gui "$@"
exit 1
fi
# Need some previous vars
# 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)
if [[ -v WAYLAND_DISPLAY ]]; then
export WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
fi
export XDG_RUNTIME_DIR="/run/user/0"
exec "$@"

View File

@@ -1,5 +0,0 @@
#!/bin/bash
snigdhaoslib_add_update_notice(){
mkdir -p /var/lib/snigdhaos/tmp
echo "$(date +%F) ${1// / }" >>/var/lib/snigdhaos/tmp/update_notices
}