wip
This commit is contained in:
parent
bd710e4a35
commit
33873365d6
2 changed files with 45 additions and 123 deletions
62
hyprland.sh
62
hyprland.sh
|
@ -76,35 +76,39 @@ askThings() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo_note "What bar do you want to install? (available: [w]aybar, [h]yprpanel, [g]Bar)"
|
if ! command_exists waybar && ! command_exists hyprpanel && ! command_exists gBar; then
|
||||||
read -r askBar </dev/tty
|
echo_note "What bar do you want to install? (available: [w]aybar, [h]yprpanel, [g]Bar)"
|
||||||
case "$askBar" in
|
read -r askBar </dev/tty
|
||||||
[Ww] | waybar)
|
case "$askBar" in
|
||||||
bar="waybar"
|
[Ww] | waybar)
|
||||||
;;
|
bar="waybar"
|
||||||
[Hh] | hyprpanel)
|
;;
|
||||||
bar="hyprpanel"
|
[Hh] | hyprpanel)
|
||||||
;;
|
bar="hyprpanel"
|
||||||
[Gg] | gBar | gbar)
|
;;
|
||||||
bar="gBar"
|
[Gg] | gBar | gbar)
|
||||||
;;
|
bar="gBar"
|
||||||
esac
|
;;
|
||||||
echo_info "Set bar to $bar"
|
esac
|
||||||
|
echo_info "Set bar to $bar"
|
||||||
|
fi
|
||||||
|
|
||||||
echo_note "Do you want to install [r]ofi or [t]ofi?: "
|
if ! command_exists rofi && ! command_exists tofi; then
|
||||||
read -r askRofi </dev/tty
|
echo_note "Do you want to install [r]ofi or [t]ofi?: "
|
||||||
case "$askRofi" in
|
read -r askRofi </dev/tty
|
||||||
[tT] | tofi)
|
case "$askRofi" in
|
||||||
menu="tofi"
|
[tT] | tofi)
|
||||||
;;
|
menu="tofi"
|
||||||
[rR] | rofi)
|
;;
|
||||||
menu="rofi"
|
[rR] | rofi)
|
||||||
;;
|
menu="rofi"
|
||||||
*)
|
;;
|
||||||
menu="rofi"
|
*)
|
||||||
;;
|
menu="rofi"
|
||||||
esac
|
;;
|
||||||
echo_info "Set menu to $menu"
|
esac
|
||||||
|
echo_info "Set menu to $menu"
|
||||||
|
fi
|
||||||
|
|
||||||
echo_note "Doy you want to install sddm with minimal dependency theme? [catppucchin-mocha] (Y/n) :"
|
echo_note "Doy you want to install sddm with minimal dependency theme? [catppucchin-mocha] (Y/n) :"
|
||||||
read -r askSddm </dev/tty
|
read -r askSddm </dev/tty
|
||||||
|
@ -618,7 +622,7 @@ checkConfig() {
|
||||||
main() {
|
main() {
|
||||||
if check_root; then
|
if check_root; then
|
||||||
askThings
|
askThings
|
||||||
if [ "$askHyprland" = "true" ]; then
|
if $askHyprland; then
|
||||||
checkDependencies
|
checkDependencies
|
||||||
instDeps
|
instDeps
|
||||||
instTools
|
instTools
|
||||||
|
|
106
yazi.sh
106
yazi.sh
|
@ -1,50 +1,17 @@
|
||||||
{
|
{
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# ─< ANSI color codes >───────────────────────────────────────────────────────────────────
|
|
||||||
RED='\033[0;31m'
|
|
||||||
CYAN='\033[0;36m'
|
|
||||||
YELLOW='\033[0;33m'
|
|
||||||
LIGHT_GREEN='\033[0;92m'
|
|
||||||
BOLD='\033[1m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
echo_error() {
|
|
||||||
printf "${BOLD}${RED}ERROR: ${NC}${RED}%s${NC}\n" "$1" >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
echo_info() {
|
|
||||||
printf "${BOLD}${CYAN}INFO: ${NC}${CYAN}%s${NC}\n" "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
echo_warning() {
|
|
||||||
printf "${BOLD}${YELLOW}WARNING: ${NC}${YELLOW}%s${NC}\n" "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
echo_note() {
|
|
||||||
printf "${BOLD}${LIGHT_GREEN}NOTE: ${NC}${LIGHT_GREEN}%s${NC}\n" "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# ─< Check if the given command exists silently >─────────────────────────────────────────
|
# ─< Check if the given command exists silently >─────────────────────────────────────────
|
||||||
command_exists() {
|
command_exists() {
|
||||||
command -v "$@" >/dev/null 2>&1
|
command -v "$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# ─< Check if the user is root and set sudo variable if necessary >───────────────────────
|
if command_exists curl; then
|
||||||
check_root() {
|
eval <"$(curl -fsSL https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh)"
|
||||||
if [ "$(id -u)" -ne 0 ]; then
|
else
|
||||||
if command_exists sudo; then
|
echo "curl is required, but missing.."
|
||||||
echo_info "User is not root. Using sudo for privileged operations."
|
exit 1
|
||||||
_sudo="sudo"
|
fi
|
||||||
else
|
|
||||||
echo_error "No sudo found and you're not root! Can't install packages."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo_info "Root access confirmed."
|
|
||||||
_sudo=""
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
evalCargo() {
|
evalCargo() {
|
||||||
if [ -e "$HOME/.cargo/env" ]; then
|
if [ -e "$HOME/.cargo/env" ]; then
|
||||||
|
@ -53,7 +20,7 @@
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
i_cargo() {
|
i_yazi() {
|
||||||
# if ! command_exists make || ! command_exists gcc; then
|
# if ! command_exists make || ! command_exists gcc; then
|
||||||
# echo_error "The script might run into issues, because of make and gcc not being installed. Please install it, and run the script again, if it fails!"
|
# echo_error "The script might run into issues, because of make and gcc not being installed. Please install it, and run the script again, if it fails!"
|
||||||
# fi
|
# fi
|
||||||
|
@ -67,7 +34,6 @@
|
||||||
evalCargo
|
evalCargo
|
||||||
|
|
||||||
rustup update
|
rustup update
|
||||||
evalCargo
|
|
||||||
|
|
||||||
echo_info "Installing yazi through cargo"
|
echo_info "Installing yazi through cargo"
|
||||||
else
|
else
|
||||||
|
@ -79,16 +45,6 @@
|
||||||
c_yazi
|
c_yazi
|
||||||
}
|
}
|
||||||
|
|
||||||
i_arch() {
|
|
||||||
$_sudo pacman -S yazi --noconfirm
|
|
||||||
c_yazi
|
|
||||||
}
|
|
||||||
|
|
||||||
i_opensuse() {
|
|
||||||
$_sudo zypper install yazi
|
|
||||||
c_yazi
|
|
||||||
}
|
|
||||||
|
|
||||||
c_yazi() {
|
c_yazi() {
|
||||||
if [ -e "$HOME/.config/yazi/package.toml" ]; then
|
if [ -e "$HOME/.config/yazi/package.toml" ]; then
|
||||||
if command_exists ya; then
|
if command_exists ya; then
|
||||||
|
@ -99,49 +55,11 @@
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ─< Distribution detection and installation >────────────────────────────────────────
|
|
||||||
get_packager() {
|
|
||||||
if [ -e /etc/os-release ]; then
|
|
||||||
echo_info "Detecting distribution..."
|
|
||||||
. /etc/os-release
|
|
||||||
|
|
||||||
# ─< Convert $ID and $ID_LIKE to lowercase >──────────────────────────────────────────────
|
|
||||||
ID=$(printf "%s" "$ID" | tr '[:upper:]' '[:lower:]')
|
|
||||||
ID_LIKE=$(printf "%s" "$ID_LIKE" | tr '[:upper:]' '[:lower:]')
|
|
||||||
|
|
||||||
case "$ID" in
|
|
||||||
ubuntu | pop) i_cargo ;;
|
|
||||||
debian) i_cargo ;;
|
|
||||||
fedora) i_cargo ;;
|
|
||||||
alpine) i_cargo ;;
|
|
||||||
arch | manjaro | garuda | endeavour) i_arch ;;
|
|
||||||
opensuse*) i_opensuse ;;
|
|
||||||
*)
|
|
||||||
if [ "${ID_LIKE#*debian}" != "$ID_LIKE" ]; then
|
|
||||||
i_cargo
|
|
||||||
elif [ "${ID_LIKE#*ubuntu}" != "$ID_LIKE" ]; then
|
|
||||||
i_cargo
|
|
||||||
elif [ "${ID_LIKE#*arch}" != "$ID_LIKE" ]; then
|
|
||||||
i_arch
|
|
||||||
elif [ "${ID_LIKE#*fedora}" != "$ID_LIKE" ]; then
|
|
||||||
i_cargo
|
|
||||||
elif [ "${ID_LIKE#*suse}" != "$ID_LIKE" ]; then
|
|
||||||
i_opensuse
|
|
||||||
else
|
|
||||||
echo_error "Unsupported distribution: $ID"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo_error "Unable to detect distribution. /etc/os-release not found."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if check_root; then
|
if $arch || $opensuse; then
|
||||||
get_packager
|
_install yazi
|
||||||
|
else
|
||||||
|
i_yazi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue