@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,65 +1,146 @@
|
|
|
1
1
|
<!-- markdownlint-disable MD033 MD041 MD043 -->
|
|
2
|
-
|
|
3
2
|
<img
|
|
4
3
|
src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
|
|
5
|
-
alt="
|
|
6
|
-
width="
|
|
4
|
+
alt="Dotfiles logo"
|
|
5
|
+
width="66"
|
|
7
6
|
align="right"
|
|
8
7
|
/>
|
|
9
|
-
|
|
10
8
|
<!-- markdownlint-enable MD033 MD041 -->
|
|
11
9
|
|
|
12
|
-
# Dotfiles (v0.2.
|
|
10
|
+
# Dotfiles (v0.2.469)
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
Seamlessly enhance your shell environment 🐚
|
|
15
13
|
|
|
16
14
|
![Dotfiles banner][banner]
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🚀 Introduction
|
|
19
|
+
|
|
20
|
+
This repository includes a robust set of shell aliases and scripts designed to
|
|
21
|
+
streamline your command-line experience. The `cd` aliases script simplifies
|
|
22
|
+
filesystem navigation with:
|
|
23
|
+
|
|
24
|
+
- **Dynamic error handling**
|
|
25
|
+
- **Automatic directory listing**
|
|
26
|
+
- **Customizable paths for frequent directories**
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 🛠️ Features
|
|
31
|
+
|
|
32
|
+
### 🌟 Navigation Shortcuts
|
|
33
|
+
|
|
34
|
+
| Alias | Description |
|
|
35
|
+
|------------------|--------------------------------------|
|
|
36
|
+
| `-` | Switch to the previous directory |
|
|
37
|
+
| `..`, `...` | Ascend one or two levels in the tree |
|
|
38
|
+
| `....`, `.....` | Ascend three or four levels |
|
|
39
|
+
| `hom` | Navigate to the home directory (`~`) |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### 📂 Custom Directory Access
|
|
44
|
+
|
|
45
|
+
Quickly access frequently used directories with predefined shortcuts. You can
|
|
46
|
+
customize these paths to fit your needs:
|
|
47
|
+
|
|
48
|
+
| Alias | Directory Path | Description |
|
|
49
|
+
|-------|--------------------------|------------------------|
|
|
50
|
+
| `app` | `${HOME}/Applications` | Applications directory |
|
|
51
|
+
| `cod` | `${HOME}/Code` | Code directory |
|
|
52
|
+
| `des` | `${HOME}/Desktop` | Desktop directory |
|
|
53
|
+
| `doc` | `${HOME}/Documents` | Documents directory |
|
|
54
|
+
| `dot` | `${HOME}/.dotfiles` | Dotfiles directory |
|
|
55
|
+
| `dow` | `${HOME}/Downloads` | Downloads directory |
|
|
56
|
+
| `mus` | `${HOME}/Music` | Music directory |
|
|
57
|
+
| `pic` | `${HOME}/Pictures` | Pictures directory |
|
|
58
|
+
| `vid` | `${HOME}/Videos` | Videos directory |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### 🔧 System Directories
|
|
63
|
+
|
|
64
|
+
Effortlessly navigate to critical system directories:
|
|
65
|
+
|
|
66
|
+
| Alias | Directory Path | Description |
|
|
67
|
+
|-------|----------------|--------------------------------|
|
|
68
|
+
| `etc` | `/etc` | System configuration directory |
|
|
69
|
+
| `var` | `/var` | Variable files directory |
|
|
70
|
+
| `tmp` | `/tmp` | Temporary files directory |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### ⚙️ Enhanced Customization
|
|
75
|
+
|
|
76
|
+
- **Dynamic Directory Paths**: Customize aliases through environment variables
|
|
77
|
+
- **Error Handling**: Provides clear messages for invalid directories
|
|
78
|
+
- **Optional Directory Listing**: Automatically lists contents after navigation
|
|
79
|
+
- **Tab Completion**: Supports custom tab completion for aliases
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 📦 Installation
|
|
84
|
+
|
|
85
|
+
1. **Clone the repository**:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git clone https://github.com/sebastienrousseau/dotfiles.git
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
1. **Source the script in your shell configuration**:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
echo 'source /path/to/dotfiles/cd.sh' >> ~/.bashrc
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
1. **Reload your shell**:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
source ~/.bashrc
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 🧑💻 Usage
|
|
106
|
+
|
|
107
|
+
Here are some examples of how you can use the `cd` aliases:
|
|
19
108
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
109
|
+
```bash
|
|
110
|
+
# Navigate to the Code directory
|
|
111
|
+
cod
|
|
23
112
|
|
|
24
|
-
|
|
113
|
+
# Ascend two levels in the directory tree
|
|
114
|
+
...
|
|
25
115
|
|
|
26
|
-
|
|
116
|
+
# Access the Documents directory
|
|
117
|
+
doc
|
|
27
118
|
|
|
28
|
-
|
|
119
|
+
# Navigate to the system configuration directory
|
|
120
|
+
etc
|
|
121
|
+
```
|
|
29
122
|
|
|
30
|
-
|
|
31
|
-
* `..`, `...`, `....`, `.....`: Ascend one to four levels in the directory tree.
|
|
32
|
-
* `~`: Navigate to the home directory.
|
|
123
|
+
---
|
|
33
124
|
|
|
34
|
-
|
|
125
|
+
## 📚 Documentation
|
|
35
126
|
|
|
36
|
-
|
|
127
|
+
For advanced configuration and detailed usage examples, visit the
|
|
128
|
+
[official documentation](https://dotfiles.io).
|
|
37
129
|
|
|
38
|
-
|
|
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
|
|
130
|
+
---
|
|
47
131
|
|
|
48
|
-
|
|
132
|
+
## 🛡️ License
|
|
49
133
|
|
|
50
|
-
|
|
134
|
+
This project is licensed under the
|
|
135
|
+
[MIT License](https://opensource.org/licenses/MIT).
|
|
51
136
|
|
|
52
|
-
|
|
53
|
-
* `var`: Variable files (`/var`)
|
|
54
|
-
* `tmp`: Temporary files (`/tmp`)
|
|
137
|
+
---
|
|
55
138
|
|
|
56
|
-
|
|
139
|
+
## 👨💻 Author
|
|
57
140
|
|
|
58
|
-
|
|
59
|
-
structure and preferences. Use concise aliases (`app`, `cod`, `des`, etc.) for
|
|
60
|
-
efficient navigation.
|
|
141
|
+
Created with ♥ by [Sebastien Rousseau](https://sebastienrousseau.com)
|
|
61
142
|
|
|
62
|
-
|
|
63
|
-
|
|
143
|
+
- Website: [https://sebastienrousseau.com](https://sebastienrousseau.com)
|
|
144
|
+
- GitHub: [https://github.com/sebastienrousseau](https://github.com/sebastienrousseau)
|
|
64
145
|
|
|
65
146
|
[banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
|
|
@@ -1,56 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
2
|
################################################################################
|
|
4
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂
|
|
5
|
-
#
|
|
6
|
-
# Copyright: 2015-2024. All rights reserved
|
|
7
|
-
# Description: Enhanced `cd` command aliases with checks, functions, and customization.
|
|
3
|
+
# 🅳🅾🆃🅵🅸🅻🅴🆂 - Change directory aliases
|
|
4
|
+
# Made with ♥ by Sebastien Rousseau
|
|
8
5
|
# License: MIT
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
# Website: https://dotfiles.io
|
|
12
|
-
|
|
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.
|
|
16
|
-
|
|
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"
|
|
25
|
-
|
|
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 -'
|
|
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'
|
|
6
|
+
# This script provides aliases to quickly change directories.
|
|
7
|
+
################################################################################
|
|
52
8
|
|
|
53
|
-
|
|
9
|
+
#-----------------------------------------------------------------------------
|
|
10
|
+
# Frequently Used Directory Variables
|
|
11
|
+
#-----------------------------------------------------------------------------
|
|
12
|
+
HOME_DIR="${HOME}"
|
|
54
13
|
APP_DIR="${HOME}/Applications"
|
|
55
14
|
CODE_DIR="${HOME}/Code"
|
|
56
15
|
DESK_DIR="${HOME}/Desktop"
|
|
@@ -61,13 +20,32 @@ MUSIC_DIR="${HOME}/Music"
|
|
|
61
20
|
PICS_DIR="${HOME}/Pictures"
|
|
62
21
|
VIDS_DIR="${HOME}/Videos"
|
|
63
22
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
alias
|
|
68
|
-
alias
|
|
69
|
-
alias
|
|
70
|
-
alias
|
|
71
|
-
alias
|
|
72
|
-
|
|
73
|
-
|
|
23
|
+
#-----------------------------------------------------------------------------
|
|
24
|
+
# Parent Directory Shortcuts
|
|
25
|
+
#-----------------------------------------------------------------------------
|
|
26
|
+
alias -- -='cd -' # Go to the previous directory
|
|
27
|
+
alias ..='cd ..' # Go up one level
|
|
28
|
+
alias ...='cd ../..' # Go up two levels
|
|
29
|
+
alias ....='cd ../../..' # Go up three levels
|
|
30
|
+
alias .....='cd ../../../..' # Go up four levels
|
|
31
|
+
|
|
32
|
+
#-----------------------------------------------------------------------------
|
|
33
|
+
# Home and Frequently Used Directories
|
|
34
|
+
#-----------------------------------------------------------------------------
|
|
35
|
+
alias app="cd ${APP_DIR} && ls -lh --group-directories-first" # Applications
|
|
36
|
+
alias cod="cd ${CODE_DIR} && ls -lh --group-directories-first" # Code
|
|
37
|
+
alias des="cd ${DESK_DIR} && ls -lh --group-directories-first" # Desktop
|
|
38
|
+
alias doc="cd ${DOCS_DIR} && ls -lh --group-directories-first" # Documents
|
|
39
|
+
alias dot="cd ${DOTF_DIR} && ls -lh --group-directories-first" # Dotfiles
|
|
40
|
+
alias dow="cd ${DOWN_DIR} && ls -lh --group-directories-first" # Downloads
|
|
41
|
+
alias hom="cd ${HOME_DIR} && ls -lh --group-directories-first" # Home Directory
|
|
42
|
+
alias mus="cd ${MUSIC_DIR} && ls -lh --group-directories-first" # Music
|
|
43
|
+
alias pic="cd ${PICS_DIR} && ls -lh --group-directories-first" # Pictures
|
|
44
|
+
alias vid="cd ${VIDS_DIR} && ls -lh --group-directories-first" # Videos
|
|
45
|
+
|
|
46
|
+
#-----------------------------------------------------------------------------
|
|
47
|
+
# System Directories
|
|
48
|
+
#-----------------------------------------------------------------------------
|
|
49
|
+
[[ -d "/etc" ]] && alias etc="cd /etc && ls -lh --group-directories-first" # System configuration
|
|
50
|
+
[[ -d "/var" ]] && alias var="cd /var && ls -lh --group-directories-first" # Variable data
|
|
51
|
+
[[ -d "/tmp" ]] && alias tmp="cd /tmp && ls -lh --group-directories-first" # Temporary files
|
|
@@ -1,109 +1,160 @@
|
|
|
1
1
|
<!-- markdownlint-disable MD033 MD041 MD043 -->
|
|
2
|
-
|
|
3
2
|
<img
|
|
4
3
|
src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
|
|
5
|
-
alt="
|
|
6
|
-
width="
|
|
4
|
+
alt="Dotfiles logo"
|
|
5
|
+
width="66"
|
|
7
6
|
align="right"
|
|
8
7
|
/>
|
|
9
|
-
|
|
10
8
|
<!-- markdownlint-enable MD033 MD041 -->
|
|
11
9
|
|
|
12
|
-
# Dotfiles (v0.2.
|
|
10
|
+
# Dotfiles (v0.2.469)
|
|
13
11
|
|
|
14
12
|
Simply designed to fit your shell life 🐚
|
|
15
13
|
|
|
16
14
|
![Dotfiles banner][banner]
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🚀 Introduction
|
|
19
|
+
|
|
20
|
+
This script provides an enhanced set of shortcuts and functions for the
|
|
21
|
+
`chmod` command, making it easier to manage file and directory permissions.
|
|
22
|
+
With features like input validation, recursive confirmation, and user-friendly
|
|
23
|
+
aliases, you can efficiently customize permissions for files and directories.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 🛠️ Features
|
|
28
|
+
|
|
29
|
+
### 🌟 Permission Aliases
|
|
30
|
+
|
|
31
|
+
Quickly apply common permission settings with pre-defined aliases:
|
|
32
|
+
|
|
33
|
+
| Alias | Permissions | Description |
|
|
34
|
+
|--------------|------------------|-------------------------------------------|
|
|
35
|
+
| `chmod_000` | `----------` | No permissions for anyone |
|
|
36
|
+
| `chmod_400` | `r--------` | Read-only for the owner |
|
|
37
|
+
| `chmod_444` | `r--r--r--` | Read-only for everyone |
|
|
38
|
+
| `chmod_600` | `rw-------` | Read/write for the owner |
|
|
39
|
+
| `chmod_644` | `rw-r--r--` | Read/write for the owner, read-only other |
|
|
40
|
+
| `chmod_666` | `rw-rw-rw-` | Read/write for everyone |
|
|
41
|
+
| `chmod_755` | `rwxr-xr-x` | Full owner, read/execute for others |
|
|
42
|
+
| `chmod_764` | `rwxrw-r--` | Full owner, read/write for the group, |
|
|
43
|
+
| `chmod_777` | `rwxrwxrwx` | Full permissions for everyone |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### 🔧 Recursive Confirmation for Permissions
|
|
48
|
+
|
|
49
|
+
The `change_permission` function allows you to recursively apply permissions
|
|
50
|
+
with a confirmation prompt, displaying the number of items affected:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
change_permission 755 /path/to/directory -R
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### 📂 User, Group, and Others Shortcuts
|
|
59
|
+
|
|
60
|
+
Fine-tune permissions for specific user groups (owner, group, or others):
|
|
61
|
+
|
|
62
|
+
| Alias | Description |
|
|
63
|
+
|---------------|--------------------------------------------|
|
|
64
|
+
| `chmod_u+x` | Add execute permission for the owner |
|
|
65
|
+
| `chmod_u-x` | Remove execute permission for the owner |
|
|
66
|
+
| `chmod_u+w` | Add write permission for the owner |
|
|
67
|
+
| `chmod_u-w` | Remove write permission for the owner |
|
|
68
|
+
| `chmod_u+r` | Add read permission for the owner |
|
|
69
|
+
| `chmod_u-r` | Remove read permission for the owner |
|
|
70
|
+
| `chmod_g+x` | Add execute permission for the group |
|
|
71
|
+
| `chmod_g-x` | Remove execute permission for the group |
|
|
72
|
+
| `chmod_g+w` | Add write permission for the group |
|
|
73
|
+
| `chmod_g-w` | Remove write permission for the group |
|
|
74
|
+
| `chmod_g+r` | Add read permission for the group |
|
|
75
|
+
| `chmod_g-r` | Remove read permission for the group |
|
|
76
|
+
| `chmod_o+x` | Add execute permission for others |
|
|
77
|
+
| `chmod_o-x` | Remove execute permission for others |
|
|
78
|
+
| `chmod_o+w` | Add write permission for others |
|
|
79
|
+
| `chmod_o-w` | Remove write permission for others |
|
|
80
|
+
| `chmod_o+r` | Add read permission for others |
|
|
81
|
+
| `chmod_o-r` | Remove read permission for others |
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### 📄 Custom Aliases for File Types
|
|
86
|
+
|
|
87
|
+
Set permissions for specific file types with ease:
|
|
88
|
+
|
|
89
|
+
| Alias | Description |
|
|
90
|
+
|--------------|----------------------------------------------------|
|
|
91
|
+
| `chmod_755d` | Set permissions of all directories to `rwxr-xr-x` |
|
|
92
|
+
| `chmod_644f` | Set permissions of all files to `rw-r--r--` |
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 📦 Installation
|
|
97
|
+
|
|
98
|
+
1. Clone this repository:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
git clone https://github.com/sebastienrousseau/dotfiles.git
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
2. Source the script in your shell configuration file:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
echo 'source /path/to/dotfiles/chmod.sh' >> ~/.bashrc
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
3. Reload your shell:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
source ~/.bashrc
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 🧑💻 Usage
|
|
119
|
+
|
|
120
|
+
Here are some examples of how to use the `chmod` aliases and functions:
|
|
121
|
+
|
|
122
|
+
- Apply common permissions:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
chmod_644 /path/to/file
|
|
126
|
+
chmod_755 /path/to/directory
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- Modify user, group, or others' permissions:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
chmod_u+x /path/to/script
|
|
133
|
+
chmod_g-w /path/to/file
|
|
134
|
+
chmod_o+r /path/to/file
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- Recursively set permissions with confirmation:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
change_permission 755 /path/to/directory -R
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 🛡️ License
|
|
146
|
+
|
|
147
|
+
This project is licensed under the
|
|
148
|
+
[MIT License](https://opensource.org/licenses/MIT). See the `LICENSE` file for
|
|
149
|
+
more information.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 👨💻 Author
|
|
154
|
+
|
|
155
|
+
Created with ♥ by [Sebastien Rousseau](https://sebastienrousseau.com)
|
|
156
|
+
|
|
157
|
+
- Website: [https://sebastienrousseau.com](https://sebastienrousseau.com)
|
|
158
|
+
- GitHub: [https://github.com/sebastienrousseau](https://github.com/sebastienrousseau)
|
|
108
159
|
|
|
109
160
|
[banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
|