mirror of
https://github.com/rwinkhart/cachyos-postinstall-helper.git
synced 2026-09-05 16:47:32 -04:00
Install zsh-histclean alongside zsh
This commit is contained in:
@@ -27,6 +27,7 @@ func applications() {
|
|||||||
case 4:
|
case 4:
|
||||||
managePackages("-S", []string{"zsh", "zsh-autosuggestions", "zsh-syntax-highlighting"})
|
managePackages("-S", []string{"zsh", "zsh-autosuggestions", "zsh-syntax-highlighting"})
|
||||||
writeFile(mountPoint+"/home/"+getUsername()+"/.zshrc", zshrc, getUsername(), 0644)
|
writeFile(mountPoint+"/home/"+getUsername()+"/.zshrc", zshrc, getUsername(), 0644)
|
||||||
|
writeFile(mountPoint+"/usr/local/bin/histclean", zshHistclean, "root", 0755)
|
||||||
err := os.RemoveAll(mountPoint + "/home/" + getUsername() + "/.bash_profile")
|
err := os.RemoveAll(mountPoint + "/home/" + getUsername() + "/.bash_profile")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
other.PrintError("Failed to remove .bash_profile", 1)
|
other.PrintError("Failed to remove .bash_profile", 1)
|
||||||
@@ -141,6 +142,31 @@ alias unmv='setopt shwordsplit && lastCmdSplit=(${(@s/ /)$(fc -ln -1)}) && newCm
|
|||||||
alias orphans='doas pacman -Rcns $(pacman -Qqdt)'
|
alias orphans='doas pacman -Rcns $(pacman -Qqdt)'
|
||||||
`
|
`
|
||||||
|
|
||||||
|
const zshHistclean = `#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
echo 'Starting history size:'
|
||||||
|
ls -lh ~/.cache/zsh-histfile | cut -d " " -f5
|
||||||
|
|
||||||
|
hist=()
|
||||||
|
|
||||||
|
while IFS= read -r line; do
|
||||||
|
if [[ $line == "./"* || $line == "/"* ]]; then
|
||||||
|
hist+=($line)
|
||||||
|
elif [[ $line != "histclean" ]]; then
|
||||||
|
which $(echo $line | cut -d " " -f1) > /dev/null
|
||||||
|
[[ $? == 0 ]] && hist+=($line)
|
||||||
|
fi
|
||||||
|
done < "$XDG_CACHE_HOME"/zsh-histfile
|
||||||
|
|
||||||
|
echo -n "" > "$XDG_CACHE_HOME"/zsh-histfile
|
||||||
|
for item in "${hist[@]}"; do
|
||||||
|
echo "$item" >> "$XDG_CACHE_HOME"/zsh-histfile
|
||||||
|
done
|
||||||
|
|
||||||
|
echo 'Ending history size:'
|
||||||
|
ls -lh ~/.cache/zsh-histfile | cut -d " " -f5
|
||||||
|
`
|
||||||
|
|
||||||
const sysinitVim = `" rwinkhart/cachyos-postinstall-helper 09/28/2025
|
const sysinitVim = `" rwinkhart/cachyos-postinstall-helper 09/28/2025
|
||||||
|
|
||||||
" ensure correct basic settings
|
" ensure correct basic settings
|
||||||
|
|||||||
Reference in New Issue
Block a user