]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
Merge branch 'main' of github.com:edthedev/dotfiles
authorEdward Delaporte <delaport@illinois.edu>
Mon, 13 Nov 2023 14:17:26 +0000 (08:17 -0600)
committerEdward Delaporte <delaport@illinois.edu>
Mon, 13 Nov 2023 14:17:26 +0000 (08:17 -0600)
doc/start_windows.md
doc/synoloyg_nas.md [new file with mode: 0644]
files/Microsoft.PowerShell_profile.ps1
files/load_modules.ps1
files/paths.ps1
psmodules/file_management.psm1 [moved from psmodules/drivespace.psm1 with 68% similarity]
psmodules/sprint.psm1 [deleted file]
psmodules/stay_awake.psm1 [moved from win/stay_awake.ps1 with 100% similarity]

index 539194e488c51e0c09dcc577878576323a22f7c4..29629acb49d16e53330bc9b544b173bef125d23a 100644 (file)
@@ -56,3 +56,18 @@ Set git username.
 git config --global user.email "edward@delaporte.us"
 git config --global user.name "Edward Delaporte"
 ```
+
+
+## Setup PowerShell Profile
+
+Edit your actual profile,
+```
+code $profile
+```
+
+And add something like:
+
+``` powershell
+$env:realProfile = "$HOME\dotfiles\files\Microsoft.PowerShell_profile.ps1"
+$profileContents = [string]::join([environment]::newline, (get-content -path $env:realProfile));invoke-expression $profileContents
+```
diff --git a/doc/synoloyg_nas.md b/doc/synoloyg_nas.md
new file mode 100644 (file)
index 0000000..6029b6e
--- /dev/null
@@ -0,0 +1,13 @@
+\r
+\r
+## Client Setup\r
+\r
+1. In the Synology web interface, under 'Synology Drive', there are direct links to download the Drive client.\r
+\r
+1. Setup a sync job or two.\r
+\r
+1. You're going to want to edit XLS files.\r
+\r
+    ```powershell\r
+    winget install --id=TheDocumentFoundation.LibreOffice  -e\r
+    ```
\ No newline at end of file
index 4b70fe83950fa9bc26ddeefe9567e16109b45e0d..04d9c45c1fc10a753e81db3f29a8b25c1d8916a1 100644 (file)
@@ -1,8 +1,8 @@
-$env:src = "~\src"
-Import-Module $env:src\dotfiles\psmodules\add_to_profile.psm1
-Add-ToProfile $env:src\dotfiles\files\paths.ps1
-Add-ToProfile $env:src\dotfiles\files\env.ps1
-Add-ToProfile $env:src\dotfiles\files\load_modules.ps1
+$env:src = "$HOME\src"
+$env:dotfiles = "$HOME\dotfiles"
+Import-Module $env:dotfiles\psmodules\add_to_profile.psm1
+Add-ToProfile $env:dotfiles\files\paths.ps1
+Add-ToProfile $env:dotfiles\files\env.ps1
 
 # Delay loading PoshGit for speed. 
 function Enable-PoshGit {
@@ -22,6 +22,13 @@ Set-PSReadlineOption -EditMode Vi
 
 Write-Host "+ Type 'pg' to enable PoshGit"
 Write-Host 'See $env:realProfile for version controlled profile file.'
+
+# Load some modules
+$env:psmodules = "$env:dotfiles\psmodules"
+Import-Module "$env:psmodules\dash.psm1"
+Import-Module $env:PSModules\file_management.psm1
+Import-Module "$env:psmodules\fix_vpn.psm1"
+
 # Let's face it, I'm about to cd into my source directory
 if((Get-Location).Path -eq $HOME){ cd $env:src }
 
@@ -29,4 +36,4 @@ function Get-JournalAgenda() {
     # Write-Host "Reading from $HOME\Journal\{YYYY}\{MM}-{DD}.md"
     agenda.exe -path "$HOME\Journal\{YYYY}\{MM}-{DD}.md"
 }
-New-Alias today Get-JournalAgenda
\ No newline at end of file
+New-Alias today Get-JournalAgenda
index 380480258b2666c9f425d3e93f827452bd4f80e7..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,5 +0,0 @@
-
-$modPath = "$env:src\dotfiles\psmodules"
-Import-Module "$modPath\dash.psm1"
-Import-Module "$modPath\drivespace.psm1"
-Import-Module "$modPath\fix_vpn.psm1"
\ No newline at end of file
index 1b53bb88f3ff8ab411530c6ec9d246cbd87d0f45..b57e14a1fa726670aaad4bb2e50e61c1d04ee294 100644 (file)
@@ -15,10 +15,10 @@ function Add-ToPath {
 if($IsWindows){
        # Some Paths that are annoying to find/restore if the installer fails
        Add-ToPath "C:\Program Files\Git\cmd" # Version control is nice.
-       Add-ToPath "C:\Program Files\Microsoft VS Code\bin" # One Editor to rule them all
+       Add-ToPath "C:\Program Files\Microsoft VS Code\bin" -optional # One Editor to rule them all
        Add-ToPath "C:\Program Files\Git\cmd" # Version control is nice.
        Add-ToPath "C:\ProgramData\chocolatey\bin" # Package management is nice.
-       Add-ToPath "C:\Program Files (x86)\GnuWin32\bin" # GNU Utils - i.e. rm
+       Add-ToPath "C:\Program Files (x86)\GnuWin32\bin" -optional # GNU Utils - i.e. rm
        Add-ToPath "C:\bin\x16emu" -optional # X16 Emulator
        Add-ToPath "$env:src\x16-demo\tools" -optional # x16 python tools
        Add-ToPath "$env:src\flutter\bin" -optional # Flutter for Dart
@@ -35,4 +35,8 @@ else {
 # Command line tools
 Add-ToPath "$env:src\chart" -optional # command line chart utility edthedev\chart
 Add-ToPath "$env:src\agenda" -optional # command line chart utility edthedev\chart
-Add-ToPath "$env:src\todolist" -optional # todo list utility edthedev\todolist
\ No newline at end of file
+Add-ToPath "$env:src\todolist" -optional # todo list utility edthedev\todolist
+
+
+# $env:path+=";C:\Program Files\Git\bin"
+# $env:path+=";C:\Program Files (x86)\Microsoft VS Code\"
similarity index 68%
rename from psmodules/drivespace.psm1
rename to psmodules/file_management.psm1
index b946f86d9f71531db914e71ae828d917e07aef4d..bbb6fa12bd2a3eaf2accd2ffc5f79965711b731d 100644 (file)
@@ -42,3 +42,20 @@ Get-Job -Name "FileCollection" | Remove-Job
 
 Export-ModuleMember -Function Show-DriveSpace 
 Export-ModuleMember -Function Show-LargeFiles
+
+# Stay awake to allow large transfers to complete
+#    without permanently giving up battery saving features
+function Invoke-StayAwake() {
+       param($minutes=90)
+       $wsh = New-Object -ComObject WScript.Shell
+       do{
+               "Staying awake for $minutes minutes"
+       $minutes-=1;
+       # Send Shift+F15
+       $wsh.SendKeys('+{F15}')
+       Start-Sleep -seconds 59
+       }until($minutes -lt 0)
+       # Thank you to http://www.zhornsoftware.co.uk/caffeine/
+}
+
+Export-ModuleMember -Function Invoke-StayAwake
\ No newline at end of file
diff --git a/psmodules/sprint.psm1 b/psmodules/sprint.psm1
deleted file mode 100644 (file)
index 74040fb..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-
-function Show-SprintCharts(){
-    $closed = Get-GHClosed
-    $closed_count = ($closed | Measure-Object).Count
-       Add-Content -Path ~/.chart_closed -Value "|$closed_count"
-       $env:closed =  Get-Content -Path ~/.chart_closed
-
-    $orphans = Get-GHNoMilestone -repository SecOps-Tools
-    $orphans_count = ($orphans | Measure-Object -Property updated_at -Min -Max).Count
-       Add-Content -Path ~/.chart_orphans -Value "|$orphans_count"
-       $env:orphans =  Get-Content -Path ~/.chart_orphans
-
-    $unsized = Get-GHUnsized
-    $unsized_count = ($unsized | Measure-Object).Count
-       Add-Content -Path ~/.chart_unsized -Value "|$unsized_count"
-       $env:unsized =  Get-Content -Path ~/.chart_unsized
-
-    Write-Host "## Closed Issues this Sprint: $closed_count"
-    Write-Host "'''sh"
-    chart -var "closed"
-    Write-Host "''' "
-    Write-Host "## Count of Unsized Issues: $unsized_count"
-    Write-Host "'''sh"
-    chart -var "unsized"
-    Write-Host "''' "
-    Write-Host "## Count of Issues with no milestone: $orphans_count"
-    Write-Host "'''sh"
-    chart -var "orphans"
-    Write-Host "''' "
-
-}
-
-Export-ModuleMember -Function Show-SprintCharts
\ No newline at end of file
similarity index 100%
rename from win/stay_awake.ps1
rename to psmodules/stay_awake.psm1