diff options
author | Jesús <heckyel@hyperbola.info> | 2020-07-19 13:04:00 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-07-19 13:04:00 -0500 |
commit | 36b4fd3142255b847290bbf231ee95475026c6a1 (patch) | |
tree | 0eff43ce1ab4bcc9f75cf219777a3a22e632bbcb /install.sh | |
parent | d3b45cf5877e6ea8e6f7e3e6e1c5593cc566a249 (diff) | |
download | i3-config-36b4fd3142255b847290bbf231ee95475026c6a1.tar.lz i3-config-36b4fd3142255b847290bbf231ee95475026c6a1.tar.xz i3-config-36b4fd3142255b847290bbf231ee95475026c6a1.zip |
Fix check root
Diffstat (limited to 'install.sh')
-rw-r--r-- | install.sh | 43 |
1 files changed, 20 insertions, 23 deletions
@@ -2,39 +2,36 @@ URL="https://libregit.org/heckyel/i3-config.git" -function _check_root() { - if [[ "$UID" == 0 ]]; then - root_key='' - elif [[ $(command -v sudo) ]]; then - root_key=sudo - elif [[ $(command -v doas) ]]; then - root_key=doas - fi - return $root_key -} - while true do function _copy_i3_config() { + # check root + if [[ "$UID" == 0 ]]; then + root_key='' + elif [[ $(command -v sudo) ]]; then + root_key=sudo + elif [[ $(command -v doas) ]]; then + root_key=doas + fi ## Install dependencies if [[ $(command -v pacman) ]]; then - _check_root pacman -Syy + $root_key pacman -Syy # i3 base - _check_root pacman -S i3-wm i3status dmenu sysstat + $root_key pacman -S i3-wm i3status dmenu sysstat # i3 blocks and dependecies - _check_root pacman -S i3blocks i3lock rofi termite \ - conky playerctl acpi scrot xfce4-terminal \ - thunar tumbler feh ranger \ - ttf-hack ttf-bitstream-vera + $root_key pacman -S i3blocks i3lock rofi termite \ + conky playerctl acpi scrot xfce4-terminal \ + thunar tumbler feh ranger \ + ttf-hack ttf-bitstream-vera elif [[ $(command -v apt-get) ]]; then - _check_root apt update + $root_key apt update # 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 - _check_root apt install i3blocks i3lock rofi termite \ - conky playerctl acpi network-manager-gnome scrot \ - xfce4-terminal thunar tumbler feh ranger \ - fonts-hack-ttf ttf-bitstream-vera + $root_key apt install i3blocks i3lock rofi termite \ + conky playerctl acpi network-manager-gnome scrot \ + xfce4-terminal thunar tumbler feh ranger \ + fonts-hack-ttf ttf-bitstream-vera fi # Install i3config |