Add new commands
This commit is contained in:
parent
6d8da1abcd
commit
fd302b3275
|
@ -0,0 +1 @@
|
|||
Report disk usage by file type: find . -type f -empty -prune -o -type f -printf "%s\t" -exec file --brief --mime-type '{}' \; | awk 'BEGIN {printf("%12s\t%12s\n", "bytes", "type")} {type = $2; a[type] += $1} END {for (i in a) printf("%12u\t%12s\n", a[i], i) | "sort -nr"}'
|
6
a
6
a
|
@ -5,12 +5,14 @@ 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)
|
||||
action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for apt" 10 40 0 "Install" 1 "Install from .deb file" 2 "Update" 3 "Upgrade" 4 "Remove" 5 "Autoremove" 6)
|
||||
|
||||
|
||||
if [[ $action == "Install" || $action == "Remove" ]]; then
|
||||
package=$(apt-cache search '' | sort | cut --delimiter ' ' --fields 1 | fzf --multi --cycle --reverse --preview 'apt-cache show {1}')
|
||||
sudo apt ${action,,} $package -y
|
||||
elif [[ $action == "Update" || $action == "Upgrade" ]]; then
|
||||
elif [[ $action == "Install from .deb file" ]]; then
|
||||
find ~ -name *.deb | fzf | xargs -I _ sudo apt install -y _
|
||||
elif [[ $action == "Update" || $action == "Upgrade" || $action == "Autoremove" ]]; then
|
||||
sudo apt ${action,,} -y
|
||||
fi
|
||||
|
|
4
g
4
g
|
@ -6,7 +6,7 @@ cat > /tmp/.dialogrc << EOL
|
|||
tag_color = (BLACK,WHITE,ON)
|
||||
EOL
|
||||
set +ex
|
||||
action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for git" 10 40 0 'Add all && Commit && Push' 1 "Add all" 2 "Commit" 3 "Push" 4)
|
||||
action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for git" 10 40 0 'Add all && Commit && Push' 1 "Add all" 2 "Commit" 3 "Push" 4 "Status" 5)
|
||||
|
||||
#echo $action
|
||||
#exit
|
||||
|
@ -23,4 +23,6 @@ elif [[ $action == "Commit" ]]; then
|
|||
git commit -"m $commit_message"
|
||||
elif [[ $action == "Push" ]]; then
|
||||
git push
|
||||
elif [[ $action == "Status" ]]; then
|
||||
git status
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue