From 528148aa90053e575bf48186d93871a13348351c Mon Sep 17 00:00:00 2001 From: Yasin Date: Wed, 20 Oct 2021 21:53:46 +0530 Subject: [PATCH] Refactor scripts Removed redundant license headers and updated the README. --- README.md | 38 ++++++++++++++++---------- brew/Brewfile | 4 +++ brew/defaults | 22 --------------- brew/setup_brew | 27 +++---------------- docker/defaults | 30 --------------------- git/defaults | 22 --------------- git/gitconfig | 23 +--------------- git/setup_git | 22 --------------- install.conf.yaml | 23 ---------------- macos/defaults | 22 +-------------- maven/defaults | 22 --------------- node/defaults | 43 +++++++----------------------- node/setup_node | 22 --------------- zsh/oh_my_zsh | 24 +---------------- zsh/zshenv | 23 +--------------- zsh/zshrc | 68 +---------------------------------------------- 16 files changed, 45 insertions(+), 390 deletions(-) diff --git a/README.md b/README.md index 7e46adb..4b88d01 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,12 @@ -# Yasin's .dotfiles +# Yasin's `.dotfiles` -These are my `dotfiles`!. You should definitely go through the files and tweak them to your needs if want to do so. -Below is a comprehensive explanation on how do I structure these dotfiles. +These are my `dotfiles`!. You should first go through the files and tweak them to your needs if want to do so. Below is +a small explanation on how do I structure these dotfiles. + +But before that I must say **thanks** to [eieioxyz](https://github.com/eieioxyz). His +amazing [course](https://www.udemy.com/course/dotfiles-from-start-to-finish-ish/) on Udemy about dotfiles helped me to +understand some important topics in terminals. I highly encourage you to enroll in that course and learn more about +dotfiles in-depth! ## Terminology @@ -9,34 +14,40 @@ Lot of the dotfiles repo's out there has a linear file structure. In this repo I each utility that has possible dotfiles will have their own module. For example, `git`, `vim`, `brew` etc. If you see one of the below named files in any of the available modules, this is what it means. -### File `defaults` +1. `defaults` -Purpose to hold all the default commands, functions, aliases and related configurations which are loaded to the shell +Basically holds all the default commands, functions, aliases and related configurations which are loaded to the shell environment. -### File `setup_*` +2. `setup_*` Purpose to hold all the bootstrapping logic for a new machine. Usually, this will be executed in the `shell` when we run `./install` file. -## How to `install`? +## `install`? First navigate to home `cd` and clone the repository using `git clone https://github.com/yasinmiran/.dotfiles.git` and navigate to dotfiles director using `cd ~/.dotfiles`. Now execute the command below to get started! +#### Hol up 🚧🔧 + +Before that I usually, manually configure `git` and `ssh` access on a new machine. If you're running macOS Big Sur you +may have to grant your Terminal app `Full Disk Access` in order to smoothly execute `install` script. + ```bash $ ./install ``` -After executing above command, dotfiles are linked successfully. To pickup the changes you must quit the current -terminal process and all the functions will be preloaded to your zsh environment. Now you can re-run the installation -command like below. +After executing above command, dotfiles will get linked and all the sub `setup_*` scripts will execute in order. To pick +up the changes you must quit the current terminal process and all the functions will be preloaded to your zsh +environment. Now you can re-run the installation command like below. -## Kudos 🧙🏻‍♂️ +## Many Kudos 🧙🏻‍♂️ My dotfiles are **inspired by** some amazing dotfiles projects out there. Also, checkout this [curated list](https://github.com/webpro/awesome-dotfiles) for more amazing stuff! +- [eieioxyz](https://github.com/eieioxyz/dotfiles_macos) - [Anish's dotfiles](https://github.com/anishathalye/dotfiles) - [Mathias's dotfiles](https://github.com/mathiasbynens/dotfiles) - [Bo's dotfiles](https://github.com/janusboandersen/dotfiles) @@ -44,9 +55,8 @@ this [curated list](https://github.com/webpro/awesome-dotfiles) for more amazing - [Ryan's dotfiles](https://github.com/ryanb/dotfiles) - [Holman's dotfiles](https://github.com/holman/dotfiles) -## TODO +## Things I'm currently working on -- [ ] Map IDE configurations (vscode, IdeaU, Goland). +- [ ] Mapping IDE configurations (vscode, Idea). - [ ] Map Vim configurations. - [ ] Revisit SSH configurations. -- [ ] Implement a new strategy for secret managing. \ No newline at end of file diff --git a/brew/Brewfile b/brew/Brewfile index 8a93b69..69d3a97 100644 --- a/brew/Brewfile +++ b/brew/Brewfile @@ -53,7 +53,11 @@ cask "microsoft-word" cask "postman" # Team communication and collaboration software cask "slack" +# Music streaming service +cask "spotify" # Open-source code editor cask "visual-studio-code" +# JavaScript IDE +cask "webstorm" mas "Bitwarden", id: 1352778147 mas "Gifski", id: 1351639930 diff --git a/brew/defaults b/brew/defaults index 4dff0a1..6a5327a 100755 --- a/brew/defaults +++ b/brew/defaults @@ -1,27 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # ====================================================================================== # Functions # ====================================================================================== diff --git a/brew/setup_brew b/brew/setup_brew index a4d31f9..cc812eb 100755 --- a/brew/setup_brew +++ b/brew/setup_brew @@ -1,34 +1,13 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # This file contains the bootstrap logic for homebrew. This shouldn't be called -# everytime (although its fine). These commands, rather setup.zsh file intended +# everytime (although its fine). These commands, in this file intended # to call from dotbot shell configuration when configuring a new machine. - +# # First source the brew related default configurations to the shell environment. # We can ensure that zshrc variables are in the env because we source it after # linking. See dotbot config for `source zsh/zshrc` shell command. + source "$DOTFILES_DIR/brew/defaults" # Install homebrew via curl. If brew is already installed then just update diff --git a/docker/defaults b/docker/defaults index 1c53a8d..07037d1 100755 --- a/docker/defaults +++ b/docker/defaults @@ -1,31 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# ====================================================================================== -# Exports -# ====================================================================================== - # ====================================================================================== # Aliases # ====================================================================================== @@ -33,7 +7,3 @@ alias dlistall="docker ps -a" alias dstart="docker start" alias dstop="docker stop" - -# ====================================================================================== -# Functions -# ====================================================================================== diff --git a/git/defaults b/git/defaults index 7295717..b6defed 100755 --- a/git/defaults +++ b/git/defaults @@ -1,27 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # ====================================================================================== # Aliases # ====================================================================================== diff --git a/git/gitconfig b/git/gitconfig index 30f9f0e..e1e2c0d 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -1,27 +1,6 @@ -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # This is the user-specific configuration file. # Also called "global" configuration file. +# # Read the docs: https://git-scm.com/docs/git-config [user] diff --git a/git/setup_git b/git/setup_git index 310fb8b..5f0855d 100755 --- a/git/setup_git +++ b/git/setup_git @@ -1,27 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # Generate SSH key in default location (~/.ssh/config) ssh-keygen -t ed25519 -C "wytm97@protonmail.com" diff --git a/install.conf.yaml b/install.conf.yaml index 4ea18b5..797abff 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -1,26 +1,3 @@ -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# @author: Yasin # @description: dotbot configuration file. # # The configuration file is typically written in YAML, diff --git a/macos/defaults b/macos/defaults index 203d16c..42eaa6c 100755 --- a/macos/defaults +++ b/macos/defaults @@ -1,23 +1,3 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. +# Work in progress \ No newline at end of file diff --git a/maven/defaults b/maven/defaults index c4d80b6..e9c1855 100755 --- a/maven/defaults +++ b/maven/defaults @@ -1,25 +1,3 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - alias mvnci="mvn clean install" diff --git a/node/defaults b/node/defaults index e63f1ca..cadeadd 100755 --- a/node/defaults +++ b/node/defaults @@ -1,27 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # ====================================================================================== # Aliases # ====================================================================================== @@ -29,26 +7,23 @@ alias npmg="npm list -g --depth 0" # List all global packages alias npmr="npm run" # run quick alias npmrs="npm run start" # npm run start quick - -alias next_dev="npm run dev:watch" # NextJS portfolio dev -alias cdp="refresh_deps" +alias next_dev="npm run dev:watch" # NextJS site dev # ====================================================================================== # Functions # ====================================================================================== +# NextJS projects only. +function force_clean_packages() { + rm -rf node_modules package-lock.json .next && + npm install +} + # This is a project specific function that I use mainly for # cleaning up and starting a fresh instance. -function clean_up_portfolio_project_bins() { - rm -rf node_modules package-lock.json .next && - npm install && +function force_clean_and_build() { + force_clean_packages && npm run build && npm run dev:watch } -# Delete all the bins and re install the packages. -# Only applies to my portfolio. -function refresh_deps() { - rm -rf node_modules package-lock.json .next && - npm install -} diff --git a/node/setup_node b/node/setup_node index 7d83738..584a302 100755 --- a/node/setup_node +++ b/node/setup_node @@ -1,27 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # First do source the default aliases, exports, functions, and commands # to this file to ensure all are loaded. source "$DOTFILES_DIR/node/defaults" diff --git a/zsh/oh_my_zsh b/zsh/oh_my_zsh index e537da7..8ad5758 100644 --- a/zsh/oh_my_zsh +++ b/zsh/oh_my_zsh @@ -1,27 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # Path to oh-my-zsh installation. Note that OMZ_INSTALLATION_PATH # is available only in zshrc file. export ZSH="$OMZ_INSTALLATION_PATH" @@ -30,7 +8,7 @@ export ZSH="$OMZ_INSTALLATION_PATH" # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -export ZSH_THEME="robbyrussell" +export ZSH_THEME="dracula-pro" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load diff --git a/zsh/zshenv b/zsh/zshenv index d28946e..e56a926 100755 --- a/zsh/zshenv +++ b/zsh/zshenv @@ -1,27 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # How we can group zsh related files in a directory? # # There is practically only one way it can reliably work and be portable @@ -102,6 +80,7 @@ function is_file() { return 0 } +# FIXME: WIP function get_file_extension() { # TODO: Revisit this and implement again. # For example, take filename example.tar.gz diff --git a/zsh/zshrc b/zsh/zshrc index 1500173..6bd6b20 100755 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,27 +1,5 @@ #!/usr/bin/env zsh -# MIT License -# -# Copyright (c) 2021 Yasin Miran -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - # ====================================================================================== # Exports # ====================================================================================== @@ -127,51 +105,6 @@ function gupnod() { } -# Abbreviated: Organize my shit -# -# This function can organize the files based on their type. It is very much similar to macOS -# stacks however, it will create directories with the extension name instead of their category type. -# -# This function can operate without conflicting the existing folders. -# FIXME: this function is still WIP -function oms() { - - if [[ $PWD != "$HOME/Desktop" ]] || [[ $PWD != "$HOME/Downloads" ]]; then - echo "That's a funny move 😂." - return 0 - fi - - local cdir=$PWD - - for i in "$cdir"/*; do - - # if its a directory then we won't recurse instead, - # we will put it into a dir called `stacks_dirs`. - if is_directory "$i"; then - mkdir -p "$cdir/stacks_dirs" - echo "Moving $i to $cdir/stacks_dirs" - continue - # mv "$i" "$cdir/stacks_dirs/" - fi - - if is_file "$i"; then - ext=$(get_file_extension "$i") - echo "File extension is $ext" - if [[ -n "$ext" ]] && [ "$ext" != "." ]; then - mkdir -p "$cdir/$ext" - echo "Moving $i to $cdir/$ext/" - # mv "$i" "$cdir/$ext/" - else - mkdir -p "$cdir/stacks_no_ext" - echo "Moving $i to $cdir/stacks_no_ext/" - # mv "$i" "$cdir/stacks_no_ext/" - fi - fi - - done - -} - # Abbreviated for: Append to $PATH # This function will append a path to $PATH and source the self itself. function atop() { @@ -198,6 +131,7 @@ function alf() { # This function is used to synchronize local dotfiles to # this repository files. +# I have only sync brew related things for now. function synchronize() { echo "Syncing to $DOTFILES_DIR" && brew_dump