Add option to perform all tweaks

This commit is contained in:
2025-10-12 15:12:03 -04:00
parent 7450de89ae
commit 28a8b46af1
5 changed files with 83 additions and 23 deletions
+9 -1
View File
@@ -9,8 +9,13 @@ import (
func applications() {
for {
var choice int
if performAllTweaks {
choice = 2
} else {
choice = front.InputMenuGen("Application to install:", []string{"BACK", "ALL", "yay-bin", "zsh", "htop", "neovim", "virt-manager (also installs qemu-desktop+libvirt)", "librewolf-bin", "zed", "steam", "corectrl"})
}
var doAll bool
choice := front.InputMenuGen("Application to install:", []string{"BACK", "ALL", "yay-bin", "zsh", "htop", "neovim", "virt-manager (also installs qemu-desktop+libvirt)", "librewolf-bin", "zed", "steam", "corectrl"})
switch choice {
case 1:
return
@@ -88,6 +93,9 @@ func applications() {
managePackages("-Rcns", []string{"power-profiles-daemon"})
writeFile(mountPoint+"/etc/polkit-1/rules.d/90-corectrl.rules", corectrlPolkit, "root", 0644)
}
if performAllTweaks {
break
}
}
}
+9 -1
View File
@@ -6,8 +6,13 @@ import (
func configurations() {
for {
var choice int
if performAllTweaks {
choice = 2
} else {
choice = front.InputMenuGen("Custom config:", []string{"BACK", "ALL", "shell profile", "makepkg", "pacman"})
}
var doAll bool
choice := front.InputMenuGen("Custom config:", []string{"BACK", "ALL", "shell profile", "makepkg", "pacman"})
switch choice {
case 1:
return
@@ -35,6 +40,9 @@ func configurations() {
writeFile(mountPoint+"/etc/pacman.d/hooks/paccache-clean.hook", pacmanHookClean, "root", 0644)
writeFile(mountPoint+"/etc/pacman.d/hooks/nvidia.hook", pacmanHookNvidia, "root", 0644)
}
if performAllTweaks {
break
}
}
}
+45 -14
View File
@@ -8,12 +8,11 @@ import (
"github.com/rwinkhart/go-boilerplate/other"
)
var mountPoint = "/mnt/cph"
var username string
var partitionR, partitionB string
var mountPoint = "/mnt/cph"
var performAllTweaks bool
// TODO add mode to perform EVERYTHING
func main() {
userInfo, err := user.Current()
if err != nil {
@@ -33,35 +32,67 @@ func main() {
for {
fmt.Println()
choice := front.InputMenuGen("Option:", []string{"pre-mount tweaks", "universal tweaks", "system tweaks", "removals", "applications", "configuration", "cosmic"})
choice := front.InputMenuGen("Option:", []string{"ALL", "pre-mount tweaks", "universal tweaks", "system tweaks", "removals", "applications", "configuration", "cosmic"})
switch choice {
case 1:
performAllTweaks = true
fallthrough
case 2:
if partitionIsMounted() {
fmt.Println("\n" + partitionR + " is already mounted on " + mountPoint)
} else {
premount()
}
case 2:
mountPartition()
universalTweaks()
if !performAllTweaks {
break
}
fallthrough
case 3:
mountPartition()
system()
universalTweaks()
if !performAllTweaks {
break
}
fallthrough
case 4:
mountPartition()
removals()
system()
if !performAllTweaks {
break
}
fallthrough
case 5:
mountPartition()
applications()
removals()
if !performAllTweaks {
break
}
fallthrough
case 6:
mountPartition()
configurations()
applications()
if !performAllTweaks {
break
}
fallthrough
case 7:
mountPartition()
configurations()
if !performAllTweaks {
break
}
fallthrough
case 8:
mountPartition()
cosmic()
// TODO keyboard shortcuts for screenshot/sticky window/terminal
// TODO window decoration position (not yet implemented?)
// TODO link CachyOS wallpapers?
// TODO window decoration position (not yet implemented)
// TODO screen blank shortcut (not yet implemented)
}
}
}
+11 -6
View File
@@ -7,17 +7,22 @@ import (
// TODO remove unneeded linux-firmware packages!
func removals() {
for {
var doAll bool
choice := front.InputMenuGen("Application to remove:", []string{"BACK", "linux-cachyos-lts"})
var target string
var choice int
if performAllTweaks {
choice = 1
} else {
choice = front.InputMenuGen("Application to remove:", []string{"BACK", "linux-cachyos-lts"})
}
var targets []string
switch choice {
case 1:
return
case 2:
target = "linux-cachyos-lts"
targets = append(targets, "linux-cachyos-lts")
}
if !doAll {
managePackages("-Rcns", []string{target})
managePackages("-Rcns", targets)
if performAllTweaks {
break
}
}
}
+9 -1
View File
@@ -11,8 +11,13 @@ import (
func system() {
for {
var choice int
if performAllTweaks {
choice = 2
} else {
choice = front.InputMenuGen("Tweak:", []string{"BACK", "ALL", "replace sudo with doas", "enable ipv6 privacy extensions", "enable SysRq reboots", "disable kernel security mitigations", "unlock amdgpu tuning", "enable amd_pstate in passive mode (recommended for zenver2)"})
}
var doAll bool
choice := front.InputMenuGen("Tweak:", []string{"BACK", "ALL", "replace sudo with doas", "enable ipv6 privacy extensions", "enable SysRq reboots", "disable kernel security mitigations", "unlock amdgpu tuning", "enable amd_pstate in passive mode (recommended for zenver2)"})
switch choice {
case 1:
return
@@ -71,6 +76,9 @@ func system() {
case 8:
addKernelParams([]string{"amd_pstate=passive"})
}
if performAllTweaks {
break
}
}
}