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() { func applications() {
for { 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 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 { switch choice {
case 1: case 1:
return return
@@ -88,6 +93,9 @@ func applications() {
managePackages("-Rcns", []string{"power-profiles-daemon"}) managePackages("-Rcns", []string{"power-profiles-daemon"})
writeFile(mountPoint+"/etc/polkit-1/rules.d/90-corectrl.rules", corectrlPolkit, "root", 0644) 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() { func configurations() {
for { for {
var choice int
if performAllTweaks {
choice = 2
} else {
choice = front.InputMenuGen("Custom config:", []string{"BACK", "ALL", "shell profile", "makepkg", "pacman"})
}
var doAll bool var doAll bool
choice := front.InputMenuGen("Custom config:", []string{"BACK", "ALL", "shell profile", "makepkg", "pacman"})
switch choice { switch choice {
case 1: case 1:
return 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/paccache-clean.hook", pacmanHookClean, "root", 0644)
writeFile(mountPoint+"/etc/pacman.d/hooks/nvidia.hook", pacmanHookNvidia, "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" "github.com/rwinkhart/go-boilerplate/other"
) )
var mountPoint = "/mnt/cph"
var username string var username string
var partitionR, partitionB string var partitionR, partitionB string
var mountPoint = "/mnt/cph"
var performAllTweaks bool
// TODO add mode to perform EVERYTHING
func main() { func main() {
userInfo, err := user.Current() userInfo, err := user.Current()
if err != nil { if err != nil {
@@ -33,35 +32,67 @@ func main() {
for { for {
fmt.Println() 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 { switch choice {
case 1: case 1:
performAllTweaks = true
fallthrough
case 2:
if partitionIsMounted() { if partitionIsMounted() {
fmt.Println("\n" + partitionR + " is already mounted on " + mountPoint) fmt.Println("\n" + partitionR + " is already mounted on " + mountPoint)
} else { } else {
premount() premount()
} }
case 2:
mountPartition() if !performAllTweaks {
universalTweaks() break
}
fallthrough
case 3: case 3:
mountPartition() mountPartition()
system() universalTweaks()
if !performAllTweaks {
break
}
fallthrough
case 4: case 4:
mountPartition() mountPartition()
removals() system()
if !performAllTweaks {
break
}
fallthrough
case 5: case 5:
mountPartition() mountPartition()
applications() removals()
if !performAllTweaks {
break
}
fallthrough
case 6: case 6:
mountPartition() mountPartition()
configurations() applications()
if !performAllTweaks {
break
}
fallthrough
case 7: case 7:
mountPartition()
configurations()
if !performAllTweaks {
break
}
fallthrough
case 8:
mountPartition() mountPartition()
cosmic() cosmic()
// TODO keyboard shortcuts for screenshot/sticky window/terminal // TODO window decoration position (not yet implemented)
// TODO window decoration position (not yet implemented?) // TODO screen blank shortcut (not yet implemented)
// TODO link CachyOS wallpapers?
} }
} }
} }
+11 -6
View File
@@ -7,17 +7,22 @@ import (
// TODO remove unneeded linux-firmware packages! // TODO remove unneeded linux-firmware packages!
func removals() { func removals() {
for { for {
var doAll bool var choice int
choice := front.InputMenuGen("Application to remove:", []string{"BACK", "linux-cachyos-lts"}) if performAllTweaks {
var target string choice = 1
} else {
choice = front.InputMenuGen("Application to remove:", []string{"BACK", "linux-cachyos-lts"})
}
var targets []string
switch choice { switch choice {
case 1: case 1:
return return
case 2: case 2:
target = "linux-cachyos-lts" targets = append(targets, "linux-cachyos-lts")
} }
if !doAll { managePackages("-Rcns", targets)
managePackages("-Rcns", []string{target}) if performAllTweaks {
break
} }
} }
} }
+9 -1
View File
@@ -11,8 +11,13 @@ import (
func system() { func system() {
for { 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 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 { switch choice {
case 1: case 1:
return return
@@ -71,6 +76,9 @@ func system() {
case 8: case 8:
addKernelParams([]string{"amd_pstate=passive"}) addKernelParams([]string{"amd_pstate=passive"})
} }
if performAllTweaks {
break
}
} }
} }