home
/
code
/
khome.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use semantically-named variables
[khome.git]
/
home
/
lib
/
login_functions.sh
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
ac788be
..
042ea60
100644
(file)
--- a/
home/lib/login_functions.sh
+++ b/
home/lib/login_functions.sh
@@
-224,8
+224,9
@@
man() {
command man "$@"
}
command man "$@"
}
-experiment() {
- cd "$(~/bin/experiment $@)" || kill -INT $$
+# new experiment
+x() {
+ cd "$(~/bin/x $@)" || kill -INT $$
}
hump() {
}
hump() {
@@
-233,7
+234,7
@@
hump() {
}
howto() {
}
howto() {
- cat "$(find ~/
Archives/Documents
/HOWTOs -mindepth 1 -maxdepth 1 | sort | fzf)"
+ cat "$(find ~/
arc/doc
/HOWTOs -mindepth 1 -maxdepth 1 | sort | fzf)"
}
_yt() {
}
_yt() {
@@
-262,7
+263,10
@@
yt_video() {
}
gh_fetch_repos() {
}
gh_fetch_repos() {
- curl "https://api.github.com/$1/$2/repos?page=1&per_page=10000"
+ local -r user_type="$1"
+ local -r user_name="$2"
+
+ curl "https://api.github.com/$user_type/$user_name/repos?page=1&per_page=10000"
}
gh_clone() {
}
gh_clone() {
@@
-427,6
+431,10
@@
flat_top_5() {
'
}
'
}
+internet_addr() {
+ curl --silent --show-error --max-time "${1:=1}" 'https://api.ipify.org' 2>&1
+}
+
status_batt() {
case "$(uname)" in
'Linux')
status_batt() {
case "$(uname)" in
'Linux')
@@
-535,7
+543,22
@@
status() {
echo
echo
+ printf '%sthermal\n' "$indent_unit"
+ for _dir in /sys/class/thermal/thermal_zone*
+ do
+ printf '%s %.2f C\n' \
+ $(cat "$_dir"/type) \
+ $(( $(cat "$_dir"/temp) / 1000 ))
+ done \
+ | column -t \
+ | indent "${indent_unit}${indent_unit}"
+
echo 'net'
echo 'net'
+ local -r internet_addr=$(internet_addr 0.5)
+ local -r internet_ptr=$(host -W 1 "$internet_addr" | awk 'NR == 1 {print $NF}' )
+
+ echo "${indent_unit}internet"
+ echo "${indent_unit}${indent_unit}$internet_addr $internet_ptr"
echo "${indent_unit}if"
(ifconfig; iwconfig) 2> /dev/null \
| awk '
echo "${indent_unit}if"
(ifconfig; iwconfig) 2> /dev/null \
| awk '
This page took
0.027781 seconds
and
4
git commands to generate.