Files
cachyos-postinstall-helper/main.go
T

68 lines
1.5 KiB
Go

package main
import (
"fmt"
"os/user"
"github.com/rwinkhart/go-boilerplate/front"
"github.com/rwinkhart/go-boilerplate/other"
)
var mountPoint = "/mnt/cph"
var username string
var partitionR, partitionB string
// TODO add mode to perform EVERYTHING
func main() {
userInfo, err := user.Current()
if err != nil {
other.PrintError("Failed to get current user", 1)
}
if userInfo.Uid != "0" {
other.PrintError("This utility must be run as root", 1)
}
partitionR = front.Input("Target root partition (/dev/driveparition OR \"/\" if already booted):")
if partitionR != "/" {
partitionB = front.Input("Target boot (efi) partition (/dev/driveparition):")
mkdir("/mnt/cph")
} else {
mountPoint = ""
}
for {
fmt.Println()
choice := front.InputMenuGen("Option:", []string{"pre-mount tweaks", "universal tweaks", "system tweaks", "removals", "applications", "configuration", "cosmic"})
switch choice {
case 1:
if partitionIsMounted() {
fmt.Println("\n" + partitionR + " is already mounted on " + mountPoint)
} else {
premount()
}
case 2:
mountPartition()
universalTweaks()
case 3:
mountPartition()
system()
case 4:
mountPartition()
removals()
case 5:
mountPartition()
applications()
case 6:
mountPartition()
configurations()
case 7:
mountPartition()
cosmic()
// TODO keyboard shortcuts for screenshot/sticky window/terminal
// TODO window decoration position (not yet implemented?)
// TODO link CachyOS wallpapers?
}
}
}