From fd302b327530ec5ab223979b343ad8dc918b56c6 Mon Sep 17 00:00:00 2001 From: Digital Studium Date: Fri, 29 Mar 2024 10:23:10 +0300 Subject: [PATCH] Add new commands --- .aliases.txt | 1 + VERSION | 2 +- a | 6 ++++-- g | 4 +++- r | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .aliases.txt diff --git a/.aliases.txt b/.aliases.txt new file mode 100644 index 0000000..3bdc2c5 --- /dev/null +++ b/.aliases.txt @@ -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"}' diff --git a/VERSION b/VERSION index c068b24..c239c60 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4 +1.5 diff --git a/a b/a index 5abb404..6503abf 100755 --- a/a +++ b/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 diff --git a/g b/g index 02134c4..3224555 100755 --- a/g +++ b/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 diff --git a/r b/r index 034c61f..0ac7800 100755 --- a/r +++ b/r @@ -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