### Execute Raspberry Pi Dotfiles Main Setup Source: https://github.com/bartste/dotfiles-windows/blob/master/README.md This command executes the main setup script for Raspberry Pi (Debian-based) systems, applying Pi-specific configurations. ```bash ~/dotfiles-pi/main ``` -------------------------------- ### Initialize Linux Dotfiles Installation Source: https://github.com/bartste/dotfiles-windows/blob/master/README.md This bash script initializes the Linux dotfiles setup by downloading and executing an initialization script. It then cleans up the downloaded script. ```bash curl -O https://raw.githubusercontent.com/BartSte/dotfiles/master/dotfiles/initialize && bash ./initialize; rm ./initialize ``` -------------------------------- ### Execute Arch Linux Dotfiles Main Setup Source: https://github.com/bartste/dotfiles-windows/blob/master/README.md This command executes the main setup script specifically for Arch Linux, applying Arch-specific configurations. ```bash ~/dotfiles-arch/main ``` -------------------------------- ### Execute Windows Dotfiles Main Setup Source: https://github.com/bartste/dotfiles-windows/blob/master/README.md After initialization, this command executes the main setup script for Windows dotfiles. It is typically run from the user's home directory and applies the core configurations. ```powershell $HOME/dotfiles-windows/main.ps1 ``` -------------------------------- ### Execute Linux Dotfiles Main Setup Source: https://github.com/bartste/dotfiles-windows/blob/master/README.md This command executes the main setup script for Linux dotfiles, applying common configurations across different Linux distributions. ```bash ~/dotfiles-linux/main ``` -------------------------------- ### Run Complete Windows Setup - PowerShell Source: https://context7.com/bartste/dotfiles-windows/llms.txt Orchestrates the complete Windows setup process by first creating a user configuration file and then executing the main setup script. Requires administrator privileges and a pre-defined configuration file. ```powershell # Run the complete Windows setup # Requires: ~/dotfiles-config.ps1 with user settings # First create the config file @" `$computer_name = "mypc" `$git_settings=@{user='username'; email='user@example.com'} `$wall_paper = "`$HOME\dotfiles\static\wallpaper.png" `$env_paths="" `$install = @( @('neovim', '--pre'), @('fzf', ''), @('nodejs', '') ) `$disable = @() `$uninstall = @() "@ | Out-File -FilePath "$HOME\dotfiles-config.ps1" -Encoding UTF8 # Execute main setup (run as Administrator) . "$HOME/dotfiles-windows/main.ps1" # Output: Configures PowerShell, installs dependencies, applies Windows settings ``` -------------------------------- ### Setup PowerShell Package Providers - PowerShell Source: https://context7.com/bartste/dotfiles-windows/llms.txt Ensures that the NuGet package provider is installed and configures the PSGallery as a trusted repository for installing PowerShell modules. It also updates the PackageManagement module if an older version is detected. ```powershell function Install-Nuget { if (-not (Get-PackageProvider-Installation-Status -PackageProviderName "NuGet")) { Write-Host "Installing NuGet as package provider:" -ForegroundColor "Green" Install-PackageProvider -Name "NuGet" -Force } } function Install-PSGallery { if (-not (Get-PSRepository-Trusted-Status -PSRepositoryName "PSGallery")) { Write-Host "Setting up PSGallery as PowerShell trusted repository:" -ForegroundColor "Green" Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted } } function Install-PackageManagement { if (-not (Get-Module-Installation-Status -ModuleName "PackageManagement" -ModuleMinimumVersion "1.4.6")) { Write-Host "Updating PackageManagement module:" -ForegroundColor "Green" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Install-Module -Name "PackageManagement" -Force -MinimumVersion "1.4.6" \ -Scope "CurrentUser" -AllowClobber -Repository "PSGallery" } } ``` -------------------------------- ### Initialize Windows Dotfiles Installation Source: https://github.com/bartste/dotfiles-windows/blob/master/README.md This PowerShell script initializes the Windows dotfiles setup. It bypasses execution policy, checks for administrator privileges, sets the security protocol for TLS 1.2, and downloads and executes the main initialization script from the GitHub repository. ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544"); [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/BartSte/dotfiles-windows/master/dotfiles-windows/initialize.ps1')) ``` -------------------------------- ### Install Scoop Package Manager - PowerShell Source: https://context7.com/bartste/dotfiles-windows/llms.txt Installs the Scoop package manager if it's not already present and adds common buckets like 'extras', 'nerd-fonts', and 'versions'. It also ensures Git is installed, as it's required for Scoop buckets. ```powershell function Install-Scoop { # Install Scoop if not present if (-not (Get-Command scoop -ErrorAction SilentlyContinue)) { Set-ExecutionPolicy Bypass -Scope Process -Force [System.Net.ServicePointManager]::SecurityProtocol = \ [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 iex (iwr -useb get.scoop.sh) } # Install git (required for buckets) if (-not (Get-Command git -ErrorAction SilentlyContinue)) { scoop install git } # Add additional buckets $buckets = @("extras", "nerd-fonts", "versions") $existing = scoop bucket list foreach ($bucket in $buckets) { if ($existing -notcontains $bucket) { scoop bucket add $bucket } } } # Install desktop applications from config function Install-Desktop-Apps { foreach ($app in $install) { scoop install $app[0] } } # Usage Install-Scoop Install-Desktop-Apps # Installs: neovim, fzf, nodejs, JetBrainsMono-NF, etc. ``` -------------------------------- ### Install PowerShell Modules Source: https://context7.com/bartste/dotfiles-windows/llms.txt Installs essential PowerShell modules for system management and user experience enhancement. This includes modules for updating the system, improving command-line editing, and managing terminal appearance. ```powershell Install-NuGet Install-PSGallery Install-PackageManagement Install-Module PSWindowsUpdate -Scope CurrentUser -Force Install-Module PSReadline -Scope CurrentUser -Force Install-Module PSFzf Install-Module Terminal-Icons Install-Module Recycle ``` -------------------------------- ### Deploy and Configure KMonad Keyboard Remapping Source: https://context7.com/bartste/dotfiles-windows/llms.txt Scripts to download the KMonad executable and tray icon, create desktop shortcuts, and define complex keyboard layouts using Lisp-style configuration. Supports home row modifiers and custom layers. ```powershell function download_kmonad($version) { $source = "https://github.com/kmonad/kmonad/releases/download/$version/kmonad-$version-win.exe" $destination_dir = "$Env:LOCALAPPDATA\kmonad" $destination = "$destination_dir\kmonad.exe" Write-Host "Downloading Kmonad version: $version" if (-not (Test-Path $destination_dir)) { New-Item -ItemType Directory -Path $destination_dir } else { Remove-Item $destination -ErrorAction SilentlyContinue } Invoke-WebRequest -Uri $source -OutFile $destination } function download_trayicon($version) { $source = "https://github.com/BartSte/trayicon/releases/download/$version/trayicon-$version.exe" $destination_dir = "$Env:LOCALAPPDATA\kmonad" $destination = "$destination_dir\trayicon.exe" Write-Host "Downloading Trayicon version: $version" if (-not (Test-Path $destination_dir)) { New-Item -ItemType Directory -Path $destination_dir } Invoke-WebRequest -Uri $source -OutFile $destination } function symlink_to_desktop { $source = "$HOME\dotfiles-windows\kmonad\start.vbs" $destination = "$HOME\Desktop\Kmonad" Remove-Item $destination -ErrorAction SilentlyContinue New-Item -ItemType SymbolicLink -Path $destination -Target $source } ``` ```lisp (defcfg input (low-level-hook) output (send-event-sink) fallthrough true allow-cmd true ) (defsrc q w e r t y u i o p a s d f g h j k l ; lsft z x c v b n m , . / lmet lalt space ralt rctl ) (defalias ma (tap-hold-next-release 200 a lmet) ar (tap-hold-next-release 200 r lalt) ss (tap-hold-next-release 200 s lsft) ct (tap-hold-next-release 200 t lctl) cn (tap-hold-next-release 200 n rctl) se (tap-hold-next-release 200 e rsft) ai (tap-hold-next-release 200 i lalt) mo (tap-hold-next-release 200 o rmet) num_f (tap-hold-next-release 200 f (layer-toggle numpad)) sym_u (tap-hold-next-release 200 u (layer-toggle symbols)) nav_tab (tap-hold-next-release 200 tab (layer-toggle navigation_right)) ) (deflayer homerowmods q w @num_f p b j l @sym_u y ; @ma @ar @ss @ct _ m @cn @se @ai @mo z x c d v _ k h , . / esc @nav_tab space _ del ) ``` -------------------------------- ### Define Shell Aliases for Navigation and Git Source: https://context7.com/bartste/dotfiles-windows/llms.txt Creates shorthand aliases for directory navigation and manages bare Git repositories for dotfile synchronization. ```powershell ${function:~} = { Set-Location $Env:USERPROFILE } ${function:Set-ParentLocation} = { Set-Location .. }; Set-Alias ".." Set-ParentLocation ${function:...} = { Set-Location ..\.. } ${function:base} = { git.exe --git-dir="$env:USERPROFILE\dotfiles.git\" --work-tree=$env:USERPROFILE @args } ${function:basec} = { Write-Host 'Base:' base add $Env:USERPROFILE/dotfiles base commit --untracked-files=no -a -m "Automatic update" } ``` -------------------------------- ### Manage System PATH and Environment Variables Source: https://context7.com/bartste/dotfiles-windows/llms.txt Provides helper functions to manipulate the system PATH and sets essential environment variables for development tools like Neovim, CMake, and Python debugging. ```powershell function Append-Path($path) { $Env:PATH += "$path;" } function Prepend-Path($path) { $Env:PATH = "$path;$Env:PATH" } function Reset-Path { $Env:PATH = [System.Environment]::GetEnvironmentVariable("Path", "User") $Env:PATH += [System.Environment]::GetEnvironmentVariable("Path", "Machine") } Reset-Path Append-Path "$Env:LOCALAPPDATA\nvim-data\plugged\fzf\bin" $Env:EDITOR = "nvim.exe" $Env:PYTHONBREAKPOINT = "ipdb.set_trace" ``` -------------------------------- ### Global Git Configuration using PowerShell Source: https://context7.com/bartste/dotfiles-windows/llms.txt Configures global Git settings, including user name, email, and line ending handling (autocrlf) for cross-platform compatibility. It relies on a separate PowerShell script for defining user-specific Git settings. ```powershell # Load user config . ~/dotfiles-config.ps1 # Configure git globally git config --global user.name $git_settings['user'] git config --global user.email $git_settings['email'] git config --global core.autocrlf true # Example dotfiles-config.ps1 settings $git_settings = @{ user = 'John Smith' email = 'john@example.com' } ``` -------------------------------- ### Customize Windows Appearance and Explorer Settings Source: https://context7.com/bartste/dotfiles-windows/llms.txt Applies custom Windows appearance settings, including setting the wallpaper, showing file extensions in File Explorer, enabling the classic context menu, and enforcing dark mode. These changes are applied via registry modifications. ```powershell function Set-WallPaper([string]$desktopImage) { Set-ItemProperty -Path "HKCU:Control Panel\Desktop" -Name WallPaper -Value $desktopImage RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True } function Set-WindowsExplorer-ShowFileExtensions { Write-Host "Configuring Windows File Explorer to show file extensions:" -ForegroundColor "Green" $RegPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" Set-ItemProperty -Path $RegPath -Name "HideFileExt" -Value 0 } function Set-Classic-ContextMenu-Configuration { Write-Host "Activating classic Context Menu:" -ForegroundColor "Green" $RegPath = "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" if (-not (Test-Path -Path $RegPath)) { New-Item -Path $RegPath } $RegPath = $RegPath | Join-Path -ChildPath "InprocServer32" if (-not (Test-Path -Path $RegPath)) { New-Item -Path $RegPath } Set-ItemProperty -Path $RegPath -Name "(Default)" -Value "" Write-Host "Classic Context Menu successfully activated." -ForegroundColor "Green" } # Apply configurations Set-WallPaper "$HOME\dotfiles\static\wallpaper.png" Set-WindowsExplorer-ShowFileExtensions Set-Classic-ContextMenu-Configuration # Enable dark mode Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize \ -Name AppsUseLightTheme -Value 0 # Show hidden files Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1 ``` -------------------------------- ### Configure Alacritty Terminal via Symlinks Source: https://context7.com/bartste/dotfiles-windows/llms.txt Sets up the Alacritty terminal configuration by creating a symbolic link from the dotfiles repository to the standard Windows application data directory. ```powershell $target = "${HOME}\.alacritty.toml" $directory = "${env:APPDATA}\alacritty" $file = "alacritty.toml" $path = "${directory}\${file}" Write-Host $path if (!(Test-Path $directory)) { New-Item -ItemType Directory -Force -Path $directory } else { Remove-Item $path -ErrorAction SilentlyContinue } New-Item -ItemType SymbolicLink -Path $path -Target $target ``` -------------------------------- ### Configure PowerShell Vi Mode and FZF Integration Source: https://context7.com/bartste/dotfiles-windows/llms.txt Enables Vi editing mode in PowerShell with visual cursor feedback and integrates FZF for enhanced tab completion and command history navigation. ```powershell function OnViModeChange { if ($args[0] -eq 'Command') { Write-Host -NoNewLine "`e[2 q" } else { Write-Host -NoNewLine "`e[6 q" } } Set-PSReadlineOption -EditMode vi Set-PSReadLineOption -ViModeIndicator Script -ViModeChangeHandler $Function:OnViModeChange Set-PsFzfOption -PSReadlineChordProvider 'alt-o' ` -PSReadlineChordReverseHistory 'Ctrl+r' Set-PSReadLineKeyHandler -Key Tab -ScriptBlock { Invoke-FzfTabCompletion } ``` -------------------------------- ### Manage Dotfiles and CLI Utilities in PowerShell Source: https://context7.com/bartste/dotfiles-windows/llms.txt Provides helper functions for managing dotfile repositories, safely removing files, and querying system commands. These utilities streamline common CLI operations on Windows. ```powershell ${function:dot} = { base @args; win @args; secret @args } ${function:dots} = { Write-Host 'Base:'; bases; Write-Host 'Win:'; wins; Write-Host 'Secret:'; secrets } ${function:dotu} = { dotc; dot pull; dotp } ${function:dl} = { Remove-ItemSafely @args } ${function:ex} = { explorer.exe . } ${function:which} = { Get-Command @args -ErrorAction SilentlyContinue | Select-Object Definition } ``` -------------------------------- ### Configure Power Management Settings Source: https://context7.com/bartste/dotfiles-windows/llms.txt Sets power management configurations to prevent the system from sleeping or hibernating during development sessions. This includes disabling timeouts for disks, hibernation, sleep, and setting screen timeout durations. ```powershell function Set-Power-Configuration { Write-Host "Configuring power plan:" -ForegroundColor "Green" # AC: Alternating Current (Wall socket) # DC: Direct Current (Battery) # Set turn off disk timeout (0: never) powercfg -change "disk-timeout-ac" 0 powercfg -change "disk-timeout-dc" 0 # Set hibernate timeout (0: never) powercfg -change "hibernate-timeout-ac" 0 powercfg -change "hibernate-timeout-dc" 0 # Set sleep timeout (0: never) powercfg -change "standby-timeout-ac" 0 powercfg -change "standby-timeout-dc" 0 # Set turn off screen timeout (in minutes) powercfg -change "monitor-timeout-ac" 10 powercfg -change "monitor-timeout-dc" 10 # Lock screen timeout (in seconds) powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 30 powercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 30 powercfg /SETACTIVE SCHEME_CURRENT Write-Host "Power plan successfully updated." -ForegroundColor "Green" } Set-Power-Configuration ``` -------------------------------- ### Manage Windows Features and App Packages Source: https://context7.com/bartste/dotfiles-windows/llms.txt Provides functions to disable unwanted Windows features and uninstall pre-installed bloatware applications. It checks the current status of a feature before attempting to disable it and handles potential errors during app package removal. ```powershell function Disable-WindowsFeature { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $TRUE)] [String] $FeatureKey, [Parameter(Position = 1, Mandatory = $TRUE)] [String] $FeatureName ) if (Get-WindowsFeature-Installation-Status $FeatureKey) { Write-Host "Disabling $FeatureName :" -ForegroundColor "Green" Disable-WindowsOptionalFeature -FeatureName $FeatureKey -Online -NoRestart } else { Write-Host "$FeatureName is already disabled." -ForegroundColor "Green" } } function Uninstall-AppPackage { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $TRUE)] [String] $Name ) try { Get-AppxPackage $Name -AllUsers | Remove-AppxPackage Get-AppXProvisionedPackage -Online | Where-Object DisplayName -like $Name | Remove-AppxProvisionedPackage -Online } catch { } } # Disable Windows features $disable = @( @("WindowsMediaPlayer", "Windows Media Player"), @("Internet-Explorer-Optional-amd64", "Internet Explorer"), @("WorkFolders-Client", "WorkFolders-Client") ) foreach ($app in $disable) { Disable-WindowsFeature $app[0] $app[1] } # Uninstall bloatware $uninstall = @( "Microsoft.BingNews", "Microsoft.GetStarted", "Microsoft.WindowsFeedbackHub", "Microsoft.XboxApp" ) foreach ($app in $uninstall) { Uninstall-AppPackage $app } ``` -------------------------------- ### Harden Windows Privacy Settings via PowerShell Source: https://context7.com/bartste/dotfiles-windows/llms.txt Configures registry keys to disable telemetry, advertising IDs, application tracking, and SmartScreen filters. It also iterates through a list of system permissions to deny access to sensitive user data. ```powershell # Disable advertising ID if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Type Folder | Out-Null } Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" 0 # Disable application launch tracking Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start-TrackProgs" 0 # Disable SmartScreen Filter Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" "EnableWebContentEvaluation" 0 # Deny app permissions $permissions = @( "userAccountInformation", "contacts", "appointments", "phoneCall", "phoneCallHistory", "appDiagnostics", "documentsLibrary", "email", "location", "chat", "picturesLibrary", "radios", "userDataTasks", "bluetoothSync", "videosLibrary" ) foreach ($permission in $permissions) { Set-ItemProperty ` "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\$permission" ` "Value" "Deny" } # Set telemetry to Basic (1) Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" 1 # Disable feedback prompts if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Type Folder -Force | Out-Null } Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" "NumberOfSIUFInPeriod" 0 ``` -------------------------------- ### Activate and Deactivate Python Virtual Environments Source: https://context7.com/bartste/dotfiles-windows/llms.txt Automates the activation and deactivation of Python virtual environments located in a .venv folder within the current directory. It checks for the existence of the directory before attempting to execute the environment scripts. ```powershell function act { $folder = $(Split-Path -Path (Get-Location) -Leaf) $venv = "$PWD\.venv" if (Test-Path $venv) { & $(Join-Path -Path $venv -Child "Scripts\Activate.ps1") } else { Write-Host "No python virtualenvironment found for: $folder" } } function deact { $folder = $(Split-Path -Path (Get-Location) -Leaf) $venv = "$PWD\.venv" if (Test-Path $venv) { & $(Join-Path -Path $venv -Child "Scripts\Deactivate.ps1") } else { Write-Host "No python virtualenvironment found for: $folder" } } ``` -------------------------------- ### Alacritty Terminal Configuration Source: https://context7.com/bartste/dotfiles-windows/llms.txt Configures the Alacritty terminal emulator, including the default shell, background transparency, window opacity, bell settings, and font preferences. ```toml [terminal] shell = "Arch.exe" # Use WSL Arch as default shell [colors] transparent_background_colors = false [window] opacity = 1.0 [bell] command = "None" duration = 0 [font] size = 9 [font.normal] family = "JetBrainsMono Nerd Font" style = "Regular" [font.bold] family = "JetBrainsMono Nerd Font" style = "Bold" [font.italic] family = "JetBrainsMono Nerd Font" style = "Italic" ``` -------------------------------- ### Admin Privilege Check - PowerShell Source: https://context7.com/bartste/dotfiles-windows/llms.txt Verifies if the current PowerShell session is running with administrator privileges. If not, it displays an error message and exits the script. This is crucial for system-level configurations. ```powershell # Source the helpers . ~/dotfiles-windows/helpers.ps1 # Check if running as administrator function Admin-Check { if (!(Verify-Elevated)) { Write-Host 'You need to be an Admin to run this script.' exit } } function Verify-Elevated { $myIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $myPrincipal = New-Object System.Security.Principal.WindowsPrincipal($myIdentity) return $myPrincipal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator) } # Usage Admin-Check # Exits if not admin Write-Host "Running with administrator privileges" ``` -------------------------------- ### Configure Privacy Registry Settings Source: https://context7.com/bartste/dotfiles-windows/llms.txt Modifies Windows registry values to enhance user privacy by disabling telemetry, advertising identifiers, and certain app permissions. This script targets specific registry keys to control data collection and sharing. ```powershell # Privacy Registry Settings # Configures Windows privacy settings by modifying registry values to disable telemetry, advertising, and app permissions. # Disable Telemetry Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Value 0 # Disable Advertising ID Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Value 0 # Disable App Permissions (Example: Location) Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Value "Deny" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.