@sebastienrousseau/dotfiles 0.2.468 β 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.
- package/README.md +5 -5
- package/dist/Makefile +126 -43
- package/dist/bin/constants.d.ts +2 -2
- package/dist/bin/constants.d.ts.map +1 -1
- package/dist/bin/constants.js +1 -1
- package/dist/filesizes.txt +146 -144
- package/dist/lib/README.md +79 -5
- package/dist/lib/aliases/README.md +44 -42
- package/dist/lib/aliases/archives/README.md +120 -34
- package/dist/lib/aliases/archives/archives.aliases.sh +106 -149
- package/dist/lib/aliases/cd/README.md +119 -38
- package/dist/lib/aliases/cd/cd.aliases.sh +37 -59
- package/dist/lib/aliases/chmod/README.md +146 -95
- package/dist/lib/aliases/chmod/chmod.aliases.sh +71 -55
- package/dist/lib/aliases/clear/README.md +2 -2
- package/dist/lib/aliases/clear/clear.aliases.sh +4 -4
- package/dist/lib/aliases/configuration/README.md +2 -2
- package/dist/lib/aliases/configuration/configuration.aliases.sh +3 -6
- package/dist/lib/aliases/default/README.md +2 -2
- package/dist/lib/aliases/default/default.aliases.sh +3 -3
- package/dist/lib/aliases/dig/README.md +2 -2
- package/dist/lib/aliases/dig/dig.aliases.sh +4 -4
- package/dist/lib/aliases/disk-usage/README.md +2 -2
- package/dist/lib/aliases/disk-usage/du.aliases.sh +2 -2
- package/dist/lib/aliases/editor/README.md +2 -2
- package/dist/lib/aliases/editor/editor.aliases.sh +4 -4
- package/dist/lib/aliases/find/README.md +2 -2
- package/dist/lib/aliases/find/find.aliases.sh +4 -4
- package/dist/lib/aliases/gcloud/README.md +2 -2
- package/dist/lib/aliases/gcloud/gcloud.aliases.sh +4 -4
- package/dist/lib/aliases/git/README.md +2 -2
- package/dist/lib/aliases/git/git.aliases.sh +3 -3
- package/dist/lib/aliases/gnu/README.md +2 -2
- package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +2 -2
- package/dist/lib/aliases/heroku/README.md +2 -2
- package/dist/lib/aliases/heroku/heroku.aliases.sh +3 -3
- package/dist/lib/aliases/interactive/README.md +2 -2
- package/dist/lib/aliases/interactive/interactive.aliases.sh +3 -3
- package/dist/lib/aliases/list/README.md +112 -23
- package/dist/lib/aliases/list/list.aliases.sh +130 -84
- package/dist/lib/aliases/macOS/README.md +2 -2
- package/dist/lib/aliases/macOS/macos.aliases.sh +3 -3
- package/dist/lib/aliases/make/README.md +2 -2
- package/dist/lib/aliases/make/make.aliases.sh +3 -3
- package/dist/lib/aliases/mkdir/README.md +2 -2
- package/dist/lib/aliases/mkdir/mkdir.aliases.sh +3 -3
- package/dist/lib/aliases/npm/README.md +2 -2
- package/dist/lib/aliases/npm/npm.aliases.sh +3 -3
- package/dist/lib/aliases/permission/README.md +2 -2
- package/dist/lib/aliases/permission/permission.aliases.sh +3 -3
- package/dist/lib/aliases/pnpm/README.md +2 -2
- package/dist/lib/aliases/pnpm/pnpm.aliases.sh +3 -3
- package/dist/lib/aliases/ps/README.md +2 -2
- package/dist/lib/aliases/ps/ps.aliases.sh +3 -3
- package/dist/lib/aliases/python/python.aliases.sh +141 -0
- package/dist/lib/aliases/rsync/README.md +2 -2
- package/dist/lib/aliases/rsync/rsync.aliases.sh +3 -3
- package/dist/lib/aliases/rust/README.md +165 -44
- package/dist/lib/aliases/rust/rust.aliases.sh +109 -117
- package/dist/lib/aliases/subversion/README.md +2 -2
- package/dist/lib/aliases/subversion/subversion.aliases.sh +3 -3
- package/dist/lib/aliases/sudo/README.md +2 -2
- package/dist/lib/aliases/sudo/sudo.aliases.sh +3 -3
- package/dist/lib/aliases/tmux/README.md +2 -2
- package/dist/lib/aliases/tmux/tmux.aliases.sh +3 -3
- package/dist/lib/aliases/update/README.md +2 -2
- package/dist/lib/aliases/update/update.aliases.sh +307 -66
- package/dist/lib/aliases/uuid/README.md +2 -2
- package/dist/lib/aliases/uuid/uuid.aliases.sh +3 -3
- package/dist/lib/aliases/wget/README.md +2 -2
- package/dist/lib/aliases/wget/wget.aliases.sh +3 -3
- package/dist/lib/aliases.sh +2 -2
- package/dist/lib/configurations/README.md +2 -2
- package/dist/lib/configurations/bash/bashrc +163 -35
- package/dist/lib/configurations/curl/curlrc +3 -6
- package/dist/lib/configurations/default/color.sh +3 -3
- package/dist/lib/configurations/default/constants.sh +4 -4
- package/dist/lib/configurations/default/editor.sh +3 -3
- package/dist/lib/configurations/default/prompt.sh +20 -11
- package/dist/lib/configurations/input/inputrc +3 -3
- package/dist/lib/configurations/nano/nanorc +3 -3
- package/dist/lib/configurations/profile/profile +3 -3
- package/dist/lib/configurations/prompt/prompt.sh +81 -0
- package/dist/lib/configurations/tmux/default +3 -3
- package/dist/lib/configurations/tmux/display +3 -3
- package/dist/lib/configurations/tmux/linux +3 -3
- package/dist/lib/configurations/tmux/navigation +3 -3
- package/dist/lib/configurations/tmux/panes +3 -3
- package/dist/lib/configurations/tmux/theme +4 -4
- package/dist/lib/configurations/tmux/tmux +3 -3
- package/dist/lib/configurations/vim/vimrc +191 -71
- package/dist/lib/configurations/wget/wgetrc +3 -3
- package/dist/lib/configurations/zsh/zshrc +3 -4
- package/dist/lib/configurations.sh +19 -7
- package/dist/lib/functions/README.md +68 -54
- package/dist/lib/functions/apihealth.sh +277 -0
- package/dist/lib/functions/apilatency.sh +157 -0
- package/dist/lib/functions/apiload.sh +165 -0
- package/dist/lib/functions/backup.sh +143 -0
- package/dist/lib/functions/cdls.sh +52 -6
- package/dist/lib/functions/curlheader.sh +66 -10
- package/dist/lib/functions/curlstatus.sh +64 -7
- package/dist/lib/functions/curltime.sh +56 -14
- package/dist/lib/functions/encode64.sh +87 -7
- package/dist/lib/functions/environment.sh +65 -25
- package/dist/lib/functions/extract.sh +79 -27
- package/dist/lib/functions/freespace.sh +55 -9
- package/dist/lib/functions/genpwd.sh +93 -29
- package/dist/lib/functions/goto.sh +59 -8
- package/dist/lib/functions/hexdump.sh +96 -0
- package/dist/lib/functions/hiddenfiles.sh +77 -0
- package/dist/lib/functions/hostinfo.sh +92 -21
- package/dist/lib/functions/hstats.sh +69 -5
- package/dist/lib/functions/httpdebug.sh +109 -5
- package/dist/lib/functions/kebabcase.sh +61 -0
- package/dist/lib/functions/keygen.sh +188 -25
- package/dist/lib/functions/last.sh +106 -5
- package/dist/lib/functions/logout.sh +114 -6
- package/dist/lib/functions/lowercase.sh +49 -17
- package/dist/lib/functions/matrix.sh +205 -30
- package/dist/lib/functions/mount_read_only.sh +3 -3
- package/dist/lib/functions/myproc.sh +3 -3
- package/dist/lib/functions/prependpath.sh +3 -3
- package/dist/lib/functions/ql.sh +3 -3
- package/dist/lib/functions/rd.sh +3 -3
- package/dist/lib/functions/remove_disk.sh +3 -3
- package/dist/lib/functions/ren.sh +68 -8
- package/dist/lib/functions/sentencecase.sh +63 -0
- package/dist/lib/functions/showhiddenfiles.sh +3 -3
- package/dist/lib/functions/size.sh +6 -5
- package/dist/lib/functions/snakecase.sh +61 -0
- package/dist/lib/functions/stopwatch.sh +3 -3
- package/dist/lib/functions/sysinfo.sh +145 -0
- package/dist/lib/functions/titlecase.sh +65 -0
- package/dist/lib/functions/uppercase.sh +51 -19
- package/dist/lib/functions/view-source.sh +3 -3
- package/dist/lib/functions/vscode.sh +3 -3
- package/dist/lib/functions/whoisport.sh +3 -3
- package/dist/lib/functions/zipf.sh +3 -3
- package/dist/lib/functions.sh +21 -7
- package/dist/lib/history.sh +36 -88
- package/dist/lib/paths/README.md +52 -0
- package/dist/lib/paths/custom.paths.sh +40 -0
- package/dist/lib/paths/default.paths.sh +37 -0
- package/dist/lib/paths.sh +27 -14
- package/dist/scripts/backup.sh +3 -3
- package/dist/scripts/banner.sh +3 -3
- package/dist/scripts/build.sh +3 -3
- package/dist/scripts/clean.sh +3 -3
- package/dist/scripts/compile.sh +3 -3
- package/dist/scripts/copy.sh +3 -3
- package/dist/scripts/dotfiles.sh +3 -3
- package/dist/scripts/download.sh +3 -3
- package/dist/scripts/help.sh +3 -3
- package/dist/scripts/ssh.sh +3 -3
- package/dist/scripts/unpack.sh +3 -3
- package/package.json +10 -10
- package/dist/lib/aliases/jekyll/README.md +0 -41
- package/dist/lib/aliases/jekyll/jekyll.aliases.sh +0 -54
- package/dist/lib/functions/filehead.sh +0 -4
- package/dist/lib/functions/hidehiddenfiles.sh +0 -14
- package/dist/lib/paths/ant/ant.paths.sh +0 -15
- package/dist/lib/paths/default/default.paths.sh +0 -19
- package/dist/lib/paths/homebrew/homebrew.paths.sh +0 -27
- package/dist/lib/paths/java/java.paths.sh +0 -19
- package/dist/lib/paths/maven/maven.paths.sh +0 -18
- package/dist/lib/paths/node/node.paths.sh +0 -15
- package/dist/lib/paths/nvm/nvm.paths.sh +0 -23
- package/dist/lib/paths/pnpm/pnpm.paths.sh +0 -15
- package/dist/lib/paths/python/python.paths.sh +0 -36
- package/dist/lib/paths/ruby/ruby.paths.sh +0 -25
- package/dist/lib/paths/tmux/tmux.paths.sh +0 -12
|
@@ -1,13 +1,73 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
#
|
|
3
|
+
################################################################################
|
|
4
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π - File Extension Renamer (ren)
|
|
5
|
+
# Made with β₯ by Sebastien Rousseau
|
|
6
6
|
# License: MIT
|
|
7
|
+
#
|
|
8
|
+
# Description:
|
|
9
|
+
# ren is a utility function to rename file extensions in the current directory.
|
|
10
|
+
# It supports batch renaming with confirmation.
|
|
11
|
+
#
|
|
12
|
+
# Usage:
|
|
13
|
+
# ren OLD_EXT NEW_EXT
|
|
14
|
+
#
|
|
15
|
+
# Example:
|
|
16
|
+
# ren txt md # Rename all .txt files to .md
|
|
17
|
+
#
|
|
18
|
+
################################################################################
|
|
7
19
|
|
|
8
|
-
# ren: Function to rename files extension.
|
|
9
20
|
ren() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
# Check if we have both arguments
|
|
22
|
+
if [[ $# -ne 2 ]]; then
|
|
23
|
+
echo "[ERROR] Usage: ren OLD_EXT NEW_EXT" >&2
|
|
24
|
+
return 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
local old_ext="$1"
|
|
28
|
+
local new_ext="$2"
|
|
29
|
+
local count=0
|
|
30
|
+
|
|
31
|
+
# First check if any matching files exist
|
|
32
|
+
for file in *."$old_ext"; do
|
|
33
|
+
# Skip if no matches found
|
|
34
|
+
[[ -e "$file" ]] || {
|
|
35
|
+
echo "[WARNING] No files found with extension .$old_ext"
|
|
36
|
+
return 0
|
|
37
|
+
}
|
|
38
|
+
((count++))
|
|
39
|
+
break
|
|
40
|
+
done
|
|
41
|
+
|
|
42
|
+
# Show what we're about to do
|
|
43
|
+
echo "[INFO] Found files with .$old_ext extension. Converting to .$new_ext"
|
|
44
|
+
echo "[INFO] The following files will be renamed:"
|
|
45
|
+
for file in *."$old_ext"; do
|
|
46
|
+
echo " $file β ${file%."$old_ext"}.$new_ext"
|
|
47
|
+
done
|
|
48
|
+
|
|
49
|
+
# Ask for confirmation
|
|
50
|
+
echo -n "Proceed with rename? [y/N] "
|
|
51
|
+
read -r response
|
|
52
|
+
if [[ ! "${response}" =~ ^[Yy]$ ]]; then
|
|
53
|
+
echo "[INFO] Operation cancelled"
|
|
54
|
+
return 0
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# Perform the rename
|
|
58
|
+
local success=0
|
|
59
|
+
local failed=0
|
|
60
|
+
for file in *."$old_ext"; do
|
|
61
|
+
if mv "$file" "${file%."$old_ext"}.$new_ext"; then
|
|
62
|
+
echo "[SUCCESS] Renamed: $file β ${file%."$old_ext"}.$new_ext"
|
|
63
|
+
((success++))
|
|
64
|
+
else
|
|
65
|
+
echo "[ERROR] Failed to rename: $file" >&2
|
|
66
|
+
((failed++))
|
|
67
|
+
fi
|
|
68
|
+
done
|
|
69
|
+
|
|
70
|
+
# Show summary
|
|
71
|
+
echo "----------------------------------------"
|
|
72
|
+
echo "[COMPLETE] Successfully renamed: $success, Failed: $failed"
|
|
73
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
################################################################################
|
|
4
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π - Cross-Platform Sentencecase Utility (sentencecase)
|
|
5
|
+
# Made with β₯ by Sebastien Rousseau
|
|
6
|
+
# License: MIT
|
|
7
|
+
#
|
|
8
|
+
# Description:
|
|
9
|
+
# sentencecase converts file or directory names to sentence case. It capitalizes
|
|
10
|
+
# the first character of the first word, while the rest of the characters are
|
|
11
|
+
# lowercased. This is different from title case, as only the very first letter
|
|
12
|
+
# is capitalized.
|
|
13
|
+
#
|
|
14
|
+
# Usage:
|
|
15
|
+
# sentencecase <file_or_directory> [<file_or_directory> ...]
|
|
16
|
+
#
|
|
17
|
+
# Arguments:
|
|
18
|
+
# <file_or_directory> One or more file or directory paths to rename
|
|
19
|
+
# to sentence case.
|
|
20
|
+
#
|
|
21
|
+
# Notes:
|
|
22
|
+
# - Already sentence case files are skipped.
|
|
23
|
+
# - Non-existent paths will produce an error message.
|
|
24
|
+
# - Complex scenarios (multiple words, punctuation) are handled by simply
|
|
25
|
+
# making all letters lowercase except the first character.
|
|
26
|
+
#
|
|
27
|
+
################################################################################
|
|
28
|
+
|
|
29
|
+
sentencecase() {
|
|
30
|
+
if [[ "$#" -lt 1 ]]; then
|
|
31
|
+
echo "[ERROR] Please provide at least one file or directory to convert to sentence case." >&2
|
|
32
|
+
return 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
for file in "$@"; do
|
|
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
|
|
45
|
+
lc_filename=$(printf "%s" "$filename" | tr '[:upper:]' '[:lower:]')
|
|
46
|
+
|
|
47
|
+
# Capitalize only the first character
|
|
48
|
+
sc_filename="$(printf "%s" "${lc_filename:0:1}" | tr '[:lower:]' '[:upper:]')${lc_filename:1}"
|
|
49
|
+
|
|
50
|
+
# If already sentence case, skip
|
|
51
|
+
if [[ "$filename" == "$sc_filename" ]]; then
|
|
52
|
+
echo "[INFO] '$file' is already in sentence case."
|
|
53
|
+
continue
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
newname="${dirname}/${sc_filename}"
|
|
57
|
+
if mv "$file" "$newname"; then
|
|
58
|
+
echo "[INFO] Renamed '$file' to '$newname'."
|
|
59
|
+
else
|
|
60
|
+
echo "[ERROR] Failed to rename '$file'." >&2
|
|
61
|
+
fi
|
|
62
|
+
done
|
|
63
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# π
³π
Ύππ
΅π
Έπ
»π
΄π (v0.2.
|
|
4
|
-
# Made with β₯ in London, UK by
|
|
5
|
-
# Copyright (c) 2015-
|
|
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
|
# Show hidden system and dotfile files
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# π
³π
Ύππ
΅π
Έπ
»π
΄π
|
|
4
|
-
# Made with β₯
|
|
5
|
-
# Copyright (c) 2015-
|
|
3
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π - size
|
|
4
|
+
# Made with β₯ by Sebastien Rousseau
|
|
5
|
+
# Copyright (c) 2015-2025. All rights reserved
|
|
6
6
|
# License: MIT
|
|
7
7
|
|
|
8
8
|
# size: Function to check a file size
|
|
9
9
|
size() {
|
|
10
10
|
if [[ "$#" != 1 ]]; then
|
|
11
|
-
echo "[ERROR] Please add one argument" >&2
|
|
11
|
+
echo "[ERROR] Please add one argument (file or directory)" >&2
|
|
12
12
|
return 1
|
|
13
13
|
fi
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
stat -f '[INFO] Directory total size: %z bytes' "$1"
|
|
15
16
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
################################################################################
|
|
4
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π - Cross-Platform Snakecase Utility (snakecase)
|
|
5
|
+
# Made with β₯ by Sebastien Rousseau
|
|
6
|
+
# License: MIT
|
|
7
|
+
#
|
|
8
|
+
# Description:
|
|
9
|
+
# snakecase converts file or directory names to snake_case. All letters
|
|
10
|
+
# are lowercase and spaces or other non-alphanumeric characters are replaced
|
|
11
|
+
# by underscores.
|
|
12
|
+
#
|
|
13
|
+
# Usage:
|
|
14
|
+
# snakecase <file_or_directory> [<file_or_directory> ...]
|
|
15
|
+
#
|
|
16
|
+
# Arguments:
|
|
17
|
+
# <file_or_directory> One or more file or directory paths to rename
|
|
18
|
+
# to snake_case.
|
|
19
|
+
#
|
|
20
|
+
# Notes:
|
|
21
|
+
# - Already snake_case files are skipped.
|
|
22
|
+
# - Non-existent paths will produce an error message.
|
|
23
|
+
# - Special characters (other than alphanumeric and '.') are replaced
|
|
24
|
+
# with underscores.
|
|
25
|
+
#
|
|
26
|
+
################################################################################
|
|
27
|
+
|
|
28
|
+
snakecase() {
|
|
29
|
+
if [[ "$#" -lt 1 ]]; then
|
|
30
|
+
echo "[ERROR] Please provide at least one file or directory to convert to snake_case." >&2
|
|
31
|
+
return 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
for file in "$@"; do
|
|
35
|
+
if [[ ! -e "$file" ]]; then
|
|
36
|
+
echo "[ERROR] The file or directory '$file' does not exist." >&2
|
|
37
|
+
continue
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
dirname=$(dirname "$file")
|
|
41
|
+
filename=$(basename "$file")
|
|
42
|
+
|
|
43
|
+
# Convert to lowercase and replace non-alphanumeric chars (except '.') with underscores
|
|
44
|
+
sc_filename=$(printf "%s" "$filename" \
|
|
45
|
+
| tr '[:upper:]' '[:lower:]' \
|
|
46
|
+
| sed 's/[^[:alnum:].]/_/g')
|
|
47
|
+
|
|
48
|
+
# If already snake_case, skip
|
|
49
|
+
if [[ "$filename" == "$sc_filename" ]]; then
|
|
50
|
+
echo "[INFO] '$file' is already in snake_case."
|
|
51
|
+
continue
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
newname="${dirname}/${sc_filename}"
|
|
55
|
+
if mv "$file" "$newname"; then
|
|
56
|
+
echo "[INFO] Renamed '$file' to '$newname'."
|
|
57
|
+
else
|
|
58
|
+
echo "[ERROR] Failed to rename '$file'." >&2
|
|
59
|
+
fi
|
|
60
|
+
done
|
|
61
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# π
³π
Ύππ
΅π
Έπ
»π
΄π (v0.2.
|
|
4
|
-
# Made with β₯ in London, UK by
|
|
5
|
-
# Copyright (c) 2015-
|
|
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
|
# stopwatch: Function for a stopwatch
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
################################################################################
|
|
3
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π - sysinfo
|
|
4
|
+
# Made with β₯ by Sebastien Rousseau
|
|
5
|
+
# License: MIT
|
|
6
|
+
#
|
|
7
|
+
# sysinfo - A minimal system information script with emoji OS icons.
|
|
8
|
+
#
|
|
9
|
+
# This script displays basic system information in a style similar to neofetch,
|
|
10
|
+
# but simpler. It attempts to detect OS, CPU, GPU, memory, etc.
|
|
11
|
+
#
|
|
12
|
+
# Usage:
|
|
13
|
+
# sysinfo
|
|
14
|
+
#
|
|
15
|
+
################################################################################
|
|
16
|
+
|
|
17
|
+
#-------------------------------#
|
|
18
|
+
# Color Variables #
|
|
19
|
+
#-------------------------------#
|
|
20
|
+
GREEN='\033[0;32m'
|
|
21
|
+
RESET='\033[0m'
|
|
22
|
+
|
|
23
|
+
#######################################
|
|
24
|
+
# Detect platform and choose an emoji.
|
|
25
|
+
#######################################
|
|
26
|
+
case "$(uname -s)" in
|
|
27
|
+
Darwin)
|
|
28
|
+
emoji="π"
|
|
29
|
+
;;
|
|
30
|
+
Linux)
|
|
31
|
+
emoji="π§"
|
|
32
|
+
;;
|
|
33
|
+
CYGWIN*|MINGW*|MSYS*)
|
|
34
|
+
emoji="πͺ"
|
|
35
|
+
;;
|
|
36
|
+
*)
|
|
37
|
+
emoji="π₯"
|
|
38
|
+
;;
|
|
39
|
+
esac
|
|
40
|
+
|
|
41
|
+
hostname=$(hostname)
|
|
42
|
+
|
|
43
|
+
#######################################
|
|
44
|
+
# Collect system information depending on OS.
|
|
45
|
+
#######################################
|
|
46
|
+
if [[ "$(uname -s)" = "Darwin" ]]; then
|
|
47
|
+
hw_info=$(system_profiler SPHardwareDataType)
|
|
48
|
+
disp_info=$(system_profiler SPDisplaysDataType)
|
|
49
|
+
|
|
50
|
+
model_name=$(echo "${hw_info}" | awk -F': ' '/Model Name/{print $2}')
|
|
51
|
+
model_id=$(echo "${hw_info}" | awk -F': ' '/Model Identifier/{print $2}')
|
|
52
|
+
chip=$(echo "${hw_info}" | awk -F': ' '/Chip/{print $2}')
|
|
53
|
+
total_cores=$(echo "${hw_info}" | awk -F': ' '/Total Number of Cores/{print $2}')
|
|
54
|
+
mem=$(echo "${hw_info}" | awk -F': ' '/Memory/{print $2}')
|
|
55
|
+
|
|
56
|
+
os="macOS $(sw_vers -productVersion)"
|
|
57
|
+
kernel=$(uname -r)
|
|
58
|
+
uptime=$(uptime | sed 's/.*up //' | sed 's/, .*//')
|
|
59
|
+
cpu="$chip ($total_cores cores)"
|
|
60
|
+
gpu=$(echo "${disp_info}" | awk -F': ' '/Chipset Model/ {print $2; exit}')
|
|
61
|
+
resolution=$(echo "${disp_info}" | awk -F': ' '/Resolution/{print $2}' | head -n1)
|
|
62
|
+
shell=$(basename "${SHELL}")
|
|
63
|
+
|
|
64
|
+
terminal=${TERM_PROGRAM:-"${TERM}"}
|
|
65
|
+
memory="${mem}"
|
|
66
|
+
|
|
67
|
+
elif [[ "$(uname -s)" = "Linux" ]]; then
|
|
68
|
+
# OS
|
|
69
|
+
if [ -f /etc/os-release ]; then
|
|
70
|
+
os=$(awk -F= '/^PRETTY_NAME/{print $2}' /etc/os-release 2>/dev/null | tr -d \")
|
|
71
|
+
else
|
|
72
|
+
os=$(uname -s)
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
kernel=$(uname -r)
|
|
76
|
+
uptime=$(uptime -p | sed 's/up //')
|
|
77
|
+
shell=$(basename "${SHELL}")
|
|
78
|
+
terminal=${TERM:-"Unknown"}
|
|
79
|
+
|
|
80
|
+
# CPU (check if lscpu is available)
|
|
81
|
+
if command -v lscpu >/dev/null 2>&1; then
|
|
82
|
+
cpu=$(lscpu 2>/dev/null | awk -F': +' '/Model name/ {print $2; exit}')
|
|
83
|
+
else
|
|
84
|
+
cpu="Unknown CPU"
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# GPU (check if lspci is available)
|
|
88
|
+
if command -v lspci >/dev/null 2>&1; then
|
|
89
|
+
gpu=$(lspci 2>/dev/null | grep -E "VGA|3D" | sed -E "s/.*: (.*)/\1/" | head -n1)
|
|
90
|
+
else
|
|
91
|
+
gpu="Unknown GPU"
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
# Memory
|
|
95
|
+
mem_total_kb=$(grep MemTotal /proc/meminfo 2>/dev/null | awk '{print $2}')
|
|
96
|
+
if [ -n "${mem_total_kb:-}" ]; then
|
|
97
|
+
memory=$(awk "BEGIN {printf \"%.1fGiB\",$mem_total_kb/1024/1024}")
|
|
98
|
+
else
|
|
99
|
+
memory="Unknown"
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
# Resolution (check if xrandr is available)
|
|
103
|
+
if command -v xrandr >/dev/null 2>&1; then
|
|
104
|
+
resolution=$(xrandr --current 2>/dev/null | awk '/\*/{print $1; exit}')
|
|
105
|
+
else
|
|
106
|
+
resolution="Unknown"
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
model_name=""
|
|
110
|
+
model_id=""
|
|
111
|
+
|
|
112
|
+
else
|
|
113
|
+
# Fallback
|
|
114
|
+
os=$(uname -s)
|
|
115
|
+
kernel=$(uname -r)
|
|
116
|
+
uptime="Unknown"
|
|
117
|
+
cpu="Unknown"
|
|
118
|
+
gpu="Unknown"
|
|
119
|
+
shell=$(basename "${SHELL}")
|
|
120
|
+
terminal=${TERM:-"Unknown"}
|
|
121
|
+
memory="Unknown"
|
|
122
|
+
resolution="Unknown"
|
|
123
|
+
model_name=""
|
|
124
|
+
model_id=""
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
#######################################
|
|
128
|
+
# Print system information.
|
|
129
|
+
#######################################
|
|
130
|
+
sysinfo() {
|
|
131
|
+
printf "%s %s\n" "${emoji}" "${hostname}"
|
|
132
|
+
echo "------------------"
|
|
133
|
+
echo "${GREEN}OS:${RESET} ${os}"
|
|
134
|
+
echo "${GREEN}Kernel:${RESET} ${kernel}"
|
|
135
|
+
echo "${GREEN}Uptime:${RESET} ${uptime}"
|
|
136
|
+
echo "${GREEN}CPU:${RESET} ${cpu}"
|
|
137
|
+
echo "${GREEN}GPU:${RESET} ${gpu}"
|
|
138
|
+
echo "${GREEN}Memory:${RESET} ${memory}"
|
|
139
|
+
echo "${GREEN}Shell:${RESET} ${shell}"
|
|
140
|
+
echo "${GREEN}Terminal:${RESET} ${terminal}"
|
|
141
|
+
echo "${GREEN}Resolution:${RESET} ${resolution}"
|
|
142
|
+
if [[ -n "${model_name}" ]] && [[ -n "${model_id}" ]]; then
|
|
143
|
+
echo "Model: ${model_name} (${model_id})"
|
|
144
|
+
fi
|
|
145
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
################################################################################
|
|
4
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π - Cross-Platform Titlecase Utility (titlecase)
|
|
5
|
+
# Made with β₯ by Sebastien Rousseau
|
|
6
|
+
# License: MIT
|
|
7
|
+
#
|
|
8
|
+
# Description:
|
|
9
|
+
# titlecase is a utility function that converts file or directory names to
|
|
10
|
+
# title case. It capitalizes the first character and lowercases all subsequent
|
|
11
|
+
# characters, resulting in a format similar to "Myfile.txt".
|
|
12
|
+
#
|
|
13
|
+
# Usage:
|
|
14
|
+
# titlecase <file_or_directory> [<file_or_directory> ...]
|
|
15
|
+
#
|
|
16
|
+
# Arguments:
|
|
17
|
+
# <file_or_directory> One or more file or directory paths to rename
|
|
18
|
+
# to title case.
|
|
19
|
+
#
|
|
20
|
+
# Notes:
|
|
21
|
+
# - This utility will skip renaming files or directories that are already
|
|
22
|
+
# in title case.
|
|
23
|
+
# - Invalid or non-existent paths will result in an error message.
|
|
24
|
+
# - If you need more complex title casing (e.g., handling underscores or
|
|
25
|
+
# multiple words), you may need to adjust the logic.
|
|
26
|
+
#
|
|
27
|
+
################################################################################
|
|
28
|
+
|
|
29
|
+
titlecase() {
|
|
30
|
+
# Ensure at least one argument is provided
|
|
31
|
+
if [[ "$#" -lt 1 ]]; then
|
|
32
|
+
echo "[ERROR] Please provide at least one file or directory to convert to title case." >&2
|
|
33
|
+
return 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
for file in "$@"; do
|
|
37
|
+
# Check if the file/directory exists
|
|
38
|
+
if [[ ! -e "${file}" ]]; then
|
|
39
|
+
echo "[ERROR] The file or directory '${file}' does not exist." >&2
|
|
40
|
+
continue
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
dirname=$(dirname "${file}")
|
|
44
|
+
filename=$(basename "${file}")
|
|
45
|
+
|
|
46
|
+
# Convert the entire filename to lowercase
|
|
47
|
+
lc_filename=$(printf "%s" "${filename}" | tr '[:upper:]' '[:lower:]')
|
|
48
|
+
# Capitalize the first letter
|
|
49
|
+
tc_filename="$(printf "%s" "${lc_filename:0:1}" | tr '[:lower:]' '[:upper:]')${lc_filename:1}"
|
|
50
|
+
|
|
51
|
+
# If already in title case, skip
|
|
52
|
+
if [[ "${filename}" == "${tc_filename}" ]]; then
|
|
53
|
+
echo "[INFO] '${file}' is already in title case."
|
|
54
|
+
continue
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
newname="${dirname}/${tc_filename}"
|
|
58
|
+
|
|
59
|
+
if mv "${file}" "${newname}"; then
|
|
60
|
+
echo "[INFO] Renamed '${file}' to '${newname}'."
|
|
61
|
+
else
|
|
62
|
+
echo "[ERROR] Failed to rename '${file}'." >&2
|
|
63
|
+
fi
|
|
64
|
+
done
|
|
65
|
+
}
|
|
@@ -1,29 +1,61 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
#
|
|
3
|
+
################################################################################
|
|
4
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π - Cross-Platform Uppercase Utility (uppercase)
|
|
5
|
+
# Made with β₯ by Sebastien Rousseau
|
|
6
6
|
# License: MIT
|
|
7
|
+
#
|
|
8
|
+
# Description:
|
|
9
|
+
# uppercase is a utility function that converts file or directory names to
|
|
10
|
+
# uppercase. It supports multiple arguments and provides informative messages
|
|
11
|
+
# for each operation, including errors and successful renames.
|
|
12
|
+
#
|
|
13
|
+
# Usage:
|
|
14
|
+
# uppercase <file_or_directory> [<file_or_directory> ...]
|
|
15
|
+
#
|
|
16
|
+
# Arguments:
|
|
17
|
+
# <file_or_directory> One or more file or directory paths to rename
|
|
18
|
+
# to uppercase.
|
|
19
|
+
#
|
|
20
|
+
# Notes:
|
|
21
|
+
# - This utility will skip renaming files or directories that are already
|
|
22
|
+
# in uppercase.
|
|
23
|
+
# - Invalid or non-existent paths will result in an error message.
|
|
24
|
+
#
|
|
25
|
+
################################################################################
|
|
7
26
|
|
|
8
|
-
# uppercase: Function to move filenames or directory names to uppercase
|
|
9
27
|
uppercase() {
|
|
10
|
-
|
|
11
|
-
|
|
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 uppercase." >&2
|
|
12
31
|
return 1
|
|
13
32
|
fi
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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 uppercase using tr
|
|
45
|
+
uf=$(printf "%s" "${filename}" | tr '[:lower:]' '[:upper:]')
|
|
46
|
+
|
|
47
|
+
# If already uppercase, skip
|
|
48
|
+
if [[ "${filename}" == "${uf}" ]]; then
|
|
49
|
+
echo "[INFO] '${file}' is already in uppercase."
|
|
50
|
+
continue
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
newname="${dirname}/${uf}"
|
|
54
|
+
|
|
55
|
+
if mv "${file}" "${newname}"; then
|
|
56
|
+
echo "[INFO] Renamed '${file}' to '${newname}'."
|
|
25
57
|
else
|
|
26
|
-
echo "[ERROR]
|
|
58
|
+
echo "[ERROR] Failed to rename '${file}'." >&2
|
|
27
59
|
fi
|
|
28
60
|
done
|
|
29
|
-
}
|
|
61
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# π
³π
Ύππ
΅π
Έπ
»π
΄π (v0.2.
|
|
4
|
-
# Made with β₯ in London, UK by
|
|
5
|
-
# Copyright (c) 2015-
|
|
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
|
# view-source: Function to view the source of a website.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# π
³π
Ύππ
΅π
Έπ
»π
΄π (v0.2.
|
|
4
|
-
# Made with β₯ in London, UK by
|
|
5
|
-
# Copyright (c) 2015-
|
|
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
|
# vsc: Function to open a file in Visual Studio Code.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# π
³π
Ύππ
΅π
Έπ
»π
΄π (v0.2.
|
|
4
|
-
# Made with β₯ in London, UK by
|
|
5
|
-
# Copyright (c) 2015-
|
|
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
|
# whoisport: Function to find what is currently using a port.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# π
³π
Ύππ
΅π
Έπ
»π
΄π (v0.2.
|
|
4
|
-
# Made with β₯ in London, UK by
|
|
5
|
-
# Copyright (c) 2015-
|
|
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
|
# zipf: Function to create a ZIP archive of a folder
|
package/dist/lib/functions.sh
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
################################################################################
|
|
4
4
|
# π
³π
Ύππ
΅π
Έπ
»π
΄π
|
|
5
5
|
# Script: functions.sh
|
|
6
|
-
# Version: 0.2.
|
|
7
|
-
# Author:
|
|
8
|
-
# Copyright (c) 2015-
|
|
6
|
+
# Version: 0.2.469
|
|
7
|
+
# Author: Sebastien Rousseau
|
|
8
|
+
# Copyright (c) 2015-2025. All rights reserved
|
|
9
9
|
# Description: Script to load custom executable functions
|
|
10
10
|
# Website: https://dotfiles.io
|
|
11
11
|
# License: MIT
|
|
@@ -23,10 +23,24 @@
|
|
|
23
23
|
# ShellCheck Documentation: https://github.com/koalaman/shellcheck
|
|
24
24
|
|
|
25
25
|
load_custom_functions() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
local functions_dir="${HOME}/.dotfiles/lib/functions"
|
|
27
|
+
|
|
28
|
+
# Check if the directory exists
|
|
29
|
+
if [[ -d "$functions_dir" ]]; then
|
|
30
|
+
for function_file in "$functions_dir"/*.sh; do
|
|
31
|
+
if [[ -f "$function_file" ]]; then
|
|
32
|
+
# shellcheck source=/dev/null
|
|
33
|
+
source "$function_file" || {
|
|
34
|
+
echo "Error: Failed to source $function_file" >&2
|
|
35
|
+
return 1
|
|
36
|
+
}
|
|
37
|
+
fi
|
|
38
|
+
done
|
|
39
|
+
else
|
|
40
|
+
echo "Warning: Functions directory $functions_dir does not exist." >&2
|
|
41
|
+
fi
|
|
30
42
|
}
|
|
31
43
|
|
|
44
|
+
# Main Execution
|
|
45
|
+
# ---------------------------------------------------------
|
|
32
46
|
load_custom_functions
|