diff --git a/larbs.sh b/larbs.sh index cadf939..3511276 100644 --- a/larbs.sh +++ b/larbs.sh @@ -14,6 +14,8 @@ while getopts ":a:r:b:p:h" o; do case "${o}" in *) printf "Invalid option: -%s\\n" "$OPTARG" && exit ;; esac done +[ -z "$dotfilesrepo" ] && dotfilesrepo="https://github.com/lukesmithxyz/voidrice.git" +[ -z "$progsfile" ] && progsfile="https://raw.githubusercontent.com/LukeSmithxyz/LARBS/master/progs.csv" [ -z "$aurhelper" ] && aurhelper="yay" [ -z "$repobranch" ] && repobranch="master" @@ -21,10 +23,13 @@ esac done if type xbps-install >/dev/null 2>&1; then installpkg(){ xbps-install -y "$1" >/dev/null 2>&1 ;} + grepseq="\"^[PGV]*,\"" elif type apt >/dev/null 2>&1; then installpkg(){ apt-get install -y "$1" >/dev/null 2>&1 ;} + grepseq="\"^[PGU]*,\"" else installpkg(){ pacman --noconfirm --needed -S "$1" >/dev/null 2>&1 ;} + grepseq="\"^[PGA]*,\"" fi error() { clear; printf "ERROR:\\n%s\\n" "$1"; exit;} @@ -34,19 +39,8 @@ welcomemsg() { \ } selectdotfiles() { \ - edition="$(dialog --title "Select LARBS version." --menu "Select which version of LARBS you wish to install:" 12 70 2 dwm "The current version of LARBS using suckless's dwm." i3 "The legacy version of LARBS using i3." both "Install both versions for good measure!" custom "If you are supplying commandline options for LARBS." 3>&1 1>&2 2>&3 3>&1)" || error "User exited." - case "$edition" in - dwm) dotfilesrepo="https://github.com/lukesmithxyz/voidrice.git" ; repobranch="master" ; progsfile="https://raw.githubusercontent.com/LukeSmithxyz/LARBS/master/progs.csv" ;; - i3) dotfilesrepo="https://github.com/lukesmithxyz/voidrice.git" ; repobranch="master" ; progsfile="https://raw.githubusercontent.com/LukeSmithxyz/LARBS/master/legacy.csv" ;; - both) dotfilesrepo="https://github.com/lukesmithxyz/voidrice.git" ; repobranch="master" ; progsfile="https://raw.githubusercontent.com/LukeSmithxyz/LARBS/master/legacy.csv\\nhttps://raw.githubusercontent.com/LukeSmithxyz/LARBS/master/progs.csv" ;; - esac ;} - -selectdefault() { \ - edition="$(dialog --nocancel --title "Which should be default?" --menu "Excellent! Which version do you want to start off as the default? This can be changed at any time afterwards." 11 50 2 dwm "dwm" i3 "i3" 3>&1 1>&2 2>&3 3>&1)" - case "$edition" in - dwm) edition="dwm" ;; - i3) edition="i3" ;; - esac ;} + edition="$(dialog --title "Select LARBS version." --menu "Select which version of LARBS you wish to have as default:" 10 70 2 i3 "The classic version of LARBS using i3." dwm "The version of LARBS using suckless's dwm." custom "If you are supplying commandline options for LARBS." 3>&1 1>&2 2>&3 3>&1)" || error "User exited." + } getuserandpass() { \ # Prompts user for new username an password. @@ -126,17 +120,17 @@ pipinstall() { \ } installationloop() { \ - ([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || ( rm -f /tmp/progs.csv; { echo "$progsfile" | xargs -I {} curl -Ls {} ;} | sed '/^#/d' | sort -uR | shuf >> /tmp/progs.csv) + ([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || curl -Ls "$progsfile" | sed '/^#/d' | eval grep "$grepseq" > /tmp/progs.csv total=$(wc -l < /tmp/progs.csv) aurinstalled=$(pacman -Qm | awk '{print $1}') while IFS=, read -r tag program comment; do n=$((n+1)) echo "$comment" | grep "^\".*\"$" >/dev/null 2>&1 && comment="$(echo "$comment" | sed "s/\(^\"\|\"$\)//g")" case "$tag" in - "") maininstall "$program" "$comment" ;; "A") aurinstall "$program" "$comment" ;; "G") gitmakeinstall "$program" "$comment" ;; "P") pipinstall "$program" "$comment" ;; + *) maininstall "$program" "$comment" ;; esac done < /tmp/progs.csv ;} @@ -170,7 +164,6 @@ installpkg dialog || error "Are you sure you're running this as the root user a # Welcome user and pick dotfiles. welcomemsg || error "User exited." selectdotfiles || error "User exited." -[ "$edition" = "both" ] && selectdefault # Get and verify username and password. getuserandpass || error "User exited." diff --git a/progs.csv b/progs.csv index 0654873..ea0056f 100644 --- a/progs.csv +++ b/progs.csv @@ -1,18 +1,27 @@ #TAG,NAME IN REPO (or git url),PURPOSE (should be a verb phrase to sound right while installing) +,i3-gaps,"is the main graphical user interface and window manager." ,xorg-server,"is the graphical server." ,xorg-xwininfo,"allows querying information about windows." ,xorg-xinit,"starts the graphical server." +V,xorg-minimal,"is the graphical server." +V,xorg-fonts,"is a font package." +V,libX11-devel,"is required for the compilation of some programs." ,sxhkd,"binds keys." +I,libXft-devel,"is required for the compilation of some programs." +I,gcr-devel,"is required for the compilation of some programs." +I,fontconfig-devel,"is required for the compilation of some programs." ,ttf-inconsolata,"is the monospace font of LARBS." ,ttf-linux-libertine,"provides the sans and serif fonts for LARBS." -A,lf-bin,"is an extensive terminal file manager that everyone likes." +A,ranger-git,"is an extensive terminal file manager that everyone likes." ,arandr,"is a UI for screen adjustment." ,bc,"is used for a dropdown calculator." ,calcurse,"is a lightweight terminal-based calendar." ,xcompmgr,"is for transparency and removing screen-tearing." ,xorg-xprop,"is a tool for detecting window properties." +V,xprop,"is a tool for detecting window properties." ,dosfstools,"allows your computer to access dos-like filesystems." ,libnotify,"allows desktop notifications." +V,dbus,"facilitates inter-process communication." ,dunst,"is a suckless notification system." ,exfat-utils,"allows management of FAT drives." ,sxiv,"is a minimalist image viewer." @@ -21,6 +30,8 @@ A,lf-bin,"is an extensive terminal file manager that everyone likes." ,gnome-keyring,"serves as the system keyring." A,gtk-theme-arc-gruvbox-git,"gives the dark GTK theme used in LARBS." ,neovim,"a tidier vim with some useful features" +,i3blocks,"is the status bar." +,i3lock,"is the screen lock." ,mpd,"is a lightweight music daemon." ,mpc,"is a terminal interface for mpd." ,mpv,"is the patrician's choice video player." @@ -28,6 +39,7 @@ A,gtk-theme-arc-gruvbox-git,"gives the dark GTK theme used in LARBS." ,newsboat,"is a terminal RSS client." A,brave-bin,"is an elegant browser with built-in adblocking, tor and other features." ,ttf-joypixels,"is a package that gives the system unicode symbols and emojis used in the status bar and elsewhere." +V,font-symbola,"provides unicode and emoji symbols." A,ttf-symbola,"provides unicode and emoji symbols." ,ntfs-3g,"allows accessing NTFS partitions." ,alsa-utils,"is an audio interface for ALSA." @@ -36,6 +48,7 @@ A,sc-im,"is an Excel-like terminal spreadsheet manager." ,socat,"is a socket utility." ,tmux,"is a terminal multiplexer and the dropdown window in LARBS." ,unclutter,"hides an inactive mouse." +V,unclutter-xfixes,"hides an inactive mouse." ,unrar,"extracts rar's." ,unzip,"unzips zips." A,urlscan,"parses URLs in the terminal allowing keyboard-based selection." @@ -44,11 +57,12 @@ A,urlscan,"parses URLs in the terminal allowing keyboard-based selection." ,xclip,"allows for copying and pasting from the command line." ,xdotool,"provides window action utilities on the command line." ,xorg-xdpyinfo,"aids with resolution determination and screen recording." +V,xdpyinfo,"aids with resolution determination and screen recording." ,youtube-dl,"can download any YouTube video (or playlist or channel) when given the link." ,zathura,"is a pdf viewer with vim-like bindings." ,zathura-djvu,"gives zathura the ability to read .djvu files." ,zathura-pdf-mupdf,"allows mupdf pdf compatibility in zathura." -,chafa,"generates approximate image previews in the terminal." +A,python-ueberzug,"generates image previews in ranger and other terminal programs." ,poppler,"manipulates .pdfs and gives .pdf previews and other .pdf functions." ,mediainfo,"shows audio and video information." ,atool,"manages and gives information about archives." @@ -57,7 +71,13 @@ A,urlscan,"parses URLs in the terminal allowing keyboard-based selection." ,xorg-xbacklight,"enables changing screen brightness levels." ,zsh-syntax-highlighting,"provides fish-like syntax highlighting in the shell." A,task-spooler,"queues commands or files for download." +V,ts,"queues commands or files for download." A,simple-mtpfs,"enables the mounting of cell phones." +V,simple-mtpfs,"enables the mounting of cell phones." +V,setxkbmap,"allows LARBS's unique keyboard bindings." +V,xmodmap,"allows LARBS's unique keyboard bindings." +V,xsetroot,"sets status bar and other X properies." +V,xset,"allows speeding up the X rate." G,https://github.com/LukeSmithxyz/dwmblocks.git,"serves as the modular status bar." G,https://github.com/lukesmithxyz/dmenu.git,"runs commands and provides a UI for selection." G,https://github.com/lukesmithxyz/st.git,"is my custom build of suckless's terminal emulator."