tui-scripts/a

16 lines
505 B
Bash
Executable File

#!/bin/bash
set -e
cat > /tmp/.dialogrc << EOL
# Item color
tag_color = (BLACK,WHITE,ON)
EOL
action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for apt" 10 40 0 "Update" 1 "Upgrade" 2 "Install" 3 "Remove" 4)
if [[ $action == "Install" || $action == "Remove" ]]; then
package=$(apt list 2>/dev/null | awk -F'/' 'NR>1{print $1}' | fzf)
sudo apt ${action,,} $package -y
elif [[ $action == "Update" || $action == "Upgrade" ]]; then
sudo apt ${action,,} -y
fi