Files
cachyos-postinstall-helper/applications.go
T

88 lines
1.8 KiB
Go

package main
import (
"os/exec"
"github.com/rwinkhart/go-boilerplate/front"
"github.com/rwinkhart/go-boilerplate/other"
)
func applications() {
for {
var doAll bool
choice := front.InputMenuGen("Application to install:", []string{"back", "all", "pamac-aur (replaces octopi)", "yay-bin (replaces paru)", "htop (replaces btop)", "neovim (replaces vi+vim+nano+micro)", "virt-manager (also installs qemu-desktop+libvirt)", "librewolf-bin", "zed", "steam"})
switch choice {
case 1:
return
case 2:
doAll = true
fallthrough
case 3:
managePackage("-S", "pamac-aur")
managePackage("-Rcns", "octopi")
if !doAll {
break
}
fallthrough
case 4:
managePackage("-S", "yay-bin")
managePackage("-Rcns", "paru")
if !doAll {
break
}
fallthrough
case 5:
managePackage("-S", "htop")
managePackage("-Rcns", "btop")
if !doAll {
break
}
fallthrough
case 6:
managePackage("-S", "neovim")
cmd := exec.Command("pacman", "-Rcns", "vi", "vim", "nano", "micro", "--noconfirm")
err := cmd.Run()
if err != nil {
other.PrintError("Failed to perform application removals for neovim installation", 1)
}
if !doAll {
break
}
fallthrough
case 7:
cmd := exec.Command("pacman", "-S", "virt-manager", "qemu-desktop", "libvirt", "--noconfirm")
err := cmd.Run()
if err != nil {
other.PrintError("Failed to perform application installations for virt-manager", 1)
}
manageService("enable", "libvirtd.service")
manageService("start", "libvirtd.service")
if !doAll {
break
}
fallthrough
case 8:
managePackage("-S", "librewolf-bin")
if !doAll {
break
}
fallthrough
case 9:
managePackage("-S", "zed")
if !doAll {
break
}
fallthrough
case 10:
managePackage("-S", "steam")
}
}
}