@sebastienrousseau/dotfiles 0.2.466 β 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.
- package/README.md +19 -15
- package/dist/Makefile +2 -2
- package/dist/bin/backup.js.map +1 -1
- package/dist/bin/constants.d.ts +2 -2
- package/dist/bin/constants.js +1 -1
- package/dist/bin/dotfiles.d.ts +2 -2
- package/dist/bin/dotfiles.d.ts.map +1 -1
- package/dist/bin/dotfiles.js +1 -2
- package/dist/bin/dotfiles.js.map +1 -1
- package/dist/bin/download.d.ts +2 -2
- package/dist/bin/download.d.ts.map +1 -1
- package/dist/bin/download.js +1 -2
- package/dist/bin/download.js.map +1 -1
- package/dist/bin/index.js +1 -1
- package/dist/bin/index.js.map +1 -1
- package/dist/filesizes.txt +85 -87
- package/dist/lib/README.md +9 -5
- package/dist/lib/aliases/README.md +8 -4
- package/dist/lib/aliases/archives/README.md +29 -26
- package/dist/lib/aliases/archives/archives.aliases.sh +148 -145
- package/dist/lib/aliases/cd/README.md +46 -44
- package/dist/lib/aliases/cd/cd.aliases.sh +63 -29
- package/dist/lib/aliases/chmod/README.md +8 -4
- package/dist/lib/aliases/chmod/chmod.aliases.sh +60 -42
- package/dist/lib/aliases/clear/README.md +8 -4
- package/dist/lib/aliases/clear/clear.aliases.sh +57 -28
- package/dist/lib/aliases/configuration/README.md +8 -4
- package/dist/lib/aliases/configuration/configuration.aliases.sh +56 -30
- package/dist/lib/aliases/default/README.md +8 -4
- package/dist/lib/aliases/default/default.aliases.sh +99 -86
- package/dist/lib/aliases/dig/README.md +8 -4
- package/dist/lib/aliases/dig/dig.aliases.sh +3 -3
- package/dist/lib/aliases/disk-usage/README.md +8 -4
- package/dist/lib/aliases/disk-usage/du.aliases.sh +2 -2
- package/dist/lib/aliases/editor/README.md +8 -4
- package/dist/lib/aliases/editor/editor.aliases.sh +3 -3
- package/dist/lib/aliases/find/README.md +8 -4
- package/dist/lib/aliases/find/find.aliases.sh +3 -3
- package/dist/lib/aliases/gcloud/README.md +8 -4
- package/dist/lib/aliases/gcloud/gcloud.aliases.sh +3 -3
- package/dist/lib/aliases/git/README.md +8 -4
- package/dist/lib/aliases/git/git.aliases.sh +2 -2
- package/dist/lib/aliases/gnu/README.md +8 -4
- package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +1 -1
- package/dist/lib/aliases/heroku/README.md +8 -4
- package/dist/lib/aliases/heroku/heroku.aliases.sh +2 -2
- package/dist/lib/aliases/interactive/README.md +29 -17
- package/dist/lib/aliases/interactive/interactive.aliases.sh +14 -17
- package/dist/lib/aliases/jekyll/README.md +8 -4
- package/dist/lib/aliases/jekyll/jekyll.aliases.sh +3 -3
- package/dist/lib/aliases/list/README.md +8 -4
- package/dist/lib/aliases/list/list.aliases.sh +2 -2
- package/dist/lib/aliases/macOS/README.md +8 -4
- package/dist/lib/aliases/macOS/macos.aliases.sh +2 -2
- package/dist/lib/aliases/make/README.md +8 -4
- package/dist/lib/aliases/make/make.aliases.sh +2 -2
- package/dist/lib/aliases/mkdir/README.md +8 -4
- package/dist/lib/aliases/mkdir/mkdir.aliases.sh +2 -2
- package/dist/lib/aliases/npm/README.md +8 -4
- package/dist/lib/aliases/npm/npm.aliases.sh +2 -2
- package/dist/lib/aliases/permission/README.md +8 -4
- package/dist/lib/aliases/permission/permission.aliases.sh +2 -2
- package/dist/lib/aliases/pnpm/README.md +8 -4
- package/dist/lib/aliases/pnpm/pnpm.aliases.sh +2 -2
- package/dist/lib/aliases/ps/README.md +8 -4
- package/dist/lib/aliases/ps/ps.aliases.sh +2 -2
- package/dist/lib/aliases/rsync/README.md +8 -4
- package/dist/lib/aliases/rsync/rsync.aliases.sh +2 -2
- package/dist/lib/aliases/rust/README.md +8 -4
- package/dist/lib/aliases/rust/rust.aliases.sh +23 -23
- package/dist/lib/aliases/subversion/README.md +8 -4
- package/dist/lib/aliases/subversion/subversion.aliases.sh +2 -2
- package/dist/lib/aliases/sudo/README.md +8 -4
- package/dist/lib/aliases/sudo/sudo.aliases.sh +2 -2
- package/dist/lib/aliases/tmux/README.md +8 -4
- package/dist/lib/aliases/tmux/tmux.aliases.sh +2 -2
- package/dist/lib/aliases/update/README.md +8 -4
- package/dist/lib/aliases/update/update.aliases.sh +2 -2
- package/dist/lib/aliases/uuid/README.md +8 -4
- package/dist/lib/aliases/uuid/uuid.aliases.sh +2 -2
- package/dist/lib/aliases/wget/README.md +8 -4
- package/dist/lib/aliases/wget/wget.aliases.sh +2 -2
- package/dist/lib/aliases.sh +42 -12
- package/dist/lib/configurations/README.md +8 -4
- package/dist/lib/configurations/bash/bashrc +3 -3
- package/dist/lib/configurations/curl/curlrc +2 -2
- package/dist/lib/configurations/default/color.sh +2 -2
- package/dist/lib/configurations/default/constants.sh +3 -3
- package/dist/lib/configurations/default/editor.sh +2 -2
- package/dist/lib/configurations/default/prompt.sh +2 -2
- package/dist/lib/configurations/input/inputrc +2 -2
- package/dist/lib/configurations/nano/nanorc +2 -2
- package/dist/lib/configurations/profile/profile +2 -2
- package/dist/lib/configurations/tmux/default +2 -2
- package/dist/lib/configurations/tmux/display +2 -2
- package/dist/lib/configurations/tmux/linux +2 -2
- package/dist/lib/configurations/tmux/navigation +2 -2
- package/dist/lib/configurations/tmux/panes +2 -2
- package/dist/lib/configurations/tmux/theme +3 -3
- package/dist/lib/configurations/tmux/tmux +2 -2
- package/dist/lib/configurations/vim/vimrc +1 -1
- package/dist/lib/configurations/wget/wgetrc +2 -2
- package/dist/lib/configurations/zsh/zshrc +11 -11
- package/dist/lib/configurations.sh +27 -9
- package/dist/lib/functions/README.md +8 -4
- package/dist/lib/functions/cdls.sh +2 -2
- package/dist/lib/functions/curlheader.sh +2 -2
- package/dist/lib/functions/curlstatus.sh +2 -2
- package/dist/lib/functions/curltime.sh +3 -3
- package/dist/lib/functions/encode64.sh +2 -2
- package/dist/lib/functions/environment.sh +2 -2
- package/dist/lib/functions/extract.sh +2 -2
- package/dist/lib/functions/freespace.sh +2 -2
- package/dist/lib/functions/genpwd.sh +4 -4
- package/dist/lib/functions/goto.sh +2 -2
- package/dist/lib/functions/hidehiddenfiles.sh +2 -2
- package/dist/lib/functions/hostinfo.sh +2 -2
- package/dist/lib/functions/hstats.sh +2 -2
- package/dist/lib/functions/httpdebug.sh +2 -2
- package/dist/lib/functions/keygen.sh +2 -2
- package/dist/lib/functions/last.sh +2 -2
- package/dist/lib/functions/logout.sh +2 -2
- package/dist/lib/functions/lowercase.sh +2 -2
- package/dist/lib/functions/matrix.sh +2 -2
- package/dist/lib/functions/mount_read_only.sh +2 -2
- package/dist/lib/functions/myproc.sh +2 -2
- package/dist/lib/functions/prependpath.sh +2 -2
- package/dist/lib/functions/ql.sh +2 -2
- package/dist/lib/functions/rd.sh +2 -2
- package/dist/lib/functions/remove_disk.sh +2 -2
- package/dist/lib/functions/ren.sh +2 -2
- package/dist/lib/functions/showhiddenfiles.sh +2 -2
- package/dist/lib/functions/size.sh +2 -2
- package/dist/lib/functions/stopwatch.sh +2 -2
- package/dist/lib/functions/uppercase.sh +2 -2
- package/dist/lib/functions/view-source.sh +2 -2
- package/dist/lib/functions/vscode.sh +2 -2
- package/dist/lib/functions/whoisport.sh +2 -2
- package/dist/lib/functions/zipf.sh +2 -2
- package/dist/lib/functions.sh +27 -10
- package/dist/lib/history.sh +58 -21
- package/dist/lib/paths/ant/ant.paths.sh +2 -2
- package/dist/lib/paths/default/default.paths.sh +2 -2
- package/dist/lib/paths/homebrew/homebrew.paths.sh +2 -2
- package/dist/lib/paths/java/java.paths.sh +2 -2
- package/dist/lib/paths/maven/maven.paths.sh +2 -2
- package/dist/lib/paths/node/node.paths.sh +2 -2
- package/dist/lib/paths/nvm/nvm.paths.sh +2 -2
- package/dist/lib/paths/pnpm/pnpm.paths.sh +2 -2
- package/dist/lib/paths/python/python.paths.sh +2 -2
- package/dist/lib/paths/ruby/ruby.paths.sh +2 -2
- package/dist/lib/paths/tmux/tmux.paths.sh +2 -2
- package/dist/lib/paths.sh +28 -12
- package/dist/scripts/backup.sh +2 -2
- package/dist/scripts/banner.sh +2 -2
- package/dist/scripts/build.sh +2 -2
- package/dist/scripts/clean.sh +2 -2
- package/dist/scripts/compile.sh +2 -2
- package/dist/scripts/copy.sh +2 -2
- package/dist/scripts/dotfiles.sh +2 -2
- package/dist/scripts/download.sh +2 -2
- package/dist/scripts/help.sh +2 -2
- package/dist/scripts/ssh.sh +2 -2
- package/dist/scripts/unpack.sh +2 -2
- package/package.json +6 -5
- package/dist/lib/configurations/tmux/vi +0 -9
|
@@ -1,154 +1,157 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
# Copyright (c) 2015-2023. All rights reserved
|
|
6
|
-
# License: MIT
|
|
3
|
+
################################################################################
|
|
4
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π
|
|
7
5
|
# Script: archives.aliases.sh
|
|
8
|
-
# Version: 0.2.
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
alias
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
alias
|
|
125
|
-
alias
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if
|
|
131
|
-
alias
|
|
132
|
-
alias
|
|
133
|
-
fi
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
alias
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
alias
|
|
153
|
-
|
|
154
|
-
|
|
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
|
|
4
|
-
|
|
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.
|
|
12
|
+
# Dotfiles (v0.2.468)
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
Designed to seamlessly enhance your shell environment π
|
|
11
15
|
|
|
12
16
|
![Dotfiles banner][banner]
|
|
13
17
|
|
|
14
18
|
## π
²π
³ π
°π
»π
Έπ
°ππ
΄π
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
navigate your
|
|
18
|
-
|
|
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
|
-
###
|
|
24
|
+
### Setup
|
|
21
25
|
|
|
22
|
-
|
|
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
|
-
###
|
|
28
|
+
### Navigation Shortcuts
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
|
4
|
-
# Description:
|
|
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.
|
|
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
|
-
#
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
#
|
|
22
|
-
alias
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
alias
|
|
26
|
-
alias
|
|
27
|
-
alias
|
|
28
|
-
alias
|
|
29
|
-
alias
|
|
30
|
-
alias
|
|
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
|
|
4
|
-
|
|
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.
|
|
12
|
+
# Dotfiles (v0.2.468)
|
|
9
13
|
|
|
10
14
|
Simply designed to fit your shell life π
|
|
11
15
|
|
|
@@ -1,41 +1,70 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
# License: MIT
|
|
2
|
+
|
|
3
|
+
################################################################################
|
|
4
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π
|
|
6
5
|
# Script: chmod.aliases.sh
|
|
7
|
-
# Version: 0.2.
|
|
6
|
+
# Version: 0.2.468
|
|
7
|
+
# Author: @wwdseb
|
|
8
|
+
# Copyright (c) 2015-2024. All rights reserved
|
|
9
|
+
# Description: Enhanced chmod command aliases with safety features, input validation, and structured organization.
|
|
8
10
|
# Website: https://dotfiles.io
|
|
11
|
+
# License: MIT
|
|
12
|
+
################################################################################
|
|
13
|
+
|
|
14
|
+
# Ensuring chmod command is available
|
|
15
|
+
if command -v chmod >/dev/null; then
|
|
9
16
|
|
|
10
|
-
#
|
|
11
|
-
|
|
17
|
+
# Validate input for permission and path
|
|
18
|
+
function validate_input() {
|
|
19
|
+
local permission="$1"
|
|
20
|
+
local path="$2"
|
|
21
|
+
# Validate permission pattern (e.g., numeric octal)
|
|
22
|
+
if ! [[ ${permission} =~ ^[0-7]{3}$ ]]; then
|
|
23
|
+
echo "Invalid permission format: ${permission}. Expected format: ### (e.g., 644)."
|
|
24
|
+
return 1
|
|
25
|
+
fi
|
|
26
|
+
# Validate path existence
|
|
27
|
+
if ! [[ -e "${path}" ]]; then
|
|
28
|
+
echo "Path does not exist: ${path}."
|
|
29
|
+
return 1
|
|
30
|
+
fi
|
|
31
|
+
return 0
|
|
32
|
+
}
|
|
12
33
|
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
alias 666='chmod -R 666' # 666: (chmod a+rwx,u-x,g-x,o-x) sets permissions so that, (U)ser / owner can read, can write and can't execute. (G)roup can read, can write and can't execute. (O)thers can read, can write and can't execute.
|
|
20
|
-
alias 755='chmod -R 755' # 755: (chmod a+rwx,g-w,o-w) sets permissions so that, (U)ser / owner can read, can write and can execute. (G)roup can read, can't write and can execute. (O)thers can read, can't write and can execute.
|
|
21
|
-
alias 764='chmod -R 764' # 764: (chmod a+rwx,g-x,o-wx) sets permissions so that, (U)ser / owner can read, can write and can execute. (G)roup can read, can write and can't execute. (O)thers can read, can't write and can't execute.
|
|
22
|
-
alias 777='chmod -R 777' # 777: (chmod a+rwx) sets permissions so that, (U)ser / owner can read, can write and can execute. (G)roup can read, can write and can execute. (O)thers can read, can write and can execute.
|
|
34
|
+
# Function to change permissions with confirmation for recursive changes
|
|
35
|
+
function change_permission() {
|
|
36
|
+
local permission="$1"
|
|
37
|
+
local path="$2"
|
|
38
|
+
local recursive="$3"
|
|
39
|
+
local confirm
|
|
23
40
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
alias chmod='chmod -v' # chmod: Change file mode bits.
|
|
29
|
-
alias chmodr='chmod -Rv' # chmodr: Change file mode bits recursively.
|
|
30
|
-
alias chmodu='chmod -Rv u+rwX' # chmodu: Change file mode bits recursively to the current user.
|
|
31
|
-
alias chmox='chmod +x' # chmox: Make a file executable.
|
|
32
|
-
alias chown='chown -v' # chown: Change file owner and group.
|
|
33
|
-
alias chownr='chown -Rv' # chownr: Change file owner and group recursively.
|
|
34
|
-
alias chownu='chown -Rv ${USER}' # chownu: Change file owner and group recursively to the current user.
|
|
41
|
+
# Validate inputs
|
|
42
|
+
if ! validate_input "${permission}" "${path}"; then
|
|
43
|
+
return 1
|
|
44
|
+
fi
|
|
35
45
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
# Confirmation for recursive changes
|
|
47
|
+
if [[ "${recursive}" == "-R" ]]; then
|
|
48
|
+
read -rp "Confirm recursive change to ${permission} for ${path}? (y/N): " confirm
|
|
49
|
+
if [[ ${confirm} != [yY] ]]; then
|
|
50
|
+
echo "Operation cancelled."
|
|
51
|
+
return
|
|
52
|
+
fi
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
chmod "${recursive}" "${permission}" "${path}" && echo "Permissions set to ${permission} on ${path}"
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
# Alias definitions using the function for common permissions
|
|
59
|
+
alias perm000='change_permission 000'
|
|
60
|
+
alias perm400='change_permission 400'
|
|
61
|
+
alias perm444='change_permission 444'
|
|
62
|
+
alias perm600='change_permission 600'
|
|
63
|
+
alias perm644='change_permission 644'
|
|
64
|
+
alias perm666='change_permission 666'
|
|
65
|
+
alias perm755='change_permission 755'
|
|
66
|
+
alias perm764='change_permission 764'
|
|
67
|
+
alias perm777='change_permission 777'
|
|
39
68
|
|
|
40
69
|
# Shortcuts to set permissions for specific user types
|
|
41
70
|
alias u+x='chmod u+x' # u+x: Add execute permission for the owner of the file.
|
|
@@ -59,15 +88,4 @@ if command -v 'chmod' >/dev/null; then
|
|
|
59
88
|
alias o+r='chmod o+r' # o+r: Add read permission for others.
|
|
60
89
|
alias o-r='chmod o-r' # o-r: Remove read permission for others.
|
|
61
90
|
|
|
62
|
-
# Shortcuts to set permissions based on octal notation
|
|
63
|
-
alias 000='chmod 000' # 000: Set permissions to ----------
|
|
64
|
-
alias 400='chmod 400' # 400: Set permissions to r--------
|
|
65
|
-
alias 444='chmod 444' # 444: Set permissions to r--r--r--
|
|
66
|
-
alias 600='chmod 600' # 600: Set permissions to rw-------
|
|
67
|
-
alias 644='chmod 644' # 644: Set permissions to rw-r--r--.
|
|
68
|
-
alias 664='chmod 664' # 664: Set permissions to rw-rw-r--.
|
|
69
|
-
alias 755='chmod 755' # 755: Set permissions to rwxr-xr-x.
|
|
70
|
-
alias 775='chmod 775' # 775: Set permissions to rwxrwxr-x.
|
|
71
|
-
alias 777='chmod 777' # 777: Set permissions to rwxrwxrwx.
|
|
72
|
-
|
|
73
91
|
fi
|