@sebastienrousseau/dotfiles 0.2.466 → 0.2.469

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 (184) hide show
  1. package/README.md +19 -15
  2. package/dist/Makefile +126 -43
  3. package/dist/bin/backup.js.map +1 -1
  4. package/dist/bin/constants.d.ts +2 -2
  5. package/dist/bin/constants.d.ts.map +1 -1
  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 +161 -161
  18. package/dist/lib/README.md +83 -5
  19. package/dist/lib/aliases/README.md +49 -43
  20. package/dist/lib/aliases/archives/README.md +126 -37
  21. package/dist/lib/aliases/archives/archives.aliases.sh +112 -152
  22. package/dist/lib/aliases/cd/README.md +138 -55
  23. package/dist/lib/aliases/cd/cd.aliases.sh +45 -33
  24. package/dist/lib/aliases/chmod/README.md +151 -96
  25. package/dist/lib/aliases/chmod/chmod.aliases.sh +103 -69
  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 +53 -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 +4 -4
  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 +4 -4
  38. package/dist/lib/aliases/find/README.md +8 -4
  39. package/dist/lib/aliases/find/find.aliases.sh +4 -4
  40. package/dist/lib/aliases/gcloud/README.md +8 -4
  41. package/dist/lib/aliases/gcloud/gcloud.aliases.sh +4 -4
  42. package/dist/lib/aliases/git/README.md +8 -4
  43. package/dist/lib/aliases/git/git.aliases.sh +3 -3
  44. package/dist/lib/aliases/gnu/README.md +8 -4
  45. package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +2 -2
  46. package/dist/lib/aliases/heroku/README.md +8 -4
  47. package/dist/lib/aliases/heroku/heroku.aliases.sh +3 -3
  48. package/dist/lib/aliases/interactive/README.md +29 -17
  49. package/dist/lib/aliases/interactive/interactive.aliases.sh +15 -18
  50. package/dist/lib/aliases/list/README.md +118 -25
  51. package/dist/lib/aliases/list/list.aliases.sh +130 -84
  52. package/dist/lib/aliases/macOS/README.md +8 -4
  53. package/dist/lib/aliases/macOS/macos.aliases.sh +3 -3
  54. package/dist/lib/aliases/make/README.md +8 -4
  55. package/dist/lib/aliases/make/make.aliases.sh +3 -3
  56. package/dist/lib/aliases/mkdir/README.md +8 -4
  57. package/dist/lib/aliases/mkdir/mkdir.aliases.sh +3 -3
  58. package/dist/lib/aliases/npm/README.md +8 -4
  59. package/dist/lib/aliases/npm/npm.aliases.sh +3 -3
  60. package/dist/lib/aliases/permission/README.md +8 -4
  61. package/dist/lib/aliases/permission/permission.aliases.sh +3 -3
  62. package/dist/lib/aliases/pnpm/README.md +8 -4
  63. package/dist/lib/aliases/pnpm/pnpm.aliases.sh +3 -3
  64. package/dist/lib/aliases/ps/README.md +8 -4
  65. package/dist/lib/aliases/ps/ps.aliases.sh +3 -3
  66. package/dist/lib/aliases/python/python.aliases.sh +141 -0
  67. package/dist/lib/aliases/rsync/README.md +8 -4
  68. package/dist/lib/aliases/rsync/rsync.aliases.sh +3 -3
  69. package/dist/lib/aliases/rust/README.md +171 -46
  70. package/dist/lib/aliases/rust/rust.aliases.sh +109 -117
  71. package/dist/lib/aliases/subversion/README.md +8 -4
  72. package/dist/lib/aliases/subversion/subversion.aliases.sh +3 -3
  73. package/dist/lib/aliases/sudo/README.md +8 -4
  74. package/dist/lib/aliases/sudo/sudo.aliases.sh +3 -3
  75. package/dist/lib/aliases/tmux/README.md +8 -4
  76. package/dist/lib/aliases/tmux/tmux.aliases.sh +3 -3
  77. package/dist/lib/aliases/update/README.md +8 -4
  78. package/dist/lib/aliases/update/update.aliases.sh +307 -66
  79. package/dist/lib/aliases/uuid/README.md +8 -4
  80. package/dist/lib/aliases/uuid/uuid.aliases.sh +3 -3
  81. package/dist/lib/aliases/wget/README.md +8 -4
  82. package/dist/lib/aliases/wget/wget.aliases.sh +3 -3
  83. package/dist/lib/aliases.sh +42 -12
  84. package/dist/lib/configurations/README.md +8 -4
  85. package/dist/lib/configurations/bash/bashrc +163 -35
  86. package/dist/lib/configurations/curl/curlrc +3 -6
  87. package/dist/lib/configurations/default/color.sh +3 -3
  88. package/dist/lib/configurations/default/constants.sh +4 -4
  89. package/dist/lib/configurations/default/editor.sh +3 -3
  90. package/dist/lib/configurations/default/prompt.sh +20 -11
  91. package/dist/lib/configurations/input/inputrc +3 -3
  92. package/dist/lib/configurations/nano/nanorc +3 -3
  93. package/dist/lib/configurations/profile/profile +3 -3
  94. package/dist/lib/configurations/prompt/prompt.sh +81 -0
  95. package/dist/lib/configurations/tmux/default +3 -3
  96. package/dist/lib/configurations/tmux/display +3 -3
  97. package/dist/lib/configurations/tmux/linux +3 -3
  98. package/dist/lib/configurations/tmux/navigation +3 -3
  99. package/dist/lib/configurations/tmux/panes +3 -3
  100. package/dist/lib/configurations/tmux/theme +4 -4
  101. package/dist/lib/configurations/tmux/tmux +3 -3
  102. package/dist/lib/configurations/vim/vimrc +191 -71
  103. package/dist/lib/configurations/wget/wgetrc +3 -3
  104. package/dist/lib/configurations/zsh/zshrc +11 -12
  105. package/dist/lib/configurations.sh +39 -9
  106. package/dist/lib/functions/README.md +73 -55
  107. package/dist/lib/functions/apihealth.sh +277 -0
  108. package/dist/lib/functions/apilatency.sh +157 -0
  109. package/dist/lib/functions/apiload.sh +165 -0
  110. package/dist/lib/functions/backup.sh +143 -0
  111. package/dist/lib/functions/cdls.sh +52 -6
  112. package/dist/lib/functions/curlheader.sh +66 -10
  113. package/dist/lib/functions/curlstatus.sh +64 -7
  114. package/dist/lib/functions/curltime.sh +56 -14
  115. package/dist/lib/functions/encode64.sh +87 -7
  116. package/dist/lib/functions/environment.sh +65 -25
  117. package/dist/lib/functions/extract.sh +79 -27
  118. package/dist/lib/functions/freespace.sh +55 -9
  119. package/dist/lib/functions/genpwd.sh +93 -29
  120. package/dist/lib/functions/goto.sh +59 -8
  121. package/dist/lib/functions/hexdump.sh +96 -0
  122. package/dist/lib/functions/hiddenfiles.sh +77 -0
  123. package/dist/lib/functions/hostinfo.sh +92 -21
  124. package/dist/lib/functions/hstats.sh +69 -5
  125. package/dist/lib/functions/httpdebug.sh +109 -5
  126. package/dist/lib/functions/kebabcase.sh +61 -0
  127. package/dist/lib/functions/keygen.sh +188 -25
  128. package/dist/lib/functions/last.sh +106 -5
  129. package/dist/lib/functions/logout.sh +114 -6
  130. package/dist/lib/functions/lowercase.sh +49 -17
  131. package/dist/lib/functions/matrix.sh +205 -30
  132. package/dist/lib/functions/mount_read_only.sh +3 -3
  133. package/dist/lib/functions/myproc.sh +3 -3
  134. package/dist/lib/functions/prependpath.sh +3 -3
  135. package/dist/lib/functions/ql.sh +3 -3
  136. package/dist/lib/functions/rd.sh +3 -3
  137. package/dist/lib/functions/remove_disk.sh +3 -3
  138. package/dist/lib/functions/ren.sh +68 -8
  139. package/dist/lib/functions/sentencecase.sh +63 -0
  140. package/dist/lib/functions/showhiddenfiles.sh +3 -3
  141. package/dist/lib/functions/size.sh +6 -5
  142. package/dist/lib/functions/snakecase.sh +61 -0
  143. package/dist/lib/functions/stopwatch.sh +3 -3
  144. package/dist/lib/functions/sysinfo.sh +145 -0
  145. package/dist/lib/functions/titlecase.sh +65 -0
  146. package/dist/lib/functions/uppercase.sh +51 -19
  147. package/dist/lib/functions/view-source.sh +3 -3
  148. package/dist/lib/functions/vscode.sh +3 -3
  149. package/dist/lib/functions/whoisport.sh +3 -3
  150. package/dist/lib/functions/zipf.sh +3 -3
  151. package/dist/lib/functions.sh +41 -10
  152. package/dist/lib/history.sh +68 -83
  153. package/dist/lib/paths/README.md +52 -0
  154. package/dist/lib/paths/custom.paths.sh +40 -0
  155. package/dist/lib/paths/default.paths.sh +37 -0
  156. package/dist/lib/paths.sh +40 -11
  157. package/dist/scripts/backup.sh +3 -3
  158. package/dist/scripts/banner.sh +3 -3
  159. package/dist/scripts/build.sh +3 -3
  160. package/dist/scripts/clean.sh +3 -3
  161. package/dist/scripts/compile.sh +3 -3
  162. package/dist/scripts/copy.sh +3 -3
  163. package/dist/scripts/dotfiles.sh +3 -3
  164. package/dist/scripts/download.sh +3 -3
  165. package/dist/scripts/help.sh +3 -3
  166. package/dist/scripts/ssh.sh +3 -3
  167. package/dist/scripts/unpack.sh +3 -3
  168. package/package.json +10 -9
  169. package/dist/lib/aliases/jekyll/README.md +0 -37
  170. package/dist/lib/aliases/jekyll/jekyll.aliases.sh +0 -54
  171. package/dist/lib/configurations/tmux/vi +0 -9
  172. package/dist/lib/functions/filehead.sh +0 -4
  173. package/dist/lib/functions/hidehiddenfiles.sh +0 -14
  174. package/dist/lib/paths/ant/ant.paths.sh +0 -15
  175. package/dist/lib/paths/default/default.paths.sh +0 -19
  176. package/dist/lib/paths/homebrew/homebrew.paths.sh +0 -27
  177. package/dist/lib/paths/java/java.paths.sh +0 -19
  178. package/dist/lib/paths/maven/maven.paths.sh +0 -18
  179. package/dist/lib/paths/node/node.paths.sh +0 -15
  180. package/dist/lib/paths/nvm/nvm.paths.sh +0 -23
  181. package/dist/lib/paths/pnpm/pnpm.paths.sh +0 -15
  182. package/dist/lib/paths/python/python.paths.sh +0 -36
  183. package/dist/lib/paths/ruby/ruby.paths.sh +0 -25
  184. package/dist/lib/paths/tmux/tmux.paths.sh +0 -12
@@ -1,11 +1,112 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ ################################################################################
4
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 - Recently Modified Files Viewer (last)
5
+ # Made with ♥ by Sebastien Rousseau
6
6
  # License: MIT
7
+ #
8
+ # Description:
9
+ # last is a utility function to list recently modified files within a
10
+ # specified time range. By default, it lists files modified in the last 60
11
+ # minutes but allows customization.
12
+ #
13
+ # Usage:
14
+ # last [minutes]
15
+ # last --help
16
+ #
17
+ # Arguments:
18
+ # minutes Number of minutes to look back for modified files (default: 60)
19
+ # Maximum: 7 days (10080 minutes)
20
+ # --help Displays this help menu and exits
21
+ #
22
+ ################################################################################
23
+
24
+ log_info() {
25
+ echo "[INFO] $*"
26
+ }
27
+
28
+ log_error() {
29
+ echo "[ERROR] $*" >&2
30
+ exit 1
31
+ }
32
+
33
+ detect_tool() {
34
+ if command -v /usr/bin/find &>/dev/null; then
35
+ echo "find"
36
+ elif command -v fd &>/dev/null; then
37
+ echo "fd"
38
+ elif command -v rg &>/dev/null; then
39
+ echo "rg"
40
+ else
41
+ log_error "No compatible tools found (find, fd, or rg)."
42
+ fi
43
+ }
7
44
 
8
- # last: List the modified files within 60 minutes.
9
45
  last() {
10
- find . -type f -mmin -60
46
+ # Display help menu
47
+ if [[ "$1" == "--help" ]]; then
48
+ cat << 'EOH'
49
+ 🅳🅾🆃🅵🅸🅻🅴🆂 - Recently Modified Files Viewer
50
+
51
+ Description:
52
+ last is a utility function to list recently modified files within a specified
53
+ time range. By default, it lists files modified in the last 60 minutes.
54
+
55
+ Usage:
56
+ last [minutes]
57
+ last --help
58
+
59
+ Arguments:
60
+ minutes Number of minutes to look back for modified files (default: 60)
61
+ Maximum: 7 days (10080 minutes)
62
+ --help Displays this help menu and exits
63
+
64
+ Examples:
65
+ last
66
+ # Lists files modified within the last 60 minutes
67
+ last 120
68
+ # Lists files modified within the last 120 minutes
69
+
70
+ Notes:
71
+ - Only regular files are shown
72
+ - Symbolic links and directories are excluded from the results
73
+ - Searches recursively starting from the current directory
74
+ - Maximum time range is 7 days (10080 minutes)
75
+ EOH
76
+ return 0
77
+ fi
78
+
79
+ # Default time range (60 minutes)
80
+ local minutes=${1:-60}
81
+
82
+ # Validate that the input is a positive integer
83
+ if ! [[ "$minutes" =~ ^[0-9]+$ ]]; then
84
+ log_error "Invalid input: '$minutes'. Please provide a positive integer for minutes."
85
+ fi
86
+
87
+ # Check maximum time range (7 days = 10080 minutes)
88
+ if ((minutes > 10080)); then
89
+ log_error "Time range too large. Maximum is 7 days (10080 minutes)."
90
+ fi
91
+
92
+ # Detect which tool to use
93
+ local tool
94
+ tool=$(detect_tool)
95
+
96
+ # Find and list modified files
97
+ log_info "Listing files modified in the last ${minutes} minutes (using $tool):"
98
+ case "$tool" in
99
+ "find")
100
+ /usr/bin/find . -type f -mmin -"${minutes}"
101
+ ;;
102
+ "fd")
103
+ fd --type file --changed-within "${minutes}m"
104
+ ;;
105
+ "rg")
106
+ rg --type file --changed-within "${minutes}m"
107
+ ;;
108
+ *)
109
+ log_error "Unknown tool detected."
110
+ ;;
111
+ esac
11
112
  }
@@ -1,12 +1,120 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ ################################################################################
4
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 - Cross-Platform Logout Utility (logout)
5
+ # Made with ♥ by Sebastien Rousseau
6
6
  # License: MIT
7
+ #
8
+ # Description:
9
+ # logout is a utility function to log out from macOS, Linux, or Windows via
10
+ # the terminal. It provides options for confirmation and forceful logout if
11
+ # necessary.
12
+ #
13
+ # Usage:
14
+ # logout [--force] [--help]
15
+ #
16
+ # Arguments:
17
+ # --force Skips confirmation and forces logout.
18
+ # --help Displays this help menu and exits.
19
+ #
20
+ ################################################################################
21
+
22
+ log_info() {
23
+ echo "[INFO] $*"
24
+ }
25
+
26
+ log_warning() {
27
+ echo "[WARNING] $*" >&2
28
+ }
29
+
30
+ log_error() {
31
+ echo "[ERROR] $*" >&2
32
+ exit 1
33
+ }
7
34
 
8
- # logout: Function to logout from OS X via the Terminal
9
35
  logout() {
10
- osascript -e 'tell application "System Events" to log out'
11
- builtin logout
36
+ # Display help menu
37
+ if [[ "$1" == "--help" ]]; then
38
+ cat << 'EOH'
39
+ Cross-Platform Logout Utility (logout)
40
+
41
+ Description:
42
+ logout is a utility function to log out from macOS, Linux, or Windows via the
43
+ terminal. It provides options for confirmation and forceful logout if
44
+ necessary.
45
+
46
+ Usage:
47
+ logout [--force] [--help]
48
+
49
+ Arguments:
50
+ --force Skips confirmation and forces logout.
51
+ --help Displays this help menu and exits.
52
+
53
+ Examples:
54
+ logout
55
+ # Prompts for confirmation before logging out.
56
+
57
+ logout --force
58
+ # Logs out immediately without confirmation.
59
+
60
+ Notes:
61
+ - Requires administrative privileges for some systems (Linux/Windows).
62
+ - May prompt for a password depending on system settings.
63
+ EOH
64
+ return 0
65
+ fi
66
+
67
+ # Check if the user passed --force
68
+ local force=false
69
+ if [[ "$1" == "--force" ]]; then
70
+ force=true
71
+ fi
72
+
73
+ # Prompt for confirmation if not forced
74
+ if [[ "$force" == false ]]; then
75
+ echo "Are you sure you want to log out? (y/n):"
76
+ read -r response
77
+ case "$response" in
78
+ [Yy]*)
79
+ ;;
80
+ *)
81
+ log_info "Logout canceled."
82
+ return 0
83
+ ;;
84
+ esac
85
+ fi
86
+
87
+ # Detect operating system
88
+ local os
89
+ os=$(uname | tr '[:upper:]' '[:lower:]')
90
+
91
+ case "$os" in
92
+ "darwin")
93
+ log_info "Logging out from macOS..."
94
+ if ! osascript -e 'tell application "System Events" to log out'; then
95
+ log_error "Failed to log out using AppleScript. Try logging out manually."
96
+ fi
97
+ ;;
98
+ "linux")
99
+ log_info "Logging out from Linux..."
100
+ if command -v gnome-session-quit &>/dev/null; then
101
+ gnome-session-quit --logout --no-prompt
102
+ elif command -v loginctl &>/dev/null; then
103
+ loginctl terminate-user "$USER"
104
+ else
105
+ log_error "Unable to determine logout method for your Linux system. Try logging out manually."
106
+ fi
107
+ ;;
108
+ "msys" | "cygwin" | "mingw"*)
109
+ log_info "Logging out from Windows..."
110
+ if ! shutdown /l; then
111
+ log_error "Failed to log out from Windows. Try logging out manually."
112
+ fi
113
+ ;;
114
+ *)
115
+ log_error "Unsupported operating system: $os"
116
+ ;;
117
+ esac
118
+
119
+ return 0
12
120
  }
@@ -1,29 +1,61 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ ################################################################################
4
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 - Cross-Platform Lowercase Utility (lowercase)
5
+ # Made with ♥ by Sebastien Rousseau
6
6
  # License: MIT
7
+ #
8
+ # Description:
9
+ # lowercase is a utility function that converts file or directory names to
10
+ # lowercase. It supports multiple arguments and provides informative messages
11
+ # for each operation, including errors and successful renames.
12
+ #
13
+ # Usage:
14
+ # lowercase <file_or_directory> [<file_or_directory> ...]
15
+ #
16
+ # Arguments:
17
+ # <file_or_directory> One or more file or directory paths to rename
18
+ # to lowercase.
19
+ #
20
+ # Notes:
21
+ # - This utility will skip renaming files or directories that are already
22
+ # in lowercase.
23
+ # - Invalid or non-existent paths will result in an error message.
24
+ #
25
+ ################################################################################
7
26
 
8
- # lowercase: Function to move filenames or directory names to lowercase
9
27
  lowercase() {
10
- if [[ "$#" != 1 ]]; then
11
- echo "[ERROR] The filename or directory name is incorrect." >&2
28
+ # Ensure at least one argument is provided
29
+ if [[ "$#" -lt 1 ]]; then
30
+ echo "[ERROR] Please provide at least one file or directory to convert to lowercase." >&2
12
31
  return 1
13
32
  fi
14
- for file; do
15
- filename=${file##*/}
16
- case "${filename}" in
17
- */*) [[ "dirname" = "${file%/*}" ]] ;;
18
- *) dirname=. ;;
19
- esac
20
- nf=$(echo "${filename}" | tr '[:upper:]' '[:lower:]')
33
+
34
+ for file in "$@"; do
35
+ # Check if the file/directory exists
36
+ if [[ ! -e "$file" ]]; then
37
+ echo "[ERROR] The file or directory '$file' does not exist." >&2
38
+ continue
39
+ fi
40
+
41
+ dirname=$(dirname "$file")
42
+ filename=$(basename "$file")
43
+
44
+ # Convert filename to lowercase using tr
45
+ nf=$(printf "%s" "$filename" | tr '[:upper:]' '[:lower:]')
46
+
47
+ # If already lowercase, skip
48
+ if [[ "$filename" == "$nf" ]]; then
49
+ echo "[INFO] '$file' is already in lowercase."
50
+ continue
51
+ fi
52
+
21
53
  newname="${dirname}/${nf}"
22
- if [[ "${nf}" != "${filename}" ]]; then
23
- mv "${file}" "${newname}"
24
- echo "[INFO] Renaming ${file} to lowercase: ${newname}"
54
+
55
+ if mv "$file" "$newname"; then
56
+ echo "[INFO] Renamed '$file' to '$newname'."
25
57
  else
26
- echo "[ERROR] The operation is not valid, ${file} has not changed."
58
+ echo "[ERROR] Failed to rename '$file'." >&2
27
59
  fi
28
60
  done
29
61
  }
@@ -1,41 +1,216 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ ################################################################################
4
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 - Matrix Effect Generator (matrix)
5
+ # Made with ♥ by Sebastien Rousseau
6
6
  # License: MIT
7
+ #
8
+ # Description:
9
+ # matrix is a utility function to generate Matrix-style effects in the terminal
10
+ # with customizable colors. It supports multiple color themes and a rainbow
11
+ # effect option.
12
+ #
13
+ ################################################################################
7
14
 
8
- # matrix: Function to Enable Matrix Effect in the terminal
9
- matrix() {
10
- printf '\e[1;40m'
15
+ # Define colors
16
+ MATRIX_GREEN='\033[38;5;46m' # Green (#00FF00)
17
+ MATRIX_PURPLE='\033[38;5;55m' # Purple (#2D1681)
18
+ MATRIX_RED='\033[38;5;196m' # Red (#EB0000)
19
+ MATRIX_BLUE='\033[38;5;33m' # Blue (#007ACC)
20
+ MATRIX_WHITE='\033[38;5;15m' # White (#FFFFFF)
21
+ MATRIX_YELLOW='\033[38;5;226m' # Yellow
22
+ RESET_COLOR='\033[0m'
23
+
24
+ VERSION="1.0.0"
25
+
26
+ # Logging functions
27
+ log_info() {
28
+ echo "[INFO] $*"
29
+ }
30
+
31
+ log_warning() {
32
+ echo "[WARNING] $*" >&2
33
+ }
34
+
35
+ log_error() {
36
+ echo "[ERROR] $*" >&2
37
+ exit 1
38
+ }
39
+
40
+ show_help() {
41
+ cat << 'EOH'
42
+ 🅳🅾🆃🅵🅸🅻🅴🆂 - Matrix Effect Generator (matrix)
43
+
44
+ Description:
45
+ Generate Matrix-style effects in the terminal with customizable colors.
46
+ Supports multiple color themes and a rainbow effect option.
47
+
48
+ Usage:
49
+ matrix [options]
50
+ matrix --help
51
+
52
+ Options:
53
+ --color <name> Select color theme:
54
+ green - Classic green (default)
55
+ purple - Purple (#2D1681)
56
+ red - Red (#EB0000)
57
+ blue - Blue (#007ACC)
58
+ white - White (#FFFFFF)
59
+ yellow - Yellow
60
+ --rainbow Enable rainbow color effect
61
+ --slow Reduce animation speed
62
+ --fast Increase animation speed
63
+ --help Display this help menu and exit
64
+ --version Display version information and exit
65
+
66
+ Examples:
67
+ matrix
68
+ # Classic green Matrix effect
69
+
70
+ matrix --color purple
71
+ # Purple Matrix effect
72
+
73
+ matrix --rainbow
74
+ # Rainbow color effect
75
+
76
+ matrix --color blue --slow
77
+ # Slow blue Matrix effect
78
+
79
+ Notes:
80
+ - Press Ctrl+C to exit
81
+ - Animation speed can be adjusted with --slow or --fast
82
+ - Terminal size is automatically detected
83
+ - Minimum terminal size required: 20x10
84
+ - Colors can be customized by modifying the color variables
85
+ EOH
86
+ }
87
+
88
+ show_version() {
89
+ echo "Matrix Effect Generator v${VERSION}"
90
+ }
91
+
92
+ cleanup() {
93
+ printf '\e[?25h' # Show cursor
94
+ tput rmcup # Restore screen
95
+ tput cnorm # Show cursor
11
96
  clear
12
- while : || true; do
13
- echo "${LINES} ${COLUMNS} $((RANDOM % COLUMNS)) $((RANDOM % 72))"
14
- sleep 0.05 || true
15
- done | awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
97
+ exit 0
16
98
  }
17
99
 
18
- # matrix: Function to Enable Matrix Effect in the terminal in color
19
- matrix_color() {
100
+ matrix() {
101
+ # Check for help and version flags before parsing options
102
+ if [[ "$1" == "--help" ]]; then
103
+ show_help
104
+ return 0
105
+ elif [[ "$1" == "--version" ]]; then
106
+ show_version
107
+ return 0
108
+ fi
109
+
110
+ # Check terminal size
111
+ if [[ "${LINES:-0}" -lt 10 || "${COLUMNS:-0}" -lt 20 ]]; then
112
+ log_error "Terminal window too small. Minimum size: 20x10"
113
+ fi
114
+
115
+ # Default settings
116
+ local color="$MATRIX_GREEN"
117
+ local speed=0.05
118
+ local rainbow=false
119
+
120
+ # Parse options
121
+ while [[ $# -gt 0 ]]; do
122
+ case "$1" in
123
+ --color)
124
+ case "$2" in
125
+ green) color="$MATRIX_GREEN" ;;
126
+ purple) color="$MATRIX_PURPLE" ;;
127
+ red) color="$MATRIX_RED" ;;
128
+ blue) color="$MATRIX_BLUE" ;;
129
+ white) color="$MATRIX_WHITE" ;;
130
+ yellow) color="$MATRIX_YELLOW" ;;
131
+ *) log_error "Invalid color: '$2'. Use 'matrix --help' for available colors." ;;
132
+ esac
133
+ shift 2
134
+ ;;
135
+ --rainbow)
136
+ rainbow=true
137
+ shift
138
+ ;;
139
+ --slow)
140
+ speed=0.1
141
+ shift
142
+ ;;
143
+ --fast)
144
+ speed=0.02
145
+ shift
146
+ ;;
147
+ --help)
148
+ show_help
149
+ return 0
150
+ ;;
151
+ --version)
152
+ show_version
153
+ return 0
154
+ ;;
155
+ *)
156
+ log_error "Unknown option: '$1'. Use 'matrix --help' for usage information."
157
+ ;;
158
+ esac
159
+ done
160
+
161
+ # Save screen state and hide cursor
162
+ tput smcup
163
+ printf '\e[?25l'
20
164
  printf '\e[1;40m'
21
165
  clear
22
- while : || true; do
23
- echo "${LINES} ${COLUMNS} $((RANDOM % COLUMNS)) $((RANDOM % 72))"
24
- sleep 0.05 || true
25
- done | awk '{
26
- letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()";
27
- c=$4;
28
- letter=substr(letters,c,1);
29
- a[$3]=0;
30
- for (x in a) {
31
- o=a[x];
32
- a[x]=a[x]+1;
33
- color="\033[38;5;" int(rand()*255) "m";
34
- printf "\033[%s;%sH%s%s",o,x,color,letter;
35
- printf "\033[%s;%sH\033[0m%s\033[0;0H",a[x],x,letter;
36
- if (a[x] >= $1) {
37
- a[x]=0;
166
+
167
+ # Trap cleanup for exit signals
168
+ trap cleanup INT TERM EXIT
169
+
170
+ if $rainbow; then
171
+ # Rainbow effect
172
+ while true; do
173
+ echo "${LINES:-40} ${COLUMNS:-80} $((RANDOM % COLUMNS)) $((RANDOM % 72))"
174
+ sleep "$speed"
175
+ done | awk -v reset="$RESET_COLOR" '
176
+ {
177
+ letters="日ハミヒーウシナミニサワツオリアホテマケメエカキムユラセネスタヌヘ";
178
+ c=$4;
179
+ if (c <= 0 || c > length(letters)) next;
180
+ letter=substr(letters, c, 1);
181
+ a[$3] = 0;
182
+ for (x in a) {
183
+ o = a[x];
184
+ a[x] = a[x] + 1;
185
+ random_color = "\033[38;5;" int(rand() * 255) "m";
186
+ if (o > 0 && x > 0) {
187
+ printf "\033[%s;%sH%s%s%s", o, x, random_color, letter, reset;
188
+ printf "\033[%s;%sH%s%s%s", a[x], x, reset, letter, reset;
189
+ }
190
+ if (a[x] >= $1) a[x] = 0;
191
+ }
192
+ }'
193
+ else
194
+ # Single color effect
195
+ while true; do
196
+ echo "${LINES:-40} ${COLUMNS:-80} $((RANDOM % COLUMNS)) $((RANDOM % 72))"
197
+ sleep "$speed"
198
+ done | awk -v color="$color" -v reset="$RESET_COLOR" '
199
+ {
200
+ letters="日ハミヒーウシナミニサワツオリアホテマケメエカキムユラセネスタヌヘ";
201
+ c=$4;
202
+ if (c <= 0 || c > length(letters)) next;
203
+ letter=substr(letters, c, 1);
204
+ a[$3] = 0;
205
+ for (x in a) {
206
+ o = a[x];
207
+ a[x] = a[x] + 1;
208
+ if (o > 0 && x > 0) {
209
+ printf "\033[%s;%sH%s%s%s", o, x, color, letter, reset;
210
+ printf "\033[%s;%sH%s%s%s", a[x], x, reset, letter, reset;
211
+ }
212
+ if (a[x] >= $1) a[x] = 0;
38
213
  }
39
- }
40
- }'
214
+ }'
215
+ fi
41
216
  }
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.469) - <https://dotfiles.io>
4
+ # Made with ♥ in London, UK by Sebastien Rousseau
5
+ # Copyright (c) 2015-2025. All rights reserved
6
6
  # License: MIT
7
7
 
8
8
  # mount_read_only: Function to mount a read-only disk image as read-write
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.469) - <https://dotfiles.io>
4
+ # Made with ♥ in London, UK by Sebastien Rousseau
5
+ # Copyright (c) 2015-2025. All rights reserved
6
6
  # License: MIT
7
7
 
8
8
  # myproc: Function to list processes owned by an user
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.469) - <https://dotfiles.io>
4
+ # Made with ♥ in London, UK by Sebastien Rousseau
5
+ # Copyright (c) 2015-2025. All rights reserved
6
6
  # License: MIT
7
7
 
8
8
  # ----------------------------------------------------------------------------
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.469) - <https://dotfiles.io>
4
+ # Made with ♥ in London, UK by Sebastien Rousseau
5
+ # Copyright (c) 2015-2025. All rights reserved
6
6
  # License: MIT
7
7
 
8
8
  # ql: Function to open any file in MacOS Quicklook Preview
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.469) - <https://dotfiles.io>
4
+ # Made with ♥ in London, UK by Sebastien Rousseau
5
+ # Copyright (c) 2015-2025. All rights reserved
6
6
  # License: MIT
7
7
 
8
8
  # rd: Function to remove a directory and its files
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.469) - <https://dotfiles.io>
4
+ # Made with ♥ in London, UK by Sebastien Rousseau
5
+ # Copyright (c) 2015-2025. All rights reserved
6
6
  # License: MIT
7
7
 
8
8
  # remove_disk: spin down unneeded disk