Fix check root

This commit is contained in:
Jesús 2020-07-19 13:04:00 -05:00
parent d3b45cf587
commit 36b4fd3142
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -2,7 +2,10 @@
URL="https://libregit.org/heckyel/i3-config.git" URL="https://libregit.org/heckyel/i3-config.git"
function _check_root() { while true
do
function _copy_i3_config() {
# check root
if [[ "$UID" == 0 ]]; then if [[ "$UID" == 0 ]]; then
root_key='' root_key=''
elif [[ $(command -v sudo) ]]; then elif [[ $(command -v sudo) ]]; then
@ -10,28 +13,22 @@ function _check_root() {
elif [[ $(command -v doas) ]]; then elif [[ $(command -v doas) ]]; then
root_key=doas root_key=doas
fi fi
return $root_key
}
while true
do
function _copy_i3_config() {
## Install dependencies ## Install dependencies
if [[ $(command -v pacman) ]]; then if [[ $(command -v pacman) ]]; then
_check_root pacman -Syy $root_key pacman -Syy
# i3 base # i3 base
_check_root pacman -S i3-wm i3status dmenu sysstat $root_key pacman -S i3-wm i3status dmenu sysstat
# i3 blocks and dependecies # i3 blocks and dependecies
_check_root pacman -S i3blocks i3lock rofi termite \ $root_key pacman -S i3blocks i3lock rofi termite \
conky playerctl acpi scrot xfce4-terminal \ conky playerctl acpi scrot xfce4-terminal \
thunar tumbler feh ranger \ thunar tumbler feh ranger \
ttf-hack ttf-bitstream-vera ttf-hack ttf-bitstream-vera
elif [[ $(command -v apt-get) ]]; then elif [[ $(command -v apt-get) ]]; then
_check_root apt update $root_key apt update
# i3 base # i3 base
_check_root apt install i3-wm i3status suckless-tools sysstat $root_key apt install i3-wm i3status suckless-tools sysstat
# i3 blocks and dependecies # i3 blocks and dependecies
_check_root apt install i3blocks i3lock rofi termite \ $root_key apt install i3blocks i3lock rofi termite \
conky playerctl acpi network-manager-gnome scrot \ conky playerctl acpi network-manager-gnome scrot \
xfce4-terminal thunar tumbler feh ranger \ xfce4-terminal thunar tumbler feh ranger \
fonts-hack-ttf ttf-bitstream-vera fonts-hack-ttf ttf-bitstream-vera