-
Notifications
You must be signed in to change notification settings - Fork 0
/
_homedir-vars
105 lines (76 loc) · 3.05 KB
/
_homedir-vars
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#! /hint/sh
# Arch Wiki: XDG Base Directory
# https://wiki.archlinux.org/index.php/XDG_Base_Directory
: "${HOME:?}" && . ~/.config/user-dirs.dirs || return
# XDG_HOME_DIR=${XDG_HOME_DIR:?} \
export \
XDG_DESKTOP_DIR=${XDG_DESKTOP_DIR:?} \
XDG_DOCUMENTS_DIR=${XDG_DOCUMENTS_DIR:?} \
XDG_DOWNLOAD_DIR=${XDG_DOWNLOAD_DIR:?} \
XDG_MUSIC_DIR=${XDG_MUSIC_DIR:?} \
XDG_PICTURES_DIR=${XDG_PICTURES_DIR:?} \
XDG_PUBLICSHARE_DIR=${XDG_PUBLICSHARE_DIR:?} \
XDG_TEMPLATES_DIR=${XDG_TEMPLATES_DIR:?} \
XDG_VIDEOS_DIR=${XDG_VIDEOS_DIR:?} \
XDG_DATA_HOME=${XDG_DATA_HOME:?} \
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:?} \
XDG_CACHE_HOME=${XDG_CACHE_HOME:?} \
\
GTK2_RC_FILES=${XDG_CONFIG_HOME:?}/gtk-2.0/gtkrc \
KDEHOME=${XDG_CONFIG_HOME:?}/kde \
HISTFILE=${XDG_DATA_HOME:?}/bash/history \
ANDROID_PREFS_ROOT=${XDG_CONFIG_HOME:?}/android \
ANDROID_EMULATOR_HOME=${XDG_DATA_HOME:?}/android/emulator \
ANDROID_HOME=${XDG_DATA_HOME?}/android \
ATOM_HOME=${XDG_DATA_HOME:?}/atom \
SQLITE_HISTORY=${XDG_CACHE_HOME:?}/sqlite_history \
GNUPGHOME=${XDG_DATA_HOME:?}/gnupg \
NODE_REPL_HISTORY=${XDG_DATA_HOME:?}/node_repl_history \
PASSWORD_STORE_DIR=${XDG_DATA_HOME:?}/pass \
WGETRC=${XDG_CONFIG_HOME:?}/wgetrc \
CARGO_HOME=${XDG_DATA_HOME:?}/cargo \
GOPATH=${XDG_CACHE_HOME:?}/go \
LESSHISTFILE=- \
WINEPREFIX=${XDG_CONFIG_HOME:?}/wine \
;
return
# System directories:
# XDG_DATA_DIRS=${XDG_DATA_DIRS:=/usr/local/share}
# export LESSHISTFILE #https://stackoverflow.com/questions/26198926/why-does-lesshst-keep-showing-up-in-my
# XDG_CURRENT_DESKTOP XDG_RUNTIME_DIR XDG_SEAT XDG_SESSION_CLASS XDG_SESSION_ID XDG_SESSION_TYPE XDG_VIDEOS_DIR XDG_VTNR
# ( printf 'export '; set | grep -oPe '^XDG[^=]+(?==)' | tr '\n' ' '; )
# export GTK2_RC_FILES=${XDG_CONFIG_HOME:?}/gtk-2.0/gtkrc # ~/.gtkrc-2.0 seeems to not work??
# not as the ArchWiki:
return 0
false && ( set -eux # when cache is cleared use this:
/~/.local/bin/home/_/mkdirs -q
# after cleaning up .cache, run:
mkdir --verbose -p \
"$(readlink -f ~/.local/share/cargo)" ~/.cache/cargo \
"${ANDROID_PREFS_ROOT:-$XDG_CONFIG_HOME/android}" \
"${ANDROID_EMULATOR_HOME:-$XDG_DATA_HOME/android/emulator}" \
"${XDG_CONFIG_HOME:?}"/bash \
"${XDG_CONFIG_HOME:?}"/simplescreenrecorder \
;
# "${XDG_CACHE_HOME:?}/p7zip" \
# "${XDG_CACHE_HOME:?}/android-tools" \
# "${XDG_CACHE_HOME:?}/tt" \
# "${XDG_CACHE_HOME:?}/mongodb" \
# "${XDG_CACHE_HOME:?}/mongodb/homedir" `: '# check if need?'` \
case $(cat "${XDG_CONFIG_HOME:?}/wgetrc" || true) in
"hsts-file = $XDG_CACHE_HOME/wget"|"hsts-file = $XDG_CACHE_HOME/wget-hsts") :;;
''|?|??) echo hsts-file \= "$XDG_CACHE_HOME"/wget-hsts > "$XDG_CONFIG_HOME/wgetrc";;
*)
YN_confirm_v2 y \\
"file '$XDG_CONFIG_HOME/wgetrc' seems to have unexpected data:" \
"$(cat -n "$XDG_CONFIG_HOME/wgetrc")" \
"" \
"continue anyway?" \
&& {
echo hsts-file \= "$XDG_CACHE_HOME"/wget-hsts > "$XDG_CONFIG_HOME/wgetrc"
}
;;
esac
# mv -vi ~/.gitconfig "$XDG_CONFIG_HOME/git/config" # TOSO: check if thats right , arch wiki says only ("XDG_CONFIG_HOME/git/config")
# TODO node cache from '~/.cache/npm' # TODO: this line
)