home
/
code
/
khome.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add TODO to unify package lists
[khome.git]
/
home
/
lib
/
login_functions.sh
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
0f0ab7d
..
8f200aa
100644
(file)
--- a/
home/lib/login_functions.sh
+++ b/
home/lib/login_functions.sh
@@
-7,7
+7,6
@@
d() {
shell_activity_report() {
# TODO: optional concrete number output
shell_activity_report() {
# TODO: optional concrete number output
- # TODO: manual weekday calc (since forking date is so expensive)
# TODO: optional combinations of granularities: hour, weekday, month, year
local group_by="$1"
case "$group_by" in
# TODO: optional combinations of granularities: hour, weekday, month, year
local group_by="$1"
case "$group_by" in
@@
-15,8
+14,8
@@
shell_activity_report() {
'dow') ;;
'') group_by='dow';;
*)
'dow') ;;
'') group_by='dow';;
*)
- echo "Usage: $0
DIRECTORY
[mon|dow]" >&2
- exit 1
+ echo "Usage: $0 [mon|dow]" >&2
+ kill -INT $$
esac
history \
| awk -v group_by="$group_by" '
esac
history \
| awk -v group_by="$group_by" '
@@
-141,8
+140,8
@@
top_commands() {
# TODO: Consider using numfmt instead of awk
tdu() {
du "$1" \
# TODO: Consider using numfmt instead of awk
tdu() {
du "$1" \
- | sort -n -k 1
-r
\
- |
head
-50 \
+ | sort -n -k 1 \
+ |
tail
-50 \
| awk '
{
size = $1
| awk '
{
size = $1
@@
-157,8
+156,8
@@
tdu() {
# Top Disk-Using Files
tduf() {
find "$1" -type f -printf '%s\t%p\0' \
# Top Disk-Using Files
tduf() {
find "$1" -type f -printf '%s\t%p\0' \
- | sort -z -n -k 1
-r
\
- |
head
-z -n 50 \
+ | sort -z -n -k 1 \
+ |
tail
-z -n 50 \
| gawk -v RS='\0' '
{
size = $1
| gawk -v RS='\0' '
{
size = $1
@@
-207,17
+206,27
@@
void_pkgs() {
# Colorful man
man() {
# Colorful man
man() {
- LESS_TERMCAP_md=$'\e[01;31m' \
+ # mb: begin blink
+ # md: begin bold
+ # me: end bold, blink and underline
+ #
+ # so: begin standout (reverse video)
+ # se: end standout
+ #
+ # us: begin underline
+ # ue: end underline
+
+ LESS_TERMCAP_md=$'\e[01;30m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_me=$'\e[0m' \
- LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[01;44;33m' \
LESS_TERMCAP_so=$'\e[01;44;33m' \
+ LESS_TERMCAP_se=$'\e[0m' \
+ LESS_TERMCAP_us=$'\e[01;33m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_ue=$'\e[0m' \
- LESS_TERMCAP_us=$'\e[01;32m' \
command man "$@"
}
experiment() {
command man "$@"
}
experiment() {
- cd "$(~/bin/experiment $@)" ||
exit 1
+ cd "$(~/bin/experiment $@)" ||
kill -INT $$
}
hump() {
}
hump() {
@@
-240,7
+249,7
@@
yt() {
_yt_dir="${DIR_YOUTUBE}/individual-videos/${_yt_title}--${_yt_id}"
mkdir -p "$_yt_dir"
_yt_dir="${DIR_YOUTUBE}/individual-videos/${_yt_title}--${_yt_id}"
mkdir -p "$_yt_dir"
- cd "$_yt_dir" ||
exit 1
+ cd "$_yt_dir" ||
kill -INT $$
echo "$_yt_uri" > 'uri'
youtube-dl -c --write-description --write-info-json "$_yt_uri"
}
echo "$_yt_uri" > 'uri'
youtube-dl -c --write-description --write-info-json "$_yt_uri"
}
@@
-254,7
+263,7
@@
gh_clone() {
gh_user_name="$2"
gh_dir="${DIR_GITHUB}/${gh_user_name}"
mkdir -p "$gh_dir"
gh_user_name="$2"
gh_dir="${DIR_GITHUB}/${gh_user_name}"
mkdir -p "$gh_dir"
- cd "$gh_dir" ||
exit 1
+ cd "$gh_dir" ||
kill -INT $$
gh_fetch_repos "$gh_user_type" "$gh_user_name" \
| jq --raw-output '.[] | select(.fork | not) | .git_url' \
| parallel -j 25 \
gh_fetch_repos "$gh_user_type" "$gh_user_name" \
| jq --raw-output '.[] | select(.fork | not) | .git_url' \
| parallel -j 25 \
@@
-273,7
+282,7
@@
gh_clone_repo() {
gh_username=$(echo "$1" | awk -F / '"$1 == "https" && $3 == github.com" {print $4}')
gh_dir="${DIR_GITHUB}/${gh_username}"
mkdir -p "$gh_dir"
gh_username=$(echo "$1" | awk -F / '"$1 == "https" && $3 == github.com" {print $4}')
gh_dir="${DIR_GITHUB}/${gh_username}"
mkdir -p "$gh_dir"
- cd "$gh_dir" ||
exit 1
+ cd "$gh_dir" ||
kill -INT $$
git clone "$1"
}
git clone "$1"
}
@@
-313,7
+322,12
@@
note() {
}
weather() {
}
weather() {
- curl "http://wttr.in/$WEATHER_LOCATION"
+ local _weather_location
+ case "$1" in
+ '') _weather_location="$WEATHER_LOCATION";;
+ *) _weather_location="$1"
+ esac
+ curl "http://wttr.in/$_weather_location?format=v2"
}
bt_devs_paired() {
}
bt_devs_paired() {
This page took
0.033858 seconds
and
4
git commands to generate.