@sebastienrousseau/dotfiles 0.2.453 → 0.2.455
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 +175 -161
- package/package.json +40 -28
- package/COPYRIGHT +0 -5
- package/Makefile +0 -79
- package/bin/dotfiles.sh +0 -157
- package/index.js +0 -24
- package/pnpm-lock.yaml +0 -232
- package/pnpm-workspace.yaml +0 -2
- package/shell/README.md +0 -3
- package/shell/aliases/default/README.md +0 -0
- package/shell/aliases/default/default.aliases.sh +0 -199
- package/shell/aliases/gcloud/gcloud.aliases.sh +0 -121
- package/shell/aliases/git/git.aliases.wip +0 -586
- package/shell/aliases/heroku/heroku.aliases.sh +0 -1031
- package/shell/aliases/jekyll/jekyll.aliases.sh +0 -50
- package/shell/aliases/pnpm/pnpm.aliases.sh +0 -42
- package/shell/aliases/subversion/subversion.aliases.sh +0 -123
- package/shell/aliases/tmux/tmux.aliases.sh +0 -14
- package/shell/aliases.sh +0 -12
- package/shell/configurations/README.md +0 -3
- package/shell/configurations/bash/bashrc +0 -36
- package/shell/configurations/curl/cacert.pem +0 -3460
- package/shell/configurations/curl/curlrc +0 -55
- package/shell/configurations/default/color.sh +0 -17
- package/shell/configurations/default/editor.sh +0 -16
- package/shell/configurations/default/prompt.sh +0 -37
- package/shell/configurations/inputrc/inputrc +0 -22
- package/shell/configurations/jshint/jshintrc +0 -37
- package/shell/configurations/profile/profile +0 -36
- package/shell/configurations/tmux/tmux +0 -95
- package/shell/configurations/vim/vimrc +0 -73
- package/shell/configurations/wget/wgetrc +0 -39
- package/shell/configurations/zsh/zshrc +0 -50
- package/shell/configurations.sh +0 -10
- package/shell/exit.sh +0 -9
- package/shell/functions/README.md +0 -3
- package/shell/functions/cdls.sh +0 -19
- package/shell/functions/changediskpwd.wip +0 -19
- package/shell/functions/code.wip +0 -18
- package/shell/functions/countdown.wip +0 -33
- package/shell/functions/curlheader.sh +0 -20
- package/shell/functions/curltime.sh +0 -31
- package/shell/functions/encode64.sh +0 -25
- package/shell/functions/environment.sh +0 -37
- package/shell/functions/extract.sh +0 -32
- package/shell/functions/filehead.sh +0 -4
- package/shell/functions/genpwd.sh +0 -14
- package/shell/functions/goto.sh +0 -14
- package/shell/functions/headers.wip +0 -4
- package/shell/functions/hidehiddenfiles.sh +0 -12
- package/shell/functions/history-all.wip +0 -7
- package/shell/functions/hostinfo.sh +0 -25
- package/shell/functions/hstats.sh +0 -9
- package/shell/functions/httpdebug.sh +0 -7
- package/shell/functions/keygen.sh +0 -23
- package/shell/functions/last.sh +0 -9
- package/shell/functions/logout.sh +0 -10
- package/shell/functions/lowercase.sh +0 -28
- package/shell/functions/macos.sh +0 -47
- package/shell/functions/matrix.sh +0 -9
- package/shell/functions/mcd.sh +0 -18
- package/shell/functions/mount_read_only.sh +0 -9
- package/shell/functions/myproc.sh +0 -7
- package/shell/functions/prependpath.sh +0 -19
- package/shell/functions/print.wip +0 -13
- package/shell/functions/ql.sh +0 -7
- package/shell/functions/rd.sh +0 -15
- package/shell/functions/remove_disk.sh +0 -9
- package/shell/functions/ren.sh +0 -11
- package/shell/functions/rm.wip +0 -13
- package/shell/functions/rps.wip +0 -103
- package/shell/functions/showhiddenfiles.sh +0 -12
- package/shell/functions/size.sh +0 -13
- package/shell/functions/stopwatch.sh +0 -13
- package/shell/functions/trash.wip +0 -13
- package/shell/functions/tree.wip +0 -13
- package/shell/functions/uppercase.sh +0 -28
- package/shell/functions/uuidgen.wip +0 -27
- package/shell/functions/view-source.sh +0 -8
- package/shell/functions/vscode.sh +0 -31
- package/shell/functions/whoisport.sh +0 -12
- package/shell/functions/zipf.sh +0 -14
- package/shell/functions.sh +0 -10
- package/shell/history.sh +0 -107
- package/shell/paths/ant/ant.paths.sh +0 -15
- package/shell/paths/default/default.paths.sh +0 -17
- package/shell/paths/homebrew/homebrew.paths.sh +0 -25
- package/shell/paths/java/java.paths.sh +0 -16
- package/shell/paths/maven/maven.paths.sh +0 -17
- package/shell/paths/node/node.paths.sh +0 -13
- package/shell/paths/nvm/nvm.paths.sh +0 -21
- package/shell/paths/pnpm/pnpm.paths.sh +0 -13
- package/shell/paths/python/python.paths.sh +0 -19
- package/shell/paths/ruby/ruby.paths.sh +0 -23
- package/shell/paths/tmux/tmux.paths.sh +0 -14
- package/shell/paths.sh +0 -12
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# encode64: Function to encode a string to base64.
|
|
7
|
-
encode64() {
|
|
8
|
-
if [[ $# -eq 0 ]]; then
|
|
9
|
-
cat | base64
|
|
10
|
-
else
|
|
11
|
-
printf '%s' "$1" | base64 | base64
|
|
12
|
-
fi
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
# decode64: Function to decode a base64 string.
|
|
16
|
-
decode64() {
|
|
17
|
-
if [[ $# -eq 0 ]]; then
|
|
18
|
-
cat | base64 --decode
|
|
19
|
-
else
|
|
20
|
-
printf '%s\n' "$1" | base64 | base64 --decode
|
|
21
|
-
fi
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
alias e64=encode64 # Encode to base64.
|
|
25
|
-
alias d64=decode64 # Decode from base64.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# environment: Function to detect the current environment
|
|
7
|
-
environment ()
|
|
8
|
-
{
|
|
9
|
-
# Define a fallback `OS`
|
|
10
|
-
LOCAL_OS="other"
|
|
11
|
-
|
|
12
|
-
# Mac
|
|
13
|
-
if [[ "$(uname -s | grep -c Darwin)" -gt 0 ]] || true; then
|
|
14
|
-
LOCAL_OS="mac"
|
|
15
|
-
|
|
16
|
-
# Linux
|
|
17
|
-
elif [[ "$(uname -s | grep -c Linux)" -gt 0 ]] || true; then
|
|
18
|
-
LOCAL_OS="linux"
|
|
19
|
-
|
|
20
|
-
# Windows via MING
|
|
21
|
-
elif [[ "$(uname -s | grep -c MING)" -gt 0 ]] || true; then
|
|
22
|
-
LOCAL_OS="win"
|
|
23
|
-
|
|
24
|
-
# Cygwin
|
|
25
|
-
elif [[ "$(uname -s | grep -c Cygwin)" -gt 0 ]] || true; then
|
|
26
|
-
LOCAL_OS="win"
|
|
27
|
-
|
|
28
|
-
# Cygwin via Babun
|
|
29
|
-
elif [[ "$(uname -s | grep -c CYGWIN)" -gt 0 ]] || true; then
|
|
30
|
-
LOCAL_OS="win"
|
|
31
|
-
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
# Output the result
|
|
35
|
-
echo "${LOCAL_OS}"
|
|
36
|
-
|
|
37
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# extract: Function to extract most know archives with one command
|
|
7
|
-
extract() {
|
|
8
|
-
if [[ "$#" != 1 ]]; then
|
|
9
|
-
echo "[ERROR] Please add one argument" >&2
|
|
10
|
-
return 1
|
|
11
|
-
fi
|
|
12
|
-
|
|
13
|
-
if [[ -f "$1" ]]; then
|
|
14
|
-
echo "[INFO] Extracting $1"
|
|
15
|
-
case $1 in
|
|
16
|
-
*.tar.bz2) tar xjf "$1" ;;
|
|
17
|
-
*.tar.gz) tar xzf "$1" ;;
|
|
18
|
-
*.bz2) bunzip2 "$1" ;;
|
|
19
|
-
*.rar) unrar e "$1" ;;
|
|
20
|
-
*.gz) gunzip "$1" ;;
|
|
21
|
-
*.tar) tar xf "$1" ;;
|
|
22
|
-
*.tbz2) tar xjf "$1" ;;
|
|
23
|
-
*.tgz) tar xzf "$1" ;;
|
|
24
|
-
*.zip) unzip "$1" ;;
|
|
25
|
-
*.Z) uncompress "$1" ;;
|
|
26
|
-
*.7z) 7z x "$1" ;;
|
|
27
|
-
*) echo "[ERROR] '$1' cannot be extracted via extract()" ;;
|
|
28
|
-
esac
|
|
29
|
-
else
|
|
30
|
-
echo "[ERROR] '$1' is not a valid file"
|
|
31
|
-
fi
|
|
32
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# genpwd: Function to generates a strong random password of 20 characters (similar to Apple)
|
|
7
|
-
genpwd() {
|
|
8
|
-
m=$(openssl rand -base64 32 | cut -c 1-6);
|
|
9
|
-
a=$(openssl rand -base64 32 | cut -c 1-6);
|
|
10
|
-
c=$(openssl rand -base64 32 | cut -c 1-6);
|
|
11
|
-
pwd="$m-$a-$c";
|
|
12
|
-
echo "[INFO] The password has been copied to the clipboard: $pwd"
|
|
13
|
-
echo "$pwd"| pbcopy | pbpaste;
|
|
14
|
-
}
|
package/shell/functions/goto.sh
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# goto: Function to change to the directory inputed
|
|
7
|
-
goto() {
|
|
8
|
-
if [[ -e "$1" ]]; then
|
|
9
|
-
cd "$1" || exit
|
|
10
|
-
l
|
|
11
|
-
else
|
|
12
|
-
echo "[ERROR] Please add a directory name" >&2
|
|
13
|
-
fi
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# Hide hidden system and dotfile files
|
|
7
|
-
hidehiddenfiles() {
|
|
8
|
-
defaults write com.apple.Finder AppleShowAllFiles NO
|
|
9
|
-
osascript -e 'tell application "Finder" to quit'
|
|
10
|
-
sleep 0.25
|
|
11
|
-
osascript -e 'tell application "Finder" to activate'
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# hostinfo: Function to display useful host related informaton
|
|
7
|
-
hostinfo() {
|
|
8
|
-
echo "You are logged on"
|
|
9
|
-
$HOST
|
|
10
|
-
echo "Additionnal information: "
|
|
11
|
-
uname -a
|
|
12
|
-
echo "Users logged on: "
|
|
13
|
-
w -h
|
|
14
|
-
echo "Current date : "
|
|
15
|
-
date
|
|
16
|
-
echo "Machine stats : "
|
|
17
|
-
uptime
|
|
18
|
-
echo "Current network location : "
|
|
19
|
-
scselect
|
|
20
|
-
echo "Public facing IP Address : "
|
|
21
|
-
myip
|
|
22
|
-
echo "DNS Configuration: "
|
|
23
|
-
scutil --dns
|
|
24
|
-
echo
|
|
25
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# hstats: Function to display Ze Shell history stats informaton
|
|
7
|
-
hstats() {
|
|
8
|
-
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
|
|
9
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# httpdebug: Function to download a web page and show info on what took time
|
|
7
|
-
httpdebug() { /usr/bin/curl "$@" -o /dev/null -w "dns: %{time_namelookup} connect: %{time_connect} pretransfer: %{time_pretransfer} starttransfer: %{time_starttransfer} total: %{time_total}\\n"; }
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# keygen: Function to generates SSH key
|
|
7
|
-
keygen() {
|
|
8
|
-
|
|
9
|
-
echo "What's the name of the Key (no space please) ? "
|
|
10
|
-
read -r name
|
|
11
|
-
|
|
12
|
-
echo "What's the email associated with it? "
|
|
13
|
-
read -r email
|
|
14
|
-
|
|
15
|
-
ssh-keygen -t rsa -f ~/.ssh/id_rsa_"${name}" -C "${email}"
|
|
16
|
-
|
|
17
|
-
ssh-add ~/.ssh/id_rsa_"${name}"
|
|
18
|
-
|
|
19
|
-
pbcopy <~/.ssh/id_rsa_"${name}".pub
|
|
20
|
-
|
|
21
|
-
echo "[INFO] SSH Key id_rsa_$(name).pub copied in your clipboard"
|
|
22
|
-
|
|
23
|
-
}
|
package/shell/functions/last.sh
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# logout: Function to logout from OS X via the Terminal
|
|
7
|
-
logout() {
|
|
8
|
-
osascript -e 'tell application "System Events" to log out'
|
|
9
|
-
builtin logout
|
|
10
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# lowercase: Function to move filenames or directory names to lowercase
|
|
7
|
-
lowercase()
|
|
8
|
-
{
|
|
9
|
-
if [[ "$#" != 1 ]]; then
|
|
10
|
-
echo "[ERROR] The filename or directory name is incorrect." >&2
|
|
11
|
-
return 1
|
|
12
|
-
fi
|
|
13
|
-
for file ; do
|
|
14
|
-
filename=${file##*/}
|
|
15
|
-
case "${filename}" in
|
|
16
|
-
*/*) [[ "dirname" = "${file%/*}" ]] ;;
|
|
17
|
-
*) dirname=.;;
|
|
18
|
-
esac
|
|
19
|
-
nf=$(echo "${filename}" | tr '[:upper:]' '[:lower:]')
|
|
20
|
-
newname="${dirname}/${nf}"
|
|
21
|
-
if [[ "${nf}" != "${filename}" ]]; then
|
|
22
|
-
mv "${file}" "${newname}"
|
|
23
|
-
echo "[INFO] Renaming ${file} to lowercase: ${newname}"
|
|
24
|
-
else
|
|
25
|
-
echo "[ERROR] The operation is not valid, ${file} has not changed."
|
|
26
|
-
fi
|
|
27
|
-
done
|
|
28
|
-
}
|
package/shell/functions/macos.sh
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# 🅼🅰🅲🅾🆂 🅿🅻🆄🅶🅸🅽🅶 🅰🅻🅸🅰🆂🅴🆂
|
|
7
|
-
|
|
8
|
-
alias clds='find . -type f -name "*.DS_Store" -ls -delete' # clds: Recursively delete .DS_Store files.
|
|
9
|
-
alias clls='/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder' # clls: Clean up LaunchServices to remove duplicates in the 'Open With' menu.
|
|
10
|
-
alias emptytrash='rm -rf ~/.Trash/*' # Empty the Trash on all mounted volumes and the main HDD.
|
|
11
|
-
alias finderHideHidden='defaults write com.apple.finder ShowAllFiles FALSE' # finderHideHidden: Hide hidden files in Finder.
|
|
12
|
-
alias finderShowHidden='defaults write com.apple.finder ShowAllFiles TRUE' # finderShowHidden: Show hidden files in Finder.
|
|
13
|
-
alias iphone='open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app' # iphone: Open the device simulators.
|
|
14
|
-
alias noDS='defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true'
|
|
15
|
-
alias ofd='open $PWD' # Open the current directory in a Finder window.
|
|
16
|
-
alias purge='rm -rf ~/library/Developer/Xcode/DerivedData/*' # purge: Purging Xcode DerivedData.
|
|
17
|
-
alias screensaverDesktop='/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background' # screensaverDesktop: Run a screensaver on the Desktop.
|
|
18
|
-
alias vp='diskutil verifyPermissions /' # vp: Verify macOS Permissions.
|
|
19
|
-
alias vv='diskutil verifyvolume /' # vv: Verify macOS Volume.
|
|
20
|
-
alias xcode='open -a xcode' # xcode: Launch XCode app in macOS.
|
|
21
|
-
|
|
22
|
-
# 🅼🅰🅲🅾🆂 🅿🅻🆄🅶🅸🅽🅶 🅵🆄🅽🅲🆃🅸🅾🅽🆂
|
|
23
|
-
|
|
24
|
-
# Erases purgeable disk space with 0s on the selected disk
|
|
25
|
-
freespace(){
|
|
26
|
-
if [[ -z "$1" ]]; then
|
|
27
|
-
echo "Usage: $0 <disk>"
|
|
28
|
-
echo "Example: $0 /dev/disk1s1"
|
|
29
|
-
echo
|
|
30
|
-
echo "Possible disks:"
|
|
31
|
-
df -h | awk 'NR == 1 || /^\/dev\/disk/'
|
|
32
|
-
return 1
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
echo "Cleaning purgeable files from disk: $1 ...."
|
|
36
|
-
diskutil secureErase freespace 0 "$1"
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
mp() {
|
|
40
|
-
# Don't let Preview.app steal focus if the man page doesn't exist
|
|
41
|
-
man -w "$@" > /dev/null 2>&1 || man -t "$@" | open -f -a Preview || man "$@"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
ql() {
|
|
45
|
-
(( $# > 0 )) && qlmanage -p "$*" &>/dev/null &
|
|
46
|
-
}
|
|
47
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# matrix: Function to Enable Matrix Effect in the terminal
|
|
7
|
-
matrix() {
|
|
8
|
-
echo -e "\\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( RANDOM % COLUMNS)) $(( RANDOM % 72 )) ;sleep 0.05; 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; } }}'
|
|
9
|
-
}
|
package/shell/functions/mcd.sh
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# mcd: Function to combine mkdir and cd.
|
|
7
|
-
mcd() {
|
|
8
|
-
if [[ "$#" != 1 ]]; then
|
|
9
|
-
echo "[ERROR] Please add one argument" >&2
|
|
10
|
-
return 1
|
|
11
|
-
fi
|
|
12
|
-
echo "[INFO] Creating the folder $1"
|
|
13
|
-
mkdir "$1"
|
|
14
|
-
echo "[INFO] Switching to $1 folder"
|
|
15
|
-
cd "$1" || exit
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
alias mkcd='mcd' # Alias for mcd
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# mount_read_only: Function to mount a read-only disk image as read-write
|
|
7
|
-
mount_read_only() {
|
|
8
|
-
hdiutil attach "$1" -shadow /tmp/"$1".shadow -noverify
|
|
9
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# myproc: Function to list processes owned by an user
|
|
7
|
-
myproc() { ps "$@" -u "${USER}" -o pid,%cpu,%mem,start,time,bsdtime,command; }
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# ----------------------------------------------------------------------------
|
|
7
|
-
# 1.0 Setting PATH environments.
|
|
8
|
-
# ----------------------------------------------------------------------------
|
|
9
|
-
|
|
10
|
-
## ----------------------------------------------------------------------------
|
|
11
|
-
## 1.1 Prepend $PATH without duplicates.
|
|
12
|
-
## ----------------------------------------------------------------------------
|
|
13
|
-
|
|
14
|
-
# prependpath: Prepend $PATH without duplicates
|
|
15
|
-
prependpath() {
|
|
16
|
-
if ! echo "${PATH}" | tr ":" "\n" | grep -qx "$1" ; then
|
|
17
|
-
PATH="$1:${PATH}"
|
|
18
|
-
fi
|
|
19
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# print: Function to display the argument given
|
|
7
|
-
# print() {
|
|
8
|
-
# if [[ "$#" != 1 ]]; then
|
|
9
|
-
# echo "[ERROR] Please add one argument" >&2
|
|
10
|
-
# return 1
|
|
11
|
-
# fi
|
|
12
|
-
# echo "$1"
|
|
13
|
-
# }
|
package/shell/functions/ql.sh
DELETED
package/shell/functions/rd.sh
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# rd: Function to remove a directory and its files
|
|
7
|
-
rd() {
|
|
8
|
-
if [[ "$#" != 1 ]]; then
|
|
9
|
-
echo "[ERROR] Please add one argument" >&2
|
|
10
|
-
return 1
|
|
11
|
-
fi
|
|
12
|
-
echo "[INFO] The operation completed successfully, directory listing of $1:"
|
|
13
|
-
rm -rf "$1" || exit;
|
|
14
|
-
ls -lh;
|
|
15
|
-
}
|
package/shell/functions/ren.sh
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# ren: Function to rename files extension.
|
|
7
|
-
ren() {
|
|
8
|
-
for f in *."$1"; do
|
|
9
|
-
mv "${f}" "${f%."$1"}.$2"
|
|
10
|
-
done
|
|
11
|
-
}
|
package/shell/functions/rm.wip
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# rm: Function to make 'rm' move files to the trash
|
|
7
|
-
# function rm() {
|
|
8
|
-
# if [[ "$#" != 1 ]]; then
|
|
9
|
-
# echo "[ERROR] Please add one argument" >&2
|
|
10
|
-
# return 1
|
|
11
|
-
# fi
|
|
12
|
-
# rm "$1"
|
|
13
|
-
# }
|
package/shell/functions/rps.wip
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# Adapted from https://github.com/Ananta-Gupta/Rock-Paper-Scissors
|
|
7
|
-
|
|
8
|
-
# rps: Function to play Rock Paper Scissors
|
|
9
|
-
|
|
10
|
-
# check() {
|
|
11
|
-
# if [ "$1" == "$2" ]; then
|
|
12
|
-
# echo "Draw!"
|
|
13
|
-
# elif [ "$1" = 1 ] && [ "$2" = 2 ]; then
|
|
14
|
-
# echo "You Lose! Paper beats Rock!"
|
|
15
|
-
# elif [ "$1" = 2 ] && [ "$2" = 3 ]; then
|
|
16
|
-
# echo "You Lose! Scissor beats Paper!"
|
|
17
|
-
# elif [ "$1" = 3 ] && [ "$2" = 1 ]; then
|
|
18
|
-
# echo "You Lose! Rock beats Scissor!"
|
|
19
|
-
# elif [ "$1" != 1 ] && [ "$1" != 2 ] && [ "$1" != 3 ]; then
|
|
20
|
-
# echo "Invalid input! You have not entered a valid number"
|
|
21
|
-
# else
|
|
22
|
-
# echo " ❭ You Win! 👏🏻"
|
|
23
|
-
# fi
|
|
24
|
-
# }
|
|
25
|
-
|
|
26
|
-
# print() {
|
|
27
|
-
# echo ""
|
|
28
|
-
# echo "┌──────────────────────────────────────┐"
|
|
29
|
-
# echo "│ │"
|
|
30
|
-
# echo "│ Rock, Paper, Scissors │"
|
|
31
|
-
# echo "│ │"
|
|
32
|
-
# echo "└──────────────────────────────────────┘"
|
|
33
|
-
# echo ""
|
|
34
|
-
# echo "Enter a choice :"
|
|
35
|
-
# echo "1 for Rock"
|
|
36
|
-
# echo "2 for Paper"
|
|
37
|
-
# echo "3 for Scissor"
|
|
38
|
-
# echo ""
|
|
39
|
-
# }
|
|
40
|
-
|
|
41
|
-
# rps() {
|
|
42
|
-
|
|
43
|
-
# clr=0
|
|
44
|
-
# i=0
|
|
45
|
-
# while [ $i != 1 ]; do
|
|
46
|
-
# if [ $clr = 0 ]; then
|
|
47
|
-
# clr=0
|
|
48
|
-
# clear
|
|
49
|
-
# print 1
|
|
50
|
-
# fi
|
|
51
|
-
# read -r ch1
|
|
52
|
-
# echo ""
|
|
53
|
-
|
|
54
|
-
# case $ch1 in
|
|
55
|
-
# 1)
|
|
56
|
-
# echo "You chose rock"
|
|
57
|
-
# ;;
|
|
58
|
-
# 2)
|
|
59
|
-
# echo "You chose paper"
|
|
60
|
-
# ;;
|
|
61
|
-
# 3)
|
|
62
|
-
# echo "You chose scissor"
|
|
63
|
-
# ;;
|
|
64
|
-
# esac
|
|
65
|
-
|
|
66
|
-
# if [ "$ch1" = 0 ] && [ "$ch1" = 3 ]; then
|
|
67
|
-
# echo "please choose from 1, 2 or 3."
|
|
68
|
-
# clr=1
|
|
69
|
-
# continue
|
|
70
|
-
# fi
|
|
71
|
-
|
|
72
|
-
# ch2=$(echo "$RANDOM%3+1" | bc)
|
|
73
|
-
|
|
74
|
-
# case $ch2 in
|
|
75
|
-
# 1)
|
|
76
|
-
# echo "The computer chose rock"
|
|
77
|
-
# ;;
|
|
78
|
-
# 2)
|
|
79
|
-
# echo "The computer chose paper"
|
|
80
|
-
# ;;
|
|
81
|
-
# 3)
|
|
82
|
-
# echo "The computer chose scissor"
|
|
83
|
-
# ;;
|
|
84
|
-
# esac
|
|
85
|
-
|
|
86
|
-
# check "${ch1}" "${ch2}"
|
|
87
|
-
# echo "To exit press 0"
|
|
88
|
-
# echo "To play again press p : "
|
|
89
|
-
# read -r ch3
|
|
90
|
-
# if [ "$ch3" = p ]; then
|
|
91
|
-
# rep=6
|
|
92
|
-
# while [ $rep != 0 ]; do
|
|
93
|
-
# clear
|
|
94
|
-
# print 1
|
|
95
|
-
# echo "Starting in $($rep - 1) seconds!!!"
|
|
96
|
-
# rep=$($rep - 1)
|
|
97
|
-
# done
|
|
98
|
-
# continue
|
|
99
|
-
# else
|
|
100
|
-
# exit
|
|
101
|
-
# fi
|
|
102
|
-
# done
|
|
103
|
-
# }
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# Show hidden system and dotfile files
|
|
7
|
-
showhiddenfiles() {
|
|
8
|
-
defaults write com.apple.Finder AppleShowAllFiles YES
|
|
9
|
-
osascript -e 'tell application "Finder" to quit'
|
|
10
|
-
sleep 0.25
|
|
11
|
-
osascript -e 'tell application "Finder" to activate'
|
|
12
|
-
}
|
package/shell/functions/size.sh
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# size: Function to check a file size
|
|
7
|
-
size() {
|
|
8
|
-
if [[ "$#" != 1 ]]; then
|
|
9
|
-
echo "[ERROR] Please add one argument" >&2
|
|
10
|
-
return 1
|
|
11
|
-
fi
|
|
12
|
-
stat -f '[INFO] The file total size, in bytes is %z' "$1"
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# stopwatch: Function for a stopwatch
|
|
7
|
-
stopwatch() {
|
|
8
|
-
date1=$(gdate +%s)
|
|
9
|
-
while true; do
|
|
10
|
-
echo -ne "$(gdate -u --date @$(($(date +%s) - date1)) +%H:%M:%S)\r"
|
|
11
|
-
sleep 0.1
|
|
12
|
-
done
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# trash: Function to moves a file to the MacOS trash
|
|
7
|
-
#trash(){
|
|
8
|
-
# if [ "$#" != 1 ]; then
|
|
9
|
-
# echo "[ERROR] Please add one argument" >&2
|
|
10
|
-
# return 1
|
|
11
|
-
# fi
|
|
12
|
-
# rm "$1"
|
|
13
|
-
#}
|
package/shell/functions/tree.wip
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
|
|
3
|
-
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
-
# License: MIT
|
|
5
|
-
|
|
6
|
-
# tree: Function to generates a tree view from the current directory
|
|
7
|
-
#if [ ! -e /usr/local/bin/tree ]; then
|
|
8
|
-
# tree(){
|
|
9
|
-
# pwd
|
|
10
|
-
# ls -R | grep ":$" | \
|
|
11
|
-
# sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
|
|
12
|
-
# }
|
|
13
|
-
#fi
|