craftzdog / dotfiles-public

My personal dotfiles
6.13k stars 1.16k forks source link

feat(script): Automation Script for craftzdog setup installation (For MacOS, Linux and Windows) #165

Open harshv5094 opened 3 months ago

harshv5094 commented 3 months ago

This pull request is the revision and improvents on my previous pull request #146, on this #142 discussion. With how you can install fisher plugin using fish_plugins. I apologize for the delay.

@craftzdog I've found the solution for using fish_plugins to install plugins. I'm still making some changes, on the files. I've tested it, so it works. Hope this solution satisfy your requirements.

I'm also thinking of linking your config folder (like nvim, tmux) to ~/.config path using symbolic links. Should I do it or just copy paste the config folders.

I'm also working on windows installation script on powershell. After testing I'll soon create it's pull request

PowerzinBR commented 3 months ago

You can also add this, if you want

  1. Add eza as an alias called ll to the script, it can be invoked by using a function called ll: It can be installed with > scoop <
Function ll { eza $args -l --icons }
scoop install eza
  1. Add some packages that is available to Windows too:

Using scoop:

ripgrep (or findstr)
fd
fzf
eza
node
python

Using npm:

commitizen

Using Chocolatey:

watchman
PowerzinBR commented 3 months ago

@harshv5094 Check it out :D

harshv5094 commented 3 months ago

Okay, Thanks for the suggestion @PowerzinBR. Just like how we can use brew bundle to install packages, is there any solution for scoop also

PowerzinBR commented 3 months ago

@harshv5094 Create a simple scoop.txt (or any name), it will be used like requirements.txt for pip

Add the dependencies as i said, then run the command:

scoop install (gc .\scoop.txt)

You mean like this? We are using GC (Get-Content) of Powershell cmdlets to get packages from the file Could i help you develop the Windows automate script?

Sorry for the delay!

harshv5094 commented 3 months ago

Yeah it will help me a lot.

PowerzinBR commented 3 months ago

Yeah it will help me a lot.

Thanks, i will start working on it.

craftzdog commented 3 months ago

my current Brewfile:

tap "homebrew/bundle"
tap "homebrew/cask"

brew "fish"
brew "tmux"

brew "ghq"
brew "gh"
brew "lazygit"
brew "tig"

brew "neovim"
brew "ripgrep"
brew "jq"
brew "eza"
brew "bat"
brew "fd"
brew "fzf"
brew "btop"
brew "wget"

brew "pyenv"
brew "node"
brew "rbenv"
brew "heroku"
brew "sqlite"
brew "ffmpeg"

# React Native
brew "watchman"

cask "visual-studio-code"
cask "iterm2"
cask "transmit"
cask "min"
cask "1password"
cask "keycastr"
cask "numi"
cask "zed"
cask "raycast"
cask "karabiner-elements"
cask "google-chrome"
PowerzinBR commented 3 months ago

my current Brewfile:

tap "homebrew/bundle"
tap "homebrew/cask"

brew "fish"
brew "tmux"

brew "ghq"
brew "gh"
brew "lazygit"
brew "tig"

brew "neovim"
brew "ripgrep"
brew "jq"
brew "eza"
brew "bat"
brew "fd"
brew "fzf"
brew "btop"
brew "wget"

brew "pyenv"
brew "node"
brew "rbenv"
brew "heroku"
brew "sqlite"
brew "ffmpeg"

# React Native
brew "watchman"

cask "visual-studio-code"
cask "iterm2"
cask "transmit"
cask "min"
cask "1password"
cask "keycastr"
cask "numi"
cask "zed"
cask "raycast"
cask "karabiner-elements"
cask "google-chrome"

It will surely help him, in the PowerShell setup video, did you add any additional packages for your setup, for scoop? I wanted to know cuz i could include it in installing dependencies? @craftzdog

harshv5094 commented 3 months ago

Hey @PowerzinBR, Yesterday, I developed pwsh script for my own setup, just to get familiar with PowerShell. You can check here for reference.

PowerzinBR commented 3 months ago

Hey @PowerzinBR, Yesterday, I developed pwsh script for my own setup, just to get familiar with PowerShell. You can check here for reference.

Oh! Thanks. I will start working on it when i have some time left. It's very simple + easy to work on! I will surely try my best. :)

harshv5094 commented 3 months ago

my current Brewfile:

tap "homebrew/bundle"
tap "homebrew/cask"

brew "fish"
brew "tmux"

brew "ghq"
brew "gh"
brew "lazygit"
brew "tig"

brew "neovim"
brew "ripgrep"
brew "jq"
brew "eza"
brew "bat"
brew "fd"
brew "fzf"
brew "btop"
brew "wget"

brew "pyenv"
brew "node"
brew "rbenv"
brew "heroku"
brew "sqlite"
brew "ffmpeg"

# React Native
brew "watchman"

cask "visual-studio-code"
cask "iterm2"
cask "transmit"
cask "min"
cask "1password"
cask "keycastr"
cask "numi"
cask "zed"
cask "raycast"
cask "karabiner-elements"
cask "google-chrome"

@craftzdog I have a question, I know that cask only works for macOS packages, so some packages can't be installed in linuxbrew, should I add cask packages in Brewfile? If yes we need to metion it about in README.md for people's understanding.

PowerzinBR commented 3 months ago

@harshv5094, i developed a initial script for the windows prototype, i used your code as reference. It works like a charm, there is somethings to improve. For now i created a simple repository, that you can check it here

harshv5094 commented 3 months ago

@harshv5094, i developed a initial script for the windows prototype, i used your code as reference. It works like a charm, there is somethings to improve. For now i created a simple repository, that you can check it here

Okay Looks good, I have some ideas for improvement, I'll use your script as a reference and start working on it.

craftzdog commented 3 months ago

I don't use brew to install packages on Linux. Looks like Brewfile is just a Ruby script so you can write if statements in the file like if OS.mac?. So, if you'd like to make it support Linux, you can use the if statement.

harshv5094 commented 3 months ago

Yeah, I use Debian WSL so I use brew for latest package. Okay I'll add if statement based on os to install packages

harshv5094 commented 3 months ago

hey, quick update, I shifted my setup to Debian 12 so I don't have access to pwsh and I don't want to install pwsh in my debian setup. So @PowerzinBR, can you please finish the windows installation script.

By the way, I'm loving my debian setup, It's hardware support has improved significantly

PowerzinBR commented 3 months ago

hey, quick update, I shifted my setup to Debian 12 so I don't have access to pwsh and I don't want to install pwsh in my debian setup. So @PowerzinBR, can you please finish the windows installation script.

By the way, I'm loving my debian setup, It's hardware support has improved significantly

Ok, i will finish it. Is there anything to add? I added scoop & dotfiles.

harshv5094 commented 3 months ago

I think we need to install powershell pakages from takuya's setup and also we need to add an option which enters the location of powershell directory which is stored in .config directory in Documents/Powershell. Just like we do as echo text >> filename in linux and macos

PowerzinBR commented 3 months ago

i will finish it when my school tests ends, sorry for delay

harshv5094 commented 3 months ago

Okay

harshv5094 commented 3 months ago

So, I decided to ditch the idea for adding os dependent package install in homebrew.

harshv5094 commented 3 months ago

@craftzdog Could you give me some feedback and give me some reviews for some improvements in the script? I think I'm out of gas now.

craftzdog commented 3 months ago

I'll try it in my environment

craftzdog commented 3 months ago

After running one of the options, it prompts again but without choices:

❯ ./.scripts/install.sh
Welcome to craftsdog setup installation script.
1) Install Homebrew and packages 🍺
2) Install Ubuntu packages 📦
3) Install npm packages 📦
4) Move .config folders to user config directory ⬅️
5) Run fish configuration script 🐟
6) Commando Mode (macOS) 💪
7) Commando Mode (Ubuntu) 💪
8) Quit ❌
Select your option: 1
Homebrew is installed
 Installing homebrew packages
ln: /Users/nora/Brewfile: File exists
Using homebrew/bundle
==> Downloading https://formulae.brew.sh/api/formula.jws.json
##################################################################################################################################################### 100.0%

...

Using raycast
Using karabiner-elements
Using google-chrome
Homebrew Bundle complete! 34 Brewfile dependencies now installed.
Select your option:

I think it doesn't have to ask again but simply quit the script.

harshv5094 commented 3 months ago

Okay, So should I remove quit option and quit the script after executing a option

craftzdog commented 3 months ago

yes

PowerzinBR commented 3 months ago

@harshv5094, i think i cannot continue with the project, you could use my script as a reference to the Windows script, then sorry for the big delay.

Thanks for understanding!

harshv5094 commented 3 months ago

No problem, I'll manage somehow

harshv5094 commented 1 month ago

Notice

Hello, I want to tell you that I don't have access to any Windows machines, so I can't develop a Windows installation script. So I need someone's help from the community. So I'm going to leave open this pull request. So, if anyone has a Windows machine, I need someone to continue the development of the window's installation script.

I tried to run Windows Virtual Machine in my laptop. But failed miserably. So Anyone who wants to contribute in this pull request go to my repository, fork it and develop your installation script.

PowerzinBR commented 1 month ago

hey, i can help maybe.

harshv5094 commented 1 month ago

So in commit f7caabd I just enabled gh autocompletion by using script generated by gh cli, Since @craftzdog is using gh on a daily basis, I added this script.

You can see this website: https://cli.github.com/manual/gh_completion. To set autocompletion according to your shell.

harshv5094 commented 1 month ago

Here is the demo

(By the way, I'm using hyprland window compositor in Fedora 40. Here are the dotfiles)

2024-06-01T16:52:54,309111533+05:30 2024-06-01T16:53:03,449398223+05:30

harshv5094 commented 1 month ago

hey, i can help maybe.

@PowerzinBR if you are available, can you do it?