From a5491ea10823b7625d686c988826d00a6cc2e0ca Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Mon, 10 Jun 2024 17:58:05 -0500 Subject: [PATCH 1/5] Trying branches per OS --- README.md | 52 ------------------------ windows/Microsoft.PowerShell_profile.ps1 | 15 ------- windows/Microsoft.VSCode_profile.ps1 | 9 ---- windows/aliases.ps1 | 7 ---- 4 files changed, 83 deletions(-) delete mode 100644 README.md delete mode 100644 windows/Microsoft.PowerShell_profile.ps1 delete mode 100644 windows/Microsoft.VSCode_profile.ps1 delete mode 100644 windows/aliases.ps1 diff --git a/README.md b/README.md deleted file mode 100644 index ff8a398..0000000 --- a/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# dotfiles - -My dotfiles for both Arch Linux and Windows - -## Useage on Linux - -### Checking out the repo - -```sh -git clone --bare gitea@git.theflyingfool.com:theflyingfool/dotfiles.git $HOME/.dot -alias dot='/usr/bin/git --git-dir="$HOME/.dot/" --work-tree="$HOME"' -dot checkout -dot config --local status.showUntrackedFiles no -source ~/.zshrc -``` - -If there are conflicts: - -```sh -mkdir -p .dot-backup && \ -dot checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \ -xargs -I{} mv {} .dot-backup/{} -dot checkout -``` - -### Managing dotfiles - -**Adding or Modifying files** - -```sh -dot add .zshrc -dot commit -m "Update .zshrc" -dot push -``` - -## Useage on Windows - -### Checking out the repo - -```ps1 -PowerShell -NoProfile -ExecutionPolicy Bypass -git clone --bare https://git.theflyingfool.com/theflyingfool/dotfiles.git $HOME/.dot -if (!(Test-Path -Path $PROFILE)) { - # Create the profile - New-Item -Type File -Path $PROFILE -Force -} -"`nfunction dot { & git --git-dir=`"$HOME/.dot/`" --work-tree=`"$HOME`" @args }" | Out-File -Append $PROFILE -. $PROFILE -dot checkout -dot config --local status.showUntrackedFiles no -"`n. `"$HOME/windows/Microsoft.PowerShell_profile.ps1`"" | Out-File -Append $PROFILE -``` diff --git a/windows/Microsoft.PowerShell_profile.ps1 b/windows/Microsoft.PowerShell_profile.ps1 deleted file mode 100644 index 9e8d80b..0000000 --- a/windows/Microsoft.PowerShell_profile.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { - param($wordToComplete, $commandAst, $cursorPosition) - [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() - $Local:word = $wordToComplete.Replace('"', '""') - $Local:ast = $commandAst.ToString().Replace('"', '""') - winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { - [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) - } - } - - -function dot { & git --git-dir="$HOME/.dot/" --work-tree="$HOME" @args } - -# Source the aliases.ps1 file -. "$PSScriptRoot/aliases.ps1" diff --git a/windows/Microsoft.VSCode_profile.ps1 b/windows/Microsoft.VSCode_profile.ps1 deleted file mode 100644 index b841b2d..0000000 --- a/windows/Microsoft.VSCode_profile.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { - param($wordToComplete, $commandAst, $cursorPosition) - [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() - $Local:word = $wordToComplete.Replace('"', '""') - $Local:ast = $commandAst.ToString().Replace('"', '""') - winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { - [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) - } - } diff --git a/windows/aliases.ps1 b/windows/aliases.ps1 deleted file mode 100644 index 8030e1f..0000000 --- a/windows/aliases.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -function Upgrade-All { winget upgrade --all } - -Set-Alias -Name Syu -Value Upgrade-All - -function touch($file) { - "" | Out-File $file -Encoding ASCII -} \ No newline at end of file From 2fddb1c09e67fa7fff05e4b37709c996a478ae88 Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Mon, 10 Jun 2024 18:20:37 -0500 Subject: [PATCH 2/5] Possibly have yay alias's set --- .alias | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.alias b/.alias index d597508..25a3d0c 100644 --- a/.alias +++ b/.alias @@ -46,6 +46,16 @@ if [ -e "/usr/bin/apt-get" ] ; then # Apt-based distros (Debian, Ubuntu, etc.) # alias pacfiles="$dpkg -L" #elif [ -e "/usr/bin/pacman" -a "/usr/bin/cower" ] ; then # alias XxX="echo 'pacman + cower'" +elif [ -e "/usr/bin/yay" ] ; then + yay="/usr/bin/yay" + sudoyay="sudo $yay" + alias S="$sudoyay -S" + alias Syy="$sudoyay -Syy" + alias Syu="$sudoyay -Syu" + alias Rns="$sudoyay -Rns" + alias Ss="$sudoyay -Ss" + alias Si="$sudoyay -Si" + alias Q="$sudoyay -Q" elif [ -e "/usr/bin/pacman" ] ; then # Arch Linux pacman="/usr/bin/pacman --color=auto" sudopacman="sudo $pacman --color=auto" From 32c67d6fee4925d01bb117c88c820ecc147ceb5c Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Mon, 10 Jun 2024 19:04:07 -0500 Subject: [PATCH 3/5] Couldn't get branchs working like expected working to undo --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5224e64 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# dotfiles + +My dotfiles for both Arch Linux and Windows + +## Usage on Linux + +### Checking out the repo + +```sh +git clone --bare gitea@git.theflyingfool.com:theflyingfool/dotfiles.git $HOME/.dot +alias dot='/usr/bin/git --git-dir="$HOME/.dot/" --work-tree="$HOME"' +dot checkout Linux +dot config --local status.showUntrackedFiles no +source ~/.zshrc +``` + +If there are conflicts: + +```sh +mkdir -p .dot-backup && \ +dot checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \ +xargs -I{} mv {} .dot-backup/{} +dot checkout +``` + +### Managing dotfiles + +**Adding or Modifying files** + +```sh +dot add .zshrc +dot commit -m "Update .zshrc" +dot push +``` + +## Usage on Windows + +### Checking out the repo + +```ps1 +PowerShell -NoProfile -ExecutionPolicy Bypass +git clone --bare https://git.theflyingfool.com/theflyingfool/dotfiles.git $HOME/.dot +if (!(Test-Path -Path $PROFILE)) { + # Create the profile + New-Item -Type File -Path $PROFILE -Force +} +"`nfunction dot { & git --git-dir=`"$HOME/.dot/`" --work-tree=`"$HOME`" @args }" | Out-File -Append $PROFILE +. $PROFILE +dot checkout -b Windows +dot config --local status.showUntrackedFiles no +"`n. `"$HOME/windows/Microsoft.PowerShell_profile.ps1`"" | Out-File -Append $PROFILE +``` From e45f0b64bfec611559902ffdfb713b4ae5edbabd Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Mon, 10 Jun 2024 19:05:15 -0500 Subject: [PATCH 4/5] Working to unbranch due to not working as expected --- windows/Microsoft.PowerShell_profile.ps1 | 15 +++++++++++++++ windows/Microsoft.VSCode_profile.ps1 | 9 +++++++++ windows/aliases.ps1 | 7 +++++++ 3 files changed, 31 insertions(+) create mode 100644 windows/Microsoft.PowerShell_profile.ps1 create mode 100644 windows/Microsoft.VSCode_profile.ps1 create mode 100644 windows/aliases.ps1 diff --git a/windows/Microsoft.PowerShell_profile.ps1 b/windows/Microsoft.PowerShell_profile.ps1 new file mode 100644 index 0000000..9e8d80b --- /dev/null +++ b/windows/Microsoft.PowerShell_profile.ps1 @@ -0,0 +1,15 @@ +Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { + param($wordToComplete, $commandAst, $cursorPosition) + [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() + $Local:word = $wordToComplete.Replace('"', '""') + $Local:ast = $commandAst.ToString().Replace('"', '""') + winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } + } + + +function dot { & git --git-dir="$HOME/.dot/" --work-tree="$HOME" @args } + +# Source the aliases.ps1 file +. "$PSScriptRoot/aliases.ps1" diff --git a/windows/Microsoft.VSCode_profile.ps1 b/windows/Microsoft.VSCode_profile.ps1 new file mode 100644 index 0000000..63c8fce --- /dev/null +++ b/windows/Microsoft.VSCode_profile.ps1 @@ -0,0 +1,9 @@ +Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { + param($wordToComplete, $commandAst, $cursorPosition) + [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() + $Local:word = $wordToComplete.Replace('"', '""') + $Local:ast = $commandAst.ToString().Replace('"', '""') + winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } + } diff --git a/windows/aliases.ps1 b/windows/aliases.ps1 new file mode 100644 index 0000000..8030e1f --- /dev/null +++ b/windows/aliases.ps1 @@ -0,0 +1,7 @@ +function Upgrade-All { winget upgrade --all } + +Set-Alias -Name Syu -Value Upgrade-All + +function touch($file) { + "" | Out-File $file -Encoding ASCII +} \ No newline at end of file From 069b0db678ece697d2cbf474e89c5560a15780c5 Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Mon, 10 Jun 2024 19:06:07 -0500 Subject: [PATCH 5/5] Still working on fixing dumb idea --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5224e64..42c293c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ My dotfiles for both Arch Linux and Windows ```sh git clone --bare gitea@git.theflyingfool.com:theflyingfool/dotfiles.git $HOME/.dot alias dot='/usr/bin/git --git-dir="$HOME/.dot/" --work-tree="$HOME"' -dot checkout Linux +dot checkout dot config --local status.showUntrackedFiles no source ~/.zshrc ``` @@ -46,7 +46,7 @@ if (!(Test-Path -Path $PROFILE)) { } "`nfunction dot { & git --git-dir=`"$HOME/.dot/`" --work-tree=`"$HOME`" @args }" | Out-File -Append $PROFILE . $PROFILE -dot checkout -b Windows +dot checkout dot config --local status.showUntrackedFiles no "`n. `"$HOME/windows/Microsoft.PowerShell_profile.ps1`"" | Out-File -Append $PROFILE ```