@sebastienrousseau/dotfiles 0.2.465 → 0.2.468

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/LICENSE +20 -17
  2. package/README.md +150 -155
  3. package/dist/Makefile +2 -2
  4. package/dist/bin/backup.js.map +1 -1
  5. package/dist/bin/constants.d.ts +2 -2
  6. package/dist/bin/constants.js +1 -1
  7. package/dist/bin/dotfiles.d.ts +2 -2
  8. package/dist/bin/dotfiles.d.ts.map +1 -1
  9. package/dist/bin/dotfiles.js +1 -2
  10. package/dist/bin/dotfiles.js.map +1 -1
  11. package/dist/bin/download.d.ts +2 -2
  12. package/dist/bin/download.d.ts.map +1 -1
  13. package/dist/bin/download.js +1 -2
  14. package/dist/bin/download.js.map +1 -1
  15. package/dist/bin/index.js +1 -1
  16. package/dist/bin/index.js.map +1 -1
  17. package/dist/filesizes.txt +92 -94
  18. package/dist/lib/README.md +9 -5
  19. package/dist/lib/aliases/README.md +16 -8
  20. package/dist/lib/aliases/archives/README.md +29 -26
  21. package/dist/lib/aliases/archives/archives.aliases.sh +148 -145
  22. package/dist/lib/aliases/cd/README.md +46 -44
  23. package/dist/lib/aliases/cd/cd.aliases.sh +63 -29
  24. package/dist/lib/aliases/chmod/README.md +8 -4
  25. package/dist/lib/aliases/chmod/chmod.aliases.sh +60 -42
  26. package/dist/lib/aliases/clear/README.md +8 -4
  27. package/dist/lib/aliases/clear/clear.aliases.sh +57 -28
  28. package/dist/lib/aliases/configuration/README.md +8 -4
  29. package/dist/lib/aliases/configuration/configuration.aliases.sh +56 -30
  30. package/dist/lib/aliases/default/README.md +8 -4
  31. package/dist/lib/aliases/default/default.aliases.sh +99 -86
  32. package/dist/lib/aliases/dig/README.md +8 -4
  33. package/dist/lib/aliases/dig/dig.aliases.sh +3 -3
  34. package/dist/lib/aliases/disk-usage/README.md +8 -4
  35. package/dist/lib/aliases/disk-usage/du.aliases.sh +2 -2
  36. package/dist/lib/aliases/editor/README.md +8 -4
  37. package/dist/lib/aliases/editor/editor.aliases.sh +3 -3
  38. package/dist/lib/aliases/find/README.md +8 -4
  39. package/dist/lib/aliases/find/find.aliases.sh +3 -3
  40. package/dist/lib/aliases/gcloud/README.md +8 -4
  41. package/dist/lib/aliases/gcloud/gcloud.aliases.sh +3 -3
  42. package/dist/lib/aliases/git/README.md +8 -4
  43. package/dist/lib/aliases/git/git.aliases.sh +2 -2
  44. package/dist/lib/aliases/gnu/README.md +8 -4
  45. package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +1 -1
  46. package/dist/lib/aliases/heroku/README.md +8 -4
  47. package/dist/lib/aliases/heroku/heroku.aliases.sh +2 -2
  48. package/dist/lib/aliases/interactive/README.md +29 -17
  49. package/dist/lib/aliases/interactive/interactive.aliases.sh +14 -17
  50. package/dist/lib/aliases/jekyll/README.md +8 -4
  51. package/dist/lib/aliases/jekyll/jekyll.aliases.sh +3 -3
  52. package/dist/lib/aliases/list/README.md +8 -4
  53. package/dist/lib/aliases/list/list.aliases.sh +2 -2
  54. package/dist/lib/aliases/{macos → macOS}/README.md +8 -4
  55. package/dist/lib/aliases/{macos → macOS}/macos.aliases.sh +2 -2
  56. package/dist/lib/aliases/make/README.md +8 -4
  57. package/dist/lib/aliases/make/make.aliases.sh +2 -2
  58. package/dist/lib/aliases/mkdir/README.md +8 -4
  59. package/dist/lib/aliases/mkdir/mkdir.aliases.sh +2 -2
  60. package/dist/lib/aliases/npm/README.md +8 -4
  61. package/dist/lib/aliases/npm/npm.aliases.sh +2 -2
  62. package/dist/lib/aliases/permission/README.md +8 -4
  63. package/dist/lib/aliases/permission/permission.aliases.sh +2 -2
  64. package/dist/lib/aliases/pnpm/README.md +8 -4
  65. package/dist/lib/aliases/pnpm/pnpm.aliases.sh +2 -2
  66. package/dist/lib/aliases/ps/README.md +8 -4
  67. package/dist/lib/aliases/ps/ps.aliases.sh +2 -2
  68. package/dist/lib/aliases/rsync/README.md +8 -4
  69. package/dist/lib/aliases/rsync/rsync.aliases.sh +2 -2
  70. package/dist/lib/aliases/rust/README.md +8 -4
  71. package/dist/lib/aliases/rust/rust.aliases.sh +23 -23
  72. package/dist/lib/aliases/subversion/README.md +8 -4
  73. package/dist/lib/aliases/subversion/subversion.aliases.sh +2 -2
  74. package/dist/lib/aliases/sudo/README.md +8 -4
  75. package/dist/lib/aliases/sudo/sudo.aliases.sh +2 -2
  76. package/dist/lib/aliases/tmux/README.md +8 -4
  77. package/dist/lib/aliases/tmux/tmux.aliases.sh +2 -2
  78. package/dist/lib/aliases/update/README.md +8 -4
  79. package/dist/lib/aliases/update/update.aliases.sh +2 -2
  80. package/dist/lib/aliases/uuid/README.md +8 -4
  81. package/dist/lib/aliases/uuid/uuid.aliases.sh +2 -2
  82. package/dist/lib/aliases/wget/README.md +8 -4
  83. package/dist/lib/aliases/wget/wget.aliases.sh +2 -2
  84. package/dist/lib/aliases.sh +42 -12
  85. package/dist/lib/configurations/README.md +8 -4
  86. package/dist/lib/configurations/bash/bashrc +3 -3
  87. package/dist/lib/configurations/curl/curlrc +2 -2
  88. package/dist/lib/configurations/default/color.sh +2 -2
  89. package/dist/lib/configurations/default/constants.sh +3 -3
  90. package/dist/lib/configurations/default/editor.sh +2 -2
  91. package/dist/lib/configurations/default/prompt.sh +2 -2
  92. package/dist/lib/configurations/input/inputrc +2 -2
  93. package/dist/lib/configurations/nano/nanorc +2 -2
  94. package/dist/lib/configurations/profile/profile +2 -2
  95. package/dist/lib/configurations/tmux/default +2 -2
  96. package/dist/lib/configurations/tmux/display +2 -2
  97. package/dist/lib/configurations/tmux/linux +2 -2
  98. package/dist/lib/configurations/tmux/navigation +2 -2
  99. package/dist/lib/configurations/tmux/panes +2 -2
  100. package/dist/lib/configurations/tmux/theme +3 -3
  101. package/dist/lib/configurations/tmux/tmux +2 -2
  102. package/dist/lib/configurations/vim/vimrc +1 -1
  103. package/dist/lib/configurations/wget/wgetrc +2 -2
  104. package/dist/lib/configurations/zsh/zshrc +11 -11
  105. package/dist/lib/configurations.sh +27 -9
  106. package/dist/lib/functions/README.md +12 -4
  107. package/dist/lib/functions/cdls.sh +2 -2
  108. package/dist/lib/functions/curlheader.sh +2 -2
  109. package/dist/lib/functions/curlstatus.sh +2 -2
  110. package/dist/lib/functions/curltime.sh +3 -3
  111. package/dist/lib/functions/encode64.sh +2 -2
  112. package/dist/lib/functions/environment.sh +2 -2
  113. package/dist/lib/functions/extract.sh +2 -2
  114. package/dist/lib/functions/freespace.sh +2 -2
  115. package/dist/lib/functions/genpwd.sh +4 -4
  116. package/dist/lib/functions/goto.sh +2 -2
  117. package/dist/lib/functions/hidehiddenfiles.sh +2 -2
  118. package/dist/lib/functions/hostinfo.sh +2 -2
  119. package/dist/lib/functions/hstats.sh +2 -2
  120. package/dist/lib/functions/httpdebug.sh +2 -2
  121. package/dist/lib/functions/keygen.sh +2 -2
  122. package/dist/lib/functions/last.sh +2 -2
  123. package/dist/lib/functions/logout.sh +2 -2
  124. package/dist/lib/functions/lowercase.sh +2 -2
  125. package/dist/lib/functions/matrix.sh +2 -2
  126. package/dist/lib/functions/mount_read_only.sh +2 -2
  127. package/dist/lib/functions/myproc.sh +2 -2
  128. package/dist/lib/functions/prependpath.sh +2 -2
  129. package/dist/lib/functions/ql.sh +2 -2
  130. package/dist/lib/functions/rd.sh +2 -2
  131. package/dist/lib/functions/remove_disk.sh +2 -2
  132. package/dist/lib/functions/ren.sh +2 -2
  133. package/dist/lib/functions/showhiddenfiles.sh +2 -2
  134. package/dist/lib/functions/size.sh +2 -2
  135. package/dist/lib/functions/stopwatch.sh +2 -2
  136. package/dist/lib/functions/uppercase.sh +2 -2
  137. package/dist/lib/functions/view-source.sh +2 -2
  138. package/dist/lib/functions/vscode.sh +2 -2
  139. package/dist/lib/functions/whoisport.sh +2 -2
  140. package/dist/lib/functions/zipf.sh +2 -2
  141. package/dist/lib/functions.sh +27 -10
  142. package/dist/lib/history.sh +58 -21
  143. package/dist/lib/paths/ant/ant.paths.sh +2 -2
  144. package/dist/lib/paths/default/default.paths.sh +2 -2
  145. package/dist/lib/paths/homebrew/homebrew.paths.sh +2 -2
  146. package/dist/lib/paths/java/java.paths.sh +2 -2
  147. package/dist/lib/paths/maven/maven.paths.sh +2 -2
  148. package/dist/lib/paths/node/node.paths.sh +2 -2
  149. package/dist/lib/paths/nvm/nvm.paths.sh +2 -2
  150. package/dist/lib/paths/pnpm/pnpm.paths.sh +2 -2
  151. package/dist/lib/paths/python/python.paths.sh +2 -2
  152. package/dist/lib/paths/ruby/ruby.paths.sh +2 -2
  153. package/dist/lib/paths/tmux/tmux.paths.sh +2 -2
  154. package/dist/lib/paths.sh +28 -12
  155. package/dist/scripts/backup.sh +2 -2
  156. package/dist/scripts/banner.sh +2 -2
  157. package/dist/scripts/build.sh +2 -2
  158. package/dist/scripts/clean.sh +2 -2
  159. package/dist/scripts/compile.sh +2 -2
  160. package/dist/scripts/copy.sh +2 -2
  161. package/dist/scripts/dotfiles.sh +2 -2
  162. package/dist/scripts/download.sh +2 -2
  163. package/dist/scripts/help.sh +2 -2
  164. package/dist/scripts/ssh.sh +2 -2
  165. package/dist/scripts/unpack.sh +2 -2
  166. package/package.json +6 -5
  167. package/dist/lib/configurations/tmux/vi +0 -9
@@ -1,11 +1,15 @@
1
- <!-- markdownlint-disable MD033 MD041 -->
1
+ <!-- markdownlint-disable MD033 MD041 MD043 -->
2
2
 
3
- <img src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
4
- alt="dotfiles logo" width="261" align="right" />
3
+ <img
4
+ src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
5
+ alt="dotfiles logo"
6
+ width="261"
7
+ align="right"
8
+ />
5
9
 
6
10
  <!-- markdownlint-enable MD033 MD041 -->
7
11
 
8
- # Dotfiles (v0.2.465)
12
+ # Dotfiles (v0.2.468)
9
13
 
10
14
  Simply designed to fit your shell life 🐚
11
15
 
@@ -18,34 +22,33 @@ extract files and directories in various formats on a Unix-based system.
18
22
 
19
23
  The following compression formats are supported:
20
24
 
21
- - 7z
22
- - bzip2
23
- - gzip
24
- - jar
25
- - lz4
26
- - lzma
27
- - lzo
28
- - pigz
29
- - tar
30
- - xz
31
- - zstd
32
- - zip
25
+ * 7z
26
+ * bzip2
27
+ * gzip
28
+ * jar
29
+ * lz4
30
+ * lzma
31
+ * lzo
32
+ * pigz
33
+ * tar
34
+ * xz
35
+ * zstd
36
+ * zip
33
37
 
34
38
  These aliases enable users to compress or extract files and directories
35
- quickly by using simple commands.
39
+ quickly by using simple commands. Here are examples for each operation:
36
40
 
37
- For example:
41
+ * To compress a directory to a 7z file: `compress_7z <archive_name.7z> <directory>`
42
+ * To extract from a 7z file: `extract_7z <archive_name.7z>`
38
43
 
39
- - `c7z` can be used to compress a whole directory (including
40
- subdirectories) to a 7z file.
41
- - `e7z` can be used to extract a whole directory (including
42
- subdirectories) from a 7z file.
44
+ Similar commands apply for all supported formats, ensuring ease of use.
43
45
 
44
- Similarly, there are aliases for compressing and extracting files and
45
- directories in all supported formats.
46
+ **New Features:**
46
47
 
47
- The aliases are designed to be easy to remember and use, and they should
48
- make the compression and extraction process much simpler for users.
48
+ * Defensive coding practices ensure aliases are only defined if the required
49
+ archive programs are present, improving the script's robustness.
50
+ * Enhanced portability with updates to support a wider range of archive formats
51
+ and systems.
49
52
 
50
53
  Please note that some of the compression formats may require additional
51
54
  software to be installed on your system.
@@ -1,154 +1,157 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.465) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
6
- # License: MIT
3
+ ################################################################################
4
+ # 🅳🅾🆃🅵🅸🅻🅴🆂
7
5
  # Script: archives.aliases.sh
8
- # Version: 0.2.465
6
+ # Version: 0.2.468
7
+ # Author: @wwdseb
8
+ # Copyright (c) 2015-2024. All rights reserved
9
+ # Description:
10
+ # This script defines aliases for common archive operations. It provides
11
+ # shortcuts for compressing and extracting various types of archive files.
9
12
  # Website: https://dotfiles.io
13
+ # License: MIT
14
+ ################################################################################
10
15
 
11
16
  # 🅰🆁🅲🅷🅸🆅🅴🆂 🅰🅻🅸🅰🆂🅴🆂
12
- if command -v 7z &>/dev/null; then
13
- # Compress a whole directory (including subdirectories) to a 7z file.
14
- alias c7z='7z a'
15
- # Extract a whole directory (including subdirectories) from a 7z file.
16
- alias e7z='7z x'
17
- fi
18
-
19
- if command -v tar &>/dev/null; then
20
- # Compress a file to a bzip2 file.
21
- alias cbzip2='tar -cvjf'
22
- # Compress a whole directory (including subdirectories) to a tar file.
23
- alias ctar='tar -cvf'
24
- # Extract a whole directory (including subdirectories) from a tar
25
- # file.
26
- alias etar='tar -xvf'
27
- # Compress a file to a gzip file.
28
- alias cgzip='tar -zcvf'
29
- # Compress a whole directory (including subdirectories) to an xz file.
30
- alias cxz='tar -cvJf'
31
- # Extract a file from a bzip2 file.
32
- alias ebzip2='tar -xvjf'
33
- # Extract a file from a gzip file.
34
- alias egzip='tar -xvzf'
35
- # Extract a whole directory (including subdirectories) from an xz
36
- # file.
37
- alias exz='tar -xvJf'
38
- fi
39
-
40
- if command -v jar &>/dev/null; then
41
- # Compress a whole directory (including subdirectories) to a jar file.
42
- alias cjar='jar -cvf'
43
- # Extract a whole directory (including subdirectories) from a jar
44
- # file.
45
- alias ejar='jar -xvf'
46
- fi
47
-
48
- if command -v xz &>/dev/null; then
49
- # Compress a whole directory (including subdirectories) to an xz file.
50
- alias cxz2='xz -zcvf'
51
- # Extract a whole directory (including subdirectories) from an xz
52
- # file.
53
- alias exz2='xz -zxvf'
54
- fi
55
-
56
- if command -v zip &>/dev/null; then
57
- # Compress a whole directory (including subdirectories) to a zip file.
58
- alias czip='zip -r'
59
- # Extract a whole directory (including subdirectories) from a zip
60
- # file.
61
- alias ezip='unzip'
62
- fi
63
-
64
- if command -v zstd &>/dev/null; then
65
- # Compress a whole directory (including subdirectories) to a zstd file.
66
- alias czstd='zstd -zcvf'
67
- # Extract a whole directory (including subdirectories) from a zstd
68
- # file.
69
- alias ezstd='zstd -zxvf'
70
- fi
71
-
72
- # Compress a file to a lzma file.
73
- if command -v xz &>/dev/null; then
74
- alias clzma='xz -zcvf'
75
- alias elzma='xz -zxvf'
76
- fi
77
-
78
- # Compress a file to a z file.
79
- if command -v gzip &>/dev/null; then
80
- alias czlib='gzip -cv'
81
- alias ezlib='gzip -dv'
82
- fi
83
-
84
- # Compress a file to a bz2 file.
85
- if command -v bzip2 &>/dev/null; then
86
- alias cbz2='bzip2 -zkvf'
87
- alias ebz2='bzip2 -dkvf'
88
- fi
89
-
90
- # Compress a file to a lzo file.
91
- if command -v lzop &>/dev/null; then
92
- alias clzo='lzop -cv'
93
- alias elzo='lzop -dv'
94
- fi
95
-
96
- # Compress a file to a lz4 file.
97
- if command -v lz4 &>/dev/null; then
98
- alias clz4='lz4 -zcv'
99
- alias elz4='lz4 -dcv'
100
- fi
101
-
102
- # Compress a file to a zst file.
103
- if command -v zstd &>/dev/null; then
104
- alias czst='zstd -zcv'
105
- alias ezst='zstd -dcv'
106
- fi
107
-
108
- # Compress a file to a pigz file.
109
- if command -v pigz &>/dev/null; then
110
- alias cpgz='pigz -zkvf'
111
- alias epgz='pigz -dkvf'
112
- fi
113
17
 
114
- # Compress a whole directory (including subdirectories) to a tar.bz2
115
- # file.
116
- if command -v tar &>/dev/null && command -v bzip2 &>/dev/null; then
117
- alias ctbz2='tar -cvjf'
118
- alias etbz2='tar -xvjf'
18
+ ## Check for existence of archive programs
19
+ if type 7z &> /dev/null; then
20
+ alias compress_7z='7z a'
21
+ alias extract_7z='7z x'
119
22
  fi
120
23
 
121
- # Compress a whole directory (including subdirectories) to a tar.lzma
122
- # file.
123
- if command -v tar &>/dev/null && command -v xz &>/dev/null; then
124
- alias ctlzma='tar --lzma -cvf'
125
- alias etlzma='tar --lzma -xvf'
126
- fi
127
-
128
- # Compress a whole directory (including subdirectories) to a tar.gz
129
- # file.
130
- if command -v tar &>/dev/null && command -v gzip &>/dev/null; then
131
- alias ctgz='tar -zcvf'
132
- alias etgz='tar -zxvf'
133
- fi
134
-
135
- # Compress a whole directory (including subdirectories) to a tar.lzo
136
- # file.
137
- if command -v tar &>/dev/null && command -v lzop &>/dev/null; then
138
- alias ctlzo='tar --lzip -cvf'
139
- alias etlzo='tar --lzip -xvf'
140
- fi
141
-
142
- # Compress a whole directory (including subdirectories) to a tar.zst
143
- # file.
144
- if command -v tar &>/dev/null && command -v zstd &>/dev/null; then
145
- alias ctzst='tar --zstd -cvf'
146
- alias etzst='tar --zstd -xvf'
147
- fi
148
-
149
- # Compress a whole directory (including subdirectories) to a tar.pgz
150
- # file.
151
- if command -v tar &>/dev/null && command -v pigz &>/dev/null; then
152
- alias ctpgz='tar --use-compress-program=pigz -cvf'
153
- alias etpgz='tar --use-compress-program=pigz -xvf'
154
- fi
24
+ if type tar &> /dev/null; then
25
+ alias compress_tar='tar -cvf'
26
+ alias extract_tar='tar -xvf'
27
+ alias compress_tar_gzip='tar -zcvf'
28
+ alias extract_tar_gzip='tar -zxvf'
29
+ alias compress_tar_bzip2='tar -cvjf'
30
+ alias extract_tar_bzip2='tar -xvjf'
31
+ fi
32
+
33
+ if type jar &> /dev/null; then
34
+ alias compress_jar='jar -cvf'
35
+ alias extract_jar='jar -xvf'
36
+ fi
37
+
38
+ if type xz &> /dev/null; then
39
+ alias compress_xz='tar -cvJf'
40
+ alias extract_xz='tar -xvJf'
41
+ fi
42
+
43
+ if type zip &> /dev/null; then
44
+ alias compress_zip='zip -r'
45
+ alias extract_zip='unzip'
46
+ fi
47
+
48
+ if type zstd &> /dev/null; then
49
+ alias compress_zstd='zstd -zcvf'
50
+ alias extract_zstd='zstd -zxvf'
51
+ fi
52
+
53
+ if type gzip &> /dev/null; then
54
+ alias compress_gzip='gzip -cv'
55
+ alias extract_gzip='gzip -dv'
56
+ fi
57
+
58
+ if type bzip2 &> /dev/null; then
59
+ alias compress_bzip2='bzip2 -zkvf'
60
+ alias extract_bzip2='bzip2 -dkvf'
61
+ fi
62
+
63
+ if type lzop &> /dev/null; then
64
+ alias compress_lzop='lzop -cv'
65
+ alias extract_lzop='lzop -dv'
66
+ fi
67
+
68
+ if type lz4 &> /dev/null; then
69
+ alias compress_lz4='lz4 -zcv'
70
+ alias extract_lz4='lz4 -dcv'
71
+ fi
72
+
73
+ if type pigz &> /dev/null; then
74
+ alias compress_pigz='pigz -zkvf'
75
+ alias extract_pigz='pigz -dkvf'
76
+ fi
77
+
78
+ # 🅳🅴🅵🅴🅽🆂🅸🆅🅴 🅲🅾🅳🅸🅽🅶
79
+
80
+ # Ensure valid arguments are passed
81
+ function compress_file() {
82
+ local archive_type="$1"
83
+ case "${archive_type}" in
84
+ 7z|tar|jar|xz|zip|zstd|gzip|bzip2|lzop|lz4|pigz)
85
+ alias "compress_${archive_type}" "${archive_type} -cvf"
86
+ ;;
87
+ *)
88
+ echo "Unsupported archive type: ${archive_type}"
89
+ return 1
90
+ ;;
91
+ esac
92
+ }
93
+
94
+ function extract_file() {
95
+ local archive_type="$1"
96
+ case "${archive_type}" in
97
+ 7z|tar|jar|xz|zip|zstd|gzip|bzip2|lzop|lz4|pigz)
98
+ alias "extract_${archive_type}" "${archive_type} -xvf"
99
+ ;;
100
+ *)
101
+ echo "Unsupported archive type: ${archive_type}"
102
+ return 1
103
+ ;;
104
+ esac
105
+ }
106
+
107
+ # Handle large files by piping outputs
108
+ function compress_large_file() {
109
+ local archive_type="$1"
110
+ case "${archive_type}" in
111
+ 7z|tar|jar|xz|zip|zstd|gzip|bzip2|lzop|lz4|pigz)
112
+ alias "compress_${archive_type}" "${archive_type} -cvf -"
113
+ ;;
114
+ *)
115
+ echo "Unsupported archive type: ${archive_type}"
116
+ return 1
117
+ ;;
118
+ esac
119
+ }
120
+
121
+ function extract_large_file() {
122
+ local archive_type="$1"
123
+ case "${archive_type}" in
124
+ 7z|tar|jar|xz|zip|zstd|gzip|bzip2|lzop|lz4|pigz)
125
+ alias "extract_${archive_type}" "${archive_type} -xvf -"
126
+ ;;
127
+ *)
128
+ echo "Unsupported archive type: ${archive_type}"
129
+ return 1
130
+ ;;
131
+ esac
132
+ }
133
+
134
+ # 🅿🅾🆁🆃🅰🅱🅸🅻🅸🆃🆈
135
+
136
+ function set_alias() {
137
+ local program="$1"
138
+ local flags="$2"
139
+ # shellcheck disable=SC2250,SC2139
140
+ alias "compress_$program"="${program} ${flags}"
141
+
142
+ }
143
+
144
+ # Set better defaults in case archive programs are missing
145
+ set_alias compress_bz2 bzip2 '-zkvf'
146
+ set_alias compress_lz4 lz4 '-zcv'
147
+ set_alias compress_lzma xz '-zcvf'
148
+ set_alias compress_lzo lzop '-cv'
149
+ set_alias compress_pgz pigz '-zkvf'
150
+ set_alias compress_tbz2 tar '-cvjf'
151
+ set_alias compress_tgz tar '--use-compress-program=pigz -cvf'
152
+ set_alias compress_tgz tar '-zcvf'
153
+ set_alias compress_tlzo tar '--lzip -cvf'
154
+ set_alias compress_txz tar '-cvJf'
155
+ set_alias compress_tzst tar '--zstd -cvf'
156
+ set_alias compress_zlib gzip '-cv'
157
+ set_alias compress_zstd zstd '-zcvf'
@@ -1,63 +1,65 @@
1
- <!-- markdownlint-disable MD033 MD041 -->
1
+ <!-- markdownlint-disable MD033 MD041 MD043 -->
2
2
 
3
- <img src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
4
- alt="dotfiles logo" width="261" align="right" />
3
+ <img
4
+ src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
5
+ alt="dotfiles logo"
6
+ width="261"
7
+ align="right"
8
+ />
5
9
 
6
10
  <!-- markdownlint-enable MD033 MD041 -->
7
11
 
8
- # Dotfiles (v0.2.465)
12
+ # Dotfiles (v0.2.468)
9
13
 
10
- Simply designed to fit your shell life 🐚
14
+ Designed to seamlessly enhance your shell environment 🐚
11
15
 
12
16
  ![Dotfiles banner][banner]
13
17
 
14
18
  ## 🅲🅳 🅰🅻🅸🅰🆂🅴🆂
15
19
 
16
- These aliases provide shortcuts for the cd command to help you quickly
17
- navigate your file system. To use them, add the following lines to your
18
- .bashrc or .bash_profile file.
20
+ This set of `cd` command aliases provides an intuitive and efficient way to
21
+ navigate your filesystem. Incorporating dynamic error handling, optional
22
+ directory listing, and customization for an improved command-line experience.
19
23
 
20
- ### Navigation
24
+ ### Setup
21
25
 
22
- - `-`: Go to previous directory.
23
- - `.., ..., ...., .....`: Go up one, two, three, or four directories,
24
- respectively.
25
- - `~`: Go to home directory.
26
+ To use these aliases, integrate the script into your `.bashrc` or `.bash_profile`.
26
27
 
27
- ### Directories
28
+ ### Navigation Shortcuts
28
29
 
29
- - `app`: Go to the Applications directory and list its contents.
30
- - `cod`: Go to the Code directory and list its contents.
31
- - `des`: Go to the Desktop directory and list its contents.
32
- - `doc`: Go to the Documents directory and list its contents.
33
- - `dot`: Go to the .dotfiles directory and list its contents.
34
- - `dow`: Go to the Downloads directory and list its contents.
35
- - `hom`: Go to the home directory and list its contents.
36
- - `mus`: Go to the Music directory and list its contents.
37
- - `pic`: Go to the Pictures directory and list its contents.
38
- - `vid`: Go to the Videos directory and list its contents.
30
+ * `-`: Go to the previous directory.
31
+ * `..`, `...`, `....`, `.....`: Ascend one to four levels in the directory tree.
32
+ * `~`: Navigate to the home directory.
33
+
34
+ ### Custom Directory Access
35
+
36
+ Leverage aliases for quick access to frequently visited directories:
37
+
38
+ * `app`: Applications directory
39
+ * `cod`: Code directory
40
+ * `des`: Desktop directory
41
+ * `doc`: Documents directory
42
+ * `dot`: Dotfiles directory
43
+ * `dow`: Downloads directory
44
+ * `mus`: Music directory
45
+ * `pic`: Pictures directory
46
+ * `vid`: Videos directory
39
47
 
40
48
  ### System Directories
41
49
 
42
- - `etc`: Go to the etc directory and list its contents.
43
- - `var`: Go to the var directory and list its contents.
44
- - `tmp`: Go to the tmp directory and list its contents.
45
-
46
- ### Frequently used directories
47
-
48
- - `app`: Shortcut to go to the Applications directory and list its
49
- contents.
50
- - `cod`: Shortcut to go to the Code directory and list its contents.
51
- - `des`: Shortcut to go to the Desktop directory and list its contents.
52
- - `doc`: Shortcut to go to the Documents directory and list its
53
- contents.
54
- - `dot`: Shortcut to go to the .dotfiles directory and list its
55
- contents.
56
- - `dow`: Shortcut to go to the Downloads directory and list its
57
- contents.
58
- - `hom`: Shortcut to go to the home directory and list its contents.
59
- - `mus`: Shortcut to go to the Music directory and list its contents.
60
- - `pic`: Shortcut to go to the Pictures directory and list its contents.
61
- - `vid`: Shortcut to go to the Videos directory and list its contents.
50
+ Quickly access system directories:
51
+
52
+ * `etc`: System configuration (`/etc`)
53
+ * `var`: Variable files (`/var`)
54
+ * `tmp`: Temporary files (`/tmp`)
55
+
56
+ ### Enhanced Customization
57
+
58
+ Customize directory paths through environment variables to suit your system's
59
+ structure and preferences. Use concise aliases (`app`, `cod`, `des`, etc.) for
60
+ efficient navigation.
61
+
62
+ For a detailed guide on configuring and using these aliases, plus additional
63
+ information on each command, visit our [documentation](https://dotfiles.io).
62
64
 
63
65
  [banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
@@ -1,39 +1,73 @@
1
1
  #!/usr/bin/env bash
2
+
3
+ ################################################################################
4
+ # 🅳🅾🆃🅵🅸🅻🅴🆂
2
5
  # Author: Sebastien Rousseau
3
- # Copyright (c) 2015-2023. All rights reserved
4
- # Description: Sets aliases for the `cd` command.
6
+ # Copyright: 2015-2024. All rights reserved
7
+ # Description: Enhanced `cd` command aliases with checks, functions, and customization.
5
8
  # License: MIT
6
9
  # Script: cd.aliases.sh
7
- # Version: 0.2.465
10
+ # Version: 0.2.468
8
11
  # Website: https://dotfiles.io
9
12
 
10
- # 🅲🅳 🅰🅻🅸🅰🆂🅴🆂
13
+ # Usage:
14
+ # Customize directory paths via variables and use aliases to navigate.
15
+ # Example: `cod` to go to the Code directory, `..` to go up one directory.
11
16
 
12
- # Shortcut to go to previous directory
13
- alias -- -='cd -'
17
+ # Configuration
18
+ DOC_DIR="${HOME}/Documents"
19
+ VID_DIR="${HOME}/Videos"
20
+ # Add more configurable paths here
21
+
22
+ # Check if directory exists and change to it, listing contents optionally
23
+ change_directory() {
24
+ local path="$1"
14
25
 
15
- # Shortcuts to go to parent directories
16
- alias .....='cd ../../../../'
17
- alias ....='cd ../../'
18
- alias ...='cd ../'
26
+ if [[ -d "${path}" ]]; then
27
+ cd "${path}" || exit # Exit if cd fails
28
+ else
29
+ echo "Directory '${path}' does not exist."
30
+ fi
31
+ }
32
+
33
+ # Parent Directory Shortcuts
34
+ alias -- -='cd -'
19
35
  alias ..='cd ..'
36
+ alias ...='cd ../..'
37
+ alias ....='cd ../../..'
38
+ alias .....='cd ../../../..'
39
+
40
+ # Home Directory Shortcut
41
+ alias hom='change_directory "${HOME}" true'
42
+
43
+ # Frequently Used Directories
44
+ alias doc='change_directory "$DOC_DIR" true' # Documents
45
+ alias vid='change_directory "$VID_DIR" true' # Videos
46
+ # Define more aliases like the above for other directories
47
+
48
+ # System Directories (consider checks for system-specific paths)
49
+ alias etc='change_directory "/etc" true'
50
+ alias var='change_directory "/var" true'
51
+ alias tmp='change_directory "/tmp" true'
52
+
53
+ # Frequently Used Directories with Improved Error Handling and Customization
54
+ APP_DIR="${HOME}/Applications"
55
+ CODE_DIR="${HOME}/Code"
56
+ DESK_DIR="${HOME}/Desktop"
57
+ DOCS_DIR="${HOME}/Documents"
58
+ DOTF_DIR="${HOME}/.dotfiles"
59
+ DOWN_DIR="${HOME}/Downloads"
60
+ MUSIC_DIR="${HOME}/Music"
61
+ PICS_DIR="${HOME}/Pictures"
62
+ VIDS_DIR="${HOME}/Videos"
20
63
 
21
- # Shortcuts to go to specific directories
22
- alias '~'='cd ~'
23
-
24
- # Shortcuts to go to frequently used directories
25
- alias app='cd "${HOME}/Applications"; ls' # app: Shortcut to go to the Applications directory and list its contents.
26
- alias cod='cd "${HOME}/Code"; ls' # cod: Shortcut to go to the Code directory and list its contents.
27
- alias des='cd "${HOME}/Desktop"; ls' # des: Shortcut to go to the Desktop directory and list its contents.
28
- alias doc='cd "${HOME}/Documents"; ls' # doc: Shortcut to go to the Documents directory and list its contents.
29
- alias dot='cd "${HOME}/.dotfiles"; ls' # dot: Shortcut to go to the .dotfiles directory and list its contents.
30
- alias dow='cd "${HOME}/Downloads"; ls' # dow: Shortcut to go to the Downloads directory and list its contents.
31
- alias hom='cd "${HOME}"; ls' # hom: Shortcut to go to the home directory and list its contents.
32
- alias mus='cd "${HOME}/Music"; ls' # mus: Shortcut to go to the Music directory and list its contents.
33
- alias pic='cd "${HOME}/Pictures"; ls' # pic: Shortcut to go to the Pictures directory and list its contents.
34
- alias vid='cd "${HOME}/Videos"; ls' # vid: Shortcut to go to the Videos directory and list its contents.
35
-
36
- # Shortcuts to navigate to system directories
37
- alias etc='cd /etc; ls' # etc: Shortcut to go to the etc directory and list its contents.
38
- alias var='cd /var; ls' # var: Shortcut to go to the var directory and list its contents.
39
- alias tmp='cd /tmp; ls' # tmp: Shortcut to go to the tmp directory and list its contents.
64
+ # Define functions for each alias with checks and optional ls
65
+ alias app='change_directory "$APP_DIR" true' # Applications
66
+ alias cod='change_directory "$CODE_DIR" true' # Code
67
+ alias des='change_directory "$DESK_DIR" true' # Desktop
68
+ alias doc='change_directory "$DOCS_DIR" true' # Documents
69
+ alias dot='change_directory "$DOTF_DIR" true' # Dotfiles
70
+ alias dow='change_directory "$DOWN_DIR" true' # Downloads
71
+ alias mus='change_directory "$MUSIC_DIR" true' # Music
72
+ alias pic='change_directory "$PICS_DIR" true' # Pictures
73
+ alias vid='change_directory "$VIDS_DIR" true' # Videos
@@ -1,11 +1,15 @@
1
- <!-- markdownlint-disable MD033 MD041 -->
1
+ <!-- markdownlint-disable MD033 MD041 MD043 -->
2
2
 
3
- <img src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
4
- alt="dotfiles logo" width="261" align="right" />
3
+ <img
4
+ src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
5
+ alt="dotfiles logo"
6
+ width="261"
7
+ align="right"
8
+ />
5
9
 
6
10
  <!-- markdownlint-enable MD033 MD041 -->
7
11
 
8
- # Dotfiles (v0.2.465)
12
+ # Dotfiles (v0.2.468)
9
13
 
10
14
  Simply designed to fit your shell life 🐚
11
15