Commit | Line | Data |
---|---|---|
c7de24d9 | 1 | # Top Disk-Using directories |
58bdbfbf | 2 | # TODO: Consider using numfmt instead of awk |
c7de24d9 SK |
3 | tdu() { |
4 | du "$1" \ | |
5 | | sort -n -k 1 -r --parallel="$(nproc)" \ | |
6 | | head -50 \ | |
7 | | awk ' | |
8 | { | |
9 | size = $1 | |
10 | path = $0 | |
11 | sub("^" $1 "\t+", "", path) | |
12 | gb = size / 1024 / 1024 | |
13 | printf("%f\t%s\n", gb, path) | |
14 | }' \ | |
15 | | cut -c 1-115 | |
16 | } | |
17 | ||
18 | pa_def_sink() { | |
19 | pactl info | awk '/^Default Sink:/ {print $3}' | |
20 | } | |
21 | ||
22 | void_pkgs() { | |
23 | curl "https://xq-api.voidlinux.org/v1/query/x86_64?q=$1" | jq '.data' | |
24 | } | |
25 | ||
26 | # Colorful man | |
27 | man() { | |
28 | LESS_TERMCAP_md=$'\e[01;31m' \ | |
29 | LESS_TERMCAP_me=$'\e[0m' \ | |
30 | LESS_TERMCAP_se=$'\e[0m' \ | |
31 | LESS_TERMCAP_so=$'\e[01;44;33m' \ | |
32 | LESS_TERMCAP_ue=$'\e[0m' \ | |
33 | LESS_TERMCAP_us=$'\e[01;32m' \ | |
34 | command man "$@" | |
35 | } | |
64ec9f23 SK |
36 | |
37 | experiment() { | |
38 | cd "$($HOME/bin/experiment $@)" | |
39 | } | |
801dd7bd SK |
40 | |
41 | hump() { | |
42 | ledit -l $(stty size | awk '{print $2}') ocaml $@ | |
43 | } | |
632b7c4a SK |
44 | |
45 | howto() { | |
39b8a1f7 | 46 | cat $(ls -1 -d $HOME/Archives/Documents/HOWTOs/* | fzf) |
632b7c4a | 47 | } |
f4e0bb58 SK |
48 | |
49 | gh_fetch_repos() { | |
50 | curl "https://api.github.com/$1/$2/repos?page=1&per_page=10000" | |
51 | } | |
52 | ||
53 | gh_clone() { | |
54 | gh_fetch_repos "$1" "$2" \ | |
55 | | jq --raw-output '.[] | select(.fork | not) | .git_url' \ | |
56 | | parallel -j 25 \ | |
57 | git clone {} | |
58 | } | |
59 | ||
60 | gh_clone_user() { | |
61 | gh_clone 'users' "$1" | |
62 | } | |
63 | ||
64 | gh_clone_org() { | |
65 | gh_clone 'orgs' "$1" | |
66 | } | |
e09a8d5a | 67 | |
c45bdb58 SK |
68 | work_log_template() { |
69 | cat << EOF | |
70 | $(date +%F) | |
71 | ========== | |
72 | ||
73 | Morning report | |
74 | -------------- | |
75 | ||
c44fbbc2 | 76 | ### Previous |
c45bdb58 | 77 | |
c44fbbc2 | 78 | ### Current |
c45bdb58 SK |
79 | |
80 | ### Blockers | |
81 | ||
82 | Day's notes | |
83 | ----------- | |
84 | EOF | |
85 | } | |
86 | ||
87 | work_log() { | |
88 | mkdir -p "$DIR_WORK_LOG" | |
89 | file_work_log_today="${DIR_WORK_LOG}/$(date +%F).md" | |
90 | if [ ! -f "$file_work_log_today" ] | |
91 | then | |
92 | work_log_template > "$file_work_log_today" | |
93 | fi | |
94 | vim "$file_work_log_today" | |
95 | ||
96 | } | |
97 | ||
e09a8d5a SK |
98 | weather() { |
99 | curl "http://wttr.in/$WEATHER_LOCATION" | |
100 | } | |
2c0865d1 SK |
101 | |
102 | bt_devs_paired() { | |
103 | bluetoothctl -- paired-devices \ | |
104 | | awk '{print $2}' \ | |
105 | | xargs bluetoothctl -- info | |
106 | } | |
107 | ||
108 | bt_devs() { | |
109 | bluetoothctl -- devices \ | |
110 | | awk '{print $2}' \ | |
111 | | xargs bluetoothctl -- info | |
112 | } |