Add new commands

This commit is contained in:
Digital Studium 2024-03-29 10:23:10 +03:00
parent 6d8da1abcd
commit fd302b3275
5 changed files with 10 additions and 5 deletions

1
.aliases.txt Normal file
View File

@ -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"}'

View File

@ -1 +1 @@
1.4
1.5

6
a
View File

@ -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
View File

@ -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

2
r
View File

@ -1,4 +1,4 @@
#!/bin/bash
trap 'clear' SIGINT
setxkbmap
cat ~/.aliases.txt | fzf | cut -d : -f 2- | xargs -I _ xdotool type _
cat ~/.aliases.txt | fzf | cut -d : -f 2- | (stty -F /dev/tty -echo; xargs -0 -I _ xdotool type --delay 0 _; stty -F /dev/tty echo) && xdotool key Return