systemmenu 1.1 KB

123456789101112131415161718
  1. #!/bin/sh
  2. systemmenu() {
  3. options="󰞀 Update\n Cleanup\n Backup\n Audit"
  4. selected=$(echo "$options" | dmenu -i -p "System:" )
  5. if [ "$selected" = "󰞀 Update" ]; then
  6. $TERMINAL sh -c 'doas pacman -Syu --disable-download-timeout && yay -Syu --disable-download-timeout --aur; exec zsh'
  7. elif [ "$selected" = " Cleanup" ]; then
  8. $TERMINAL sh -c 'doas paccache -rvk2 && yay -Sc --aur --noconfirm && rm -f ~/.config/zsh/.zsh_history && find ~/.cache -mindepth 1 -maxdepth 1 -type d ! -name backups -exec rm -rf {} + && doas rm -f /root/.config/zsh/.zsh_history && doas find /var/log -name "*.log" -type f -mtime +7 -delete; exec zsh'
  9. elif [ "$selected" = " Backup" ]; then
  10. $TERMINAL sh -c "rsync -artvzP ~/documents ~/music ~/pictures ~/videos ~/.config ~/.librewolf ~/.local ~/.ssh ~/.cache/backups/$(date '+%d_%m_%Y') --delete; exec zsh"
  11. elif [ "$selected" = " Audit" ]; then
  12. $TERMINAL sh -c 'doas freshclam && doas clamscan --exclude-dir=/sys -ri ~ && doas paccheck --quiet --files --file-properties --db-files --require-mtree; exec zsh'
  13. fi
  14. }
  15. systemmenu