mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts] Added old scripts.
This commit is contained in:
parent
cbaab0c3b6
commit
97427c27ee
2 changed files with 50 additions and 0 deletions
39
scripts/category-count
Executable file
39
scripts/category-count
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env bash
|
||||
# Script to fetch commit messages and display the category frequencies.
|
||||
# Example:
|
||||
# 047c36c [Meta] Added README.
|
||||
# 5b16912 [Init] Added scripts.
|
||||
#
|
||||
# Will output:
|
||||
# Meta: 1
|
||||
# Init: 1
|
||||
#
|
||||
# Authored by:
|
||||
# Dmytro Meleshko <dmytro.meleshko@gmail.com>
|
||||
|
||||
git log --format='%s' | gawk '
|
||||
match($0, /^\s*\[([^\]]+)\]/, groups) {
|
||||
stats[groups[1]] += 1
|
||||
}
|
||||
END {
|
||||
for (key in stats) {
|
||||
print stats[key] "\t" key
|
||||
}
|
||||
}
|
||||
' | sort --key=1 --numeric-sort | column -t -s $'\t'
|
||||
|
||||
# Hellish abonation {{{
|
||||
# Authored by:
|
||||
# Mijyuoon: <mijuoon@gmail.com>
|
||||
|
||||
# data=$(git log --oneline | awk -F '[][]' '{for (i=2; i<=NF; i+=2) {printf "%s ", $i}; print ""}')
|
||||
# keys=$(echo "$data" | sort -u | uniq)
|
||||
#
|
||||
# for type in $data; do
|
||||
# eval "count_$type="'$'"((count_$type+1))"
|
||||
# done
|
||||
#
|
||||
# for type in $keys; do
|
||||
# echo "$type: $(eval "echo "'$'"count_$type")"
|
||||
# done
|
||||
# }}}
|
11
scripts/copy-env-var
Executable file
11
scripts/copy-env-var
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if variable="$(set -euo pipefail; {
|
||||
awk 'BEGIN{for(v in ENVIRON) print v}'
|
||||
} | rofi -dmenu)" && [[ -n $variable ]]; then
|
||||
|
||||
variable="${variable%% *}"
|
||||
|
||||
echo ${!variable} | xclip -sel clip
|
||||
fi
|
Loading…
Reference in a new issue