Giter Club home page Giter Club logo

win-dotfiles's Introduction

win-dotfiles

๐Ÿฎ๐Ÿ“„ Dotfiles and configs for different things Windows. ๐Ÿ”ข๐Ÿ› ๏ธ

How to install โบ๏ธ dotfiles?

Note: Set-Dotfiles script requires to be run as admin

Automatic setup

Open terminal as admin and first run this ๐Ÿ—ฝ command to be temporarily bypassed ExecutionPolicy

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process

If that is not a concerns run bellow command, it will require that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Use the command bellow to ๐Ÿš€ quickly setup ๐Ÿ”ต dotfiles:

Invoke-Expression (Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/RustyTake-Off/win-dotfiles/main/.config/scripts/Set-Dotfiles.ps1' -UseBasicParsing).Content | Invoke-Expression

Invoking โ˜€๏ธ this script will:

  • Create pr and wk folders in user directory
  • Clone this repository and save it in the user directory (if the repo is present it will be updated)
  • Create SymbolicLinks for:
    • PowerShell profiles
    • PowerShell scripts
    • Winget config
    • WSL config
  • Copy Windows Terminal config (for some reason using SymbolicLinks breaks Windows Terminal updates)

(Optionally) Manual setup

For more โœ‹ hands on approach here are the ๐Ÿพ steps to set it up.

Clone repo in ๐Ÿป bare mode into .dotfiles directory.

git clone --bare 'https://github.com/RustyTake-Off/win-dotfiles.git' "$env:USERPROFILE\.dotfiles"

Checkout repo into ๐Ÿ  home directory.

git --git-dir="$env:USERPROFILE\.dotfiles" --work-tree=$env:USERPROFILE checkout

Set git to not show untracked files.

git --git-dir="$env:USERPROFILE\.dotfiles" --work-tree=$env:USERPROFILE config status.showUntrackedFiles no

Lastly run this script.

pwsh "$env:USERPROFILE\.config\scripts\Set-Dotfiles.ps1"

Everything should be in place ๐Ÿ™‚

Updating

Updating ๐Ÿ”ต dotfiles is done by using a dot function which is already in the ๐Ÿšฐ PowerShell profile. Normally it would be an alias but for some reason the Set-Alias with this command doesn't work so it's easier to put it into a function.

function dot {
    git --git-dir="$env:USERPROFILE\.dotfiles" --work-tree=$env:USERPROFILE $Args
}

To update dotfiles run:

dot pull

Another way is to use the Set-Dotfiles script in admin terminal. In ๐Ÿšฐ PowerShell profile there is an admin function which auto opens admin terminal and runs passed command there.

function admin {
    if (-not $Args) {
        Start-Process wt -Verb RunAs -ArgumentList "pwsh -NoExit -ExecutionPolicy Bypass -Command `
        cd $(Get-Location)"
    } else {
        Start-Process wt -Verb RunAs -ArgumentList "pwsh -NoExit -ExecutionPolicy Bypass -Command `
        cd $(Get-Location) `
        $Args"
    }
}

To use it, run this command:

admin Set-Dotfiles.ps1

Windows environment setup script

Note: Use-WinUp script also needs to be run as admin.

You might want to not change the Execution Policy permanently ๐ŸงŠ so to change it only for the current process run the bellow command and then use the script.

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process

If that is not a concerns run bellow command, it will require that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Since it is a setup script you won't โŒ have git installed so to download this script run the bellow ๐Ÿ‘‡ command which will get the script and save it on the desktop.

Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/RustyTake-Off/win-dotfiles/main/.config/scripts/Use-WinUp.ps1' -UseBasicParsing -OutFile "$env:USERPROFILE\Desktop\Use-WinUp.ps1"

Then go to where it is saved and use the script.

Set-Location -Path "$env:USERPROFILE\Desktop"

win-dotfiles's People

Contributors

rustytake-off avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.