mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
start to add vagrant bits
This commit is contained in:
parent
bbb50f99f8
commit
d73f9592d8
193
Vagrantfile
vendored
Normal file
193
Vagrantfile
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
# $script_cmder = <<-SCRIPT
|
||||
# choco install -y --force 7zip 7zip.install
|
||||
# choco install -y --force cmder
|
||||
# SCRIPT
|
||||
#
|
||||
# $script_cmderdev = <<-SCRIPT
|
||||
# $env:path = "$env:path;c:/tools/cmder/vendor/git-for-windows/cmd"
|
||||
# c:
|
||||
# cd /Users/Vagrant
|
||||
# git clone https://github.com/cmderdev/cmder cmderdev
|
||||
# TAKEOWN /F c:/Users/vagrant/cmderdev /R /D y /s localhost /u vagrant /p vagrant
|
||||
# cd cmderdev
|
||||
# git remote add upstream https://github.com/cmderdev/cmder
|
||||
# git pull upstream master
|
||||
#
|
||||
# # cmd.exe "/K" '"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat" && powershell -command "& ''c:/Users/Vagrant/cmderdev/scripts/build.ps1'' -verbose -compile" && exit'
|
||||
# # copy c:/Users/Vagrant/cmderdev/launcher/x64/release/cmder.exe c:/Users/Vagrant/cmderdev
|
||||
# # cmd.exe "/K" '"C:/Program Files (x86)/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat" && powershell -noexit -command "& ''build.ps1 -verbose -compile''"'
|
||||
#
|
||||
# cd scripts
|
||||
# ./build.ps1 -verbose
|
||||
#
|
||||
# copy C:/Tools/Cmder/Cmder.exe C:/Users/Vagrant/cmderdev
|
||||
#
|
||||
# # tabby
|
||||
# setx cmder_root '%userprofile%/cmderdev'
|
||||
#
|
||||
# # VSCode
|
||||
# $VSCodeUserSettings = "$env:APPDATA/Code/User"
|
||||
# $VSCodeSettings = "$VSCodeUserSettings/settings.json";
|
||||
# $VSCodeSettingsNew = $VSCodeSettings.replace('.json', '-new.json')
|
||||
#
|
||||
# if (test-path $VSCodeSettings) {
|
||||
# $data = get-content -path $VSCodeSettings -ErrorAction silentlycontinue | out-string | ConvertFrom-Json
|
||||
# }
|
||||
# else {
|
||||
# New-Item -ItemType directory $VSCodeUserSettings -force
|
||||
# $data = @{}
|
||||
# }
|
||||
#
|
||||
# write-host $data
|
||||
#
|
||||
# $data | Add-Member -force -Name 'terminal.integrated.defaultProfile.windows' -MemberType NoteProperty -Value "Cmder"
|
||||
#
|
||||
# if ($null -eq $data.'terminal.integrated.profiles.windows') {
|
||||
# write-host "Adding 'terminal.integrated.profiles.windows'..."
|
||||
# $data | Add-Member -force -Name 'terminal.integrated.profiles.windows' -MemberType NoteProperty -Value @{}
|
||||
# }
|
||||
#
|
||||
# write-host "Adding 'terminal.integrated.profiles.windows.Cmder' profile..."
|
||||
# $data.'terminal.integrated.profiles.windows'.'Cmder' = @{
|
||||
# "name" = "Cmder";
|
||||
# "path" = @(
|
||||
# "`${env:windir}/Sysnative/cmd.exe";
|
||||
# "`${env:windir}/System32/cmd.exe";
|
||||
# );
|
||||
# "args" = @(
|
||||
# "/k";
|
||||
# "`${env:USERPROFILE}/cmderdev/vendor/bin/vscode_init.cmd");
|
||||
# "icon" = "terminal-cmd";
|
||||
# "color" = "terminal.ansiGreen";
|
||||
# };
|
||||
#
|
||||
# $data | ConvertTo-Json -depth 100 | set-content $VSCodeSettings
|
||||
#
|
||||
# # Windows Terminal
|
||||
# start-process wt.exe
|
||||
# sleep 5
|
||||
# kill (get-process windowsterminal).id
|
||||
# $windowsTerminalFolder = (dir "C:/Users/vagrant/AppData/Local/Packages/Microsoft.WindowsTerminal_*").name
|
||||
# $windowsTerminalPath = 'C:/Users/vagrant/AppData/Local/Packages/' + $windowsTerminalFolder
|
||||
# $windowsTerminalSettings = $windowsTerminalPath + '/localState/settings.json'
|
||||
# $windowsTerminalSettingsNew = $windowsTerminalPath + '/localState/settings-new.json'
|
||||
# $json = get-content $windowsTerminalSettings | ConvertFrom-Json
|
||||
# $json.defaultProfile="{00000000-0000-0000-ba54-000000000132}"
|
||||
#
|
||||
# $cmderFound = $false
|
||||
# $cmderAsAdminFound = $false
|
||||
#
|
||||
# foreach ($profile in $json.profiles.list) {
|
||||
# if ($profile.Name -eq "Cmder") {
|
||||
# $cmderFound = $true
|
||||
# }
|
||||
# elseIf ($profile.Name -eq "Cmder as Admin") {
|
||||
# $cmderAsAdminFound = $true
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# if (-not $cmderFound) {
|
||||
# write-host "Adding 'Cmder' to Windows Terminal..."
|
||||
#
|
||||
# $json.profiles.list += @{
|
||||
# commandline="cmd.exe /k `"%USERPROFILE%/cmderdev/vendor/init.bat`"";
|
||||
# startingDirectory="%USERPROFILE%/cmderdev";
|
||||
# icon="%USERPROFILE%/cmderdev/icons/cmder.ico";
|
||||
# closeOnExit="graceful";
|
||||
# guid="{00000000-0000-0000-ba54-000000000132}";
|
||||
# hidden=$false;
|
||||
# name="Cmder"
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# if (-not $cmderAsAdminFound) {
|
||||
# write-host "Adding 'Cmder as Admin' to Windows Terminal..."
|
||||
#
|
||||
# $json.profiles.list += @{
|
||||
# commandline="cmd.exe /k `"%USERPROFILE%/cmderdev/vendor/init.bat`"";
|
||||
# startingDirectory="%USERPROFILE%/cmderdev";
|
||||
# icon="%USERPROFILE%/cmderdev/icons/cmder_red.ico";
|
||||
# closeOnExit="graceful";
|
||||
# guid="{00000000-0000-0000-ba54-000000000133}";
|
||||
# hidden=$false;
|
||||
# elevate=$true;
|
||||
# name="Cmder as Admin"
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# $json | ConvertTo-Json -depth 100 | set-content $windowsTerminalSettings
|
||||
#
|
||||
# # C:\Users\vagrant\AppData\Roaming\Hyper
|
||||
# # // shell: '',
|
||||
# # shell: 'cmd.exe',
|
||||
# # // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
|
||||
# # // by default `['--login']` will be used
|
||||
# # // shellArgs: ['--login'],
|
||||
# # shellArgs: ['/k', 'C:\\users\\vagrant\\cmderdev\\vendor\\init.bat'],
|
||||
#
|
||||
# C:/Users/Vagrant/bin/set-shortcut.ps1 -SourceExe "C:\\tools\\Cmder\\Cmder.exe" -DestinationPath "C:\\Users\\vagrant\\Desktop\\Cmder.lnk" -WorkingDirectory C:\\tools\\Cmder
|
||||
# C:/Users/vagrant/bin/set-shortcut.ps1 -SourceExe "C:\\Users\\vagrant\\cmderdev\\Cmder.exe" -DestinationPath "C:\\Users\\vagrant\\Desktop\\Cmderdev.lnk" -WorkingDirectory C:\\Users\\vagrant\\cmderdev
|
||||
#
|
||||
# SCRIPT
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
required_plugins = %w( vagrant-vbguest )
|
||||
required_plugins.each do |plugin|
|
||||
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
|
||||
end
|
||||
|
||||
# config.vbguest.iso_path = "../../../../usr/share/virtualbox/VBoxGuestAdditions.iso"
|
||||
config.vbguest.allow_downgrade = true
|
||||
|
||||
config.vm.define "cmderdev-10" do |win10|
|
||||
win10.vm.hostname = "cmderdev-10"
|
||||
win10.vm.box = "cmderdev-10"
|
||||
|
||||
# win10.vm.network :private_network, ip: "192.168.56.101"
|
||||
|
||||
win10.vm.provider :virtualbox do |v|
|
||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
v.customize ["modifyvm", :id, "--name", "cmderdev-10"]
|
||||
v.customize ["modifyvm", :id, "--ostype", "Windows10_64"]
|
||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]
|
||||
v.customize ["modifyvm", :id, "--memory", 8192]
|
||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
||||
#v.customize ["setextradata", :id, "GUI/ScaleFactor", "1.75"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "cmderdev-11" do |win11|
|
||||
win11.vm.hostname = "cmderdev-11"
|
||||
win11.vm.box = "cmderdev-11"
|
||||
|
||||
# win11.vm.network :private_network, ip: "192.168.56.111"
|
||||
|
||||
win11.vm.provider :virtualbox do |v|
|
||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
v.customize ["modifyvm", :id, "--name", "cmderdev-11"]
|
||||
v.customize ["modifyvm", :id, "--ostype", "Windows11_64"]
|
||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxvga"]
|
||||
v.customize ["modifyvm", :id, "--memory", 8192]
|
||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
||||
#v.customize ["setextradata", :id, "GUI/ScaleFactor", "1.75"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "cmderdev-10-pro-scaled" do |cmderdev|
|
||||
cmderdev.vm.hostname = 'cmderdev-10-pro'
|
||||
cmderdev.vm.box = "cmderdev-10"
|
||||
|
||||
cmderdev.vm.provider :virtualbox do |v|
|
||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
v.customize ["modifyvm", :id, "--name", "cmderdev-pro"]
|
||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]
|
||||
v.customize ["modifyvm", :id, "--memory", 8192]
|
||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
||||
v.customize ["setextradata", :id, "GUI/ScaleFactor", "1.75"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.provision "file", source: "./scripts/windows_terminal_settings.json.default", destination: "windows_terminal_settings.json.default"
|
||||
config.vm.provision "file", source: "./scripts/windows_terminal_state.json.default", destination: "windows_terminal_state.json.default"
|
||||
config.vm.provision "shell", path: './scripts/vagrantscript.ps1'
|
||||
end
|
44
scripts/vagrantscript.ps1
Normal file
44
scripts/vagrantscript.ps1
Normal file
@ -0,0 +1,44 @@
|
||||
choco install -y --force 7zip 7zip.install
|
||||
choco install -y --force cmder
|
||||
|
||||
$env:path = "$env:path;c:/tools/cmder/vendor/git-for-windows/cmd"
|
||||
c:
|
||||
cd $env:userprofile
|
||||
git clone https://github.com/cmderdev/cmder cmderdev
|
||||
write-host "USERNAME: $env:USERNAME"
|
||||
|
||||
if ("$env:USERNAME" -eq "vagrant" -and -not (test-path "$env:userprofile/cmderdev/vendor/git-for-windows")) {
|
||||
invoke-expression -command "TAKEOWN /F `"$env:userprofile/cmderdev`" /R /D y /s localhost /u vagrant /p vagrant"
|
||||
}
|
||||
|
||||
cd cmderdev
|
||||
git remote add upstream https://github.com/cmderdev/cmder
|
||||
git pull upstream master
|
||||
|
||||
# cmd.exe "/K" '"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat" && powershell -command "& ''$env:userprofile/cmderdev/scripts/build.ps1'' -verbose -compile" && exit'
|
||||
# copy $env:userprofile/cmderdev/launcher/x64/release/cmder.exe $env:userprofile/cmderdev
|
||||
# cmd.exe "/K" '"C:/Program Files (x86)/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat" && powershell -noexit -command "& ''build.ps1 -verbose -compile''"'
|
||||
|
||||
cd scripts
|
||||
./build.ps1 -verbose
|
||||
|
||||
copy C:/Tools/Cmder/Cmder.exe $env:userprofile/cmderdev
|
||||
|
||||
write-host "Creating '${env:USERPROFILE}/Desktop/Cmder.lnk'..."
|
||||
start-process -filePath "$env:userprofile/bin/set-shortcut.ps1" -ArgumentList "-sourceexe `"C:\\tools\\Cmder\\Cmder.exe`" -DestinationPath `"C:\\Users\\vagrant\\Desktop\\Cmder.lnk`" -WorkingDirectory `"C:\\tools\\Cmder`""
|
||||
|
||||
write-host "Creating '${env:USERPROFILE}/Desktop/Cmderdev.lnk'..."
|
||||
start-process -filePath "$env:userprofile/bin/set-shortcut.ps1" -ArgumentList "-sourceexe `"${env:USERPROFILE}\\cmderdev\\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\\Desktop\\Cmderdev.lnk`" -WorkingDirectory `"${env:USERPROFILE}\\cmderdev`""
|
||||
|
||||
# tabby
|
||||
setx cmder_root '%userprofile%/cmderdev'
|
||||
|
||||
# C:\Users\vagrant\AppData\Roaming\Hyper
|
||||
# // shell: '',
|
||||
# shell: 'cmd.exe',
|
||||
# // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
|
||||
# // by default `['--login']` will be used
|
||||
# // shellArgs: ['--login'],
|
||||
# shellArgs: ['/k', 'C:\\users\\vagrant\\cmderdev\\vendor\\init.bat'],
|
||||
|
||||
|
283
scripts/windows_terminal_settings.json.default
Normal file
283
scripts/windows_terminal_settings.json.default
Normal file
@ -0,0 +1,283 @@
|
||||
{
|
||||
"$help": "https://aka.ms/terminal-documentation",
|
||||
"$schema": "https://aka.ms/terminal-profiles-schema",
|
||||
"actions":
|
||||
[
|
||||
{
|
||||
"command":
|
||||
{
|
||||
"action": "copy",
|
||||
"singleLine": false
|
||||
},
|
||||
"keys": "ctrl+c"
|
||||
},
|
||||
{
|
||||
"command": "paste",
|
||||
"keys": "ctrl+v"
|
||||
},
|
||||
{
|
||||
"command": "find",
|
||||
"keys": "ctrl+shift+f"
|
||||
},
|
||||
{
|
||||
"command":
|
||||
{
|
||||
"action": "splitPane",
|
||||
"split": "auto",
|
||||
"splitMode": "duplicate"
|
||||
},
|
||||
"keys": "alt+shift+d"
|
||||
}
|
||||
],
|
||||
"copyFormatting": "none",
|
||||
"copyOnSelect": false,
|
||||
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"profiles":
|
||||
{
|
||||
"defaults": {},
|
||||
"list":
|
||||
[
|
||||
{
|
||||
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
|
||||
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"hidden": false,
|
||||
"name": "Windows PowerShell"
|
||||
},
|
||||
{
|
||||
"commandline": "%SystemRoot%\\System32\\cmd.exe",
|
||||
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
|
||||
"hidden": false,
|
||||
"name": "Command Prompt"
|
||||
},
|
||||
{
|
||||
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
|
||||
"hidden": false,
|
||||
"name": "Azure Cloud Shell",
|
||||
"source": "Windows.Terminal.Azure"
|
||||
},
|
||||
{
|
||||
"guid": "{3b26d644-1d3b-5a0c-ab09-39d4dd9ae00e}",
|
||||
"hidden": false,
|
||||
"name": "Developer Command Prompt for VS 2022",
|
||||
"source": "Windows.Terminal.VisualStudio"
|
||||
},
|
||||
{
|
||||
"guid": "{589cd367-e65f-5e6a-a1c7-2b8d6f250da8}",
|
||||
"hidden": false,
|
||||
"name": "Developer PowerShell for VS 2022",
|
||||
"source": "Windows.Terminal.VisualStudio"
|
||||
}
|
||||
]
|
||||
},
|
||||
"schemes":
|
||||
[
|
||||
{
|
||||
"background": "#0C0C0C",
|
||||
"black": "#0C0C0C",
|
||||
"blue": "#0037DA",
|
||||
"brightBlack": "#767676",
|
||||
"brightBlue": "#3B78FF",
|
||||
"brightCyan": "#61D6D6",
|
||||
"brightGreen": "#16C60C",
|
||||
"brightPurple": "#B4009E",
|
||||
"brightRed": "#E74856",
|
||||
"brightWhite": "#F2F2F2",
|
||||
"brightYellow": "#F9F1A5",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#3A96DD",
|
||||
"foreground": "#CCCCCC",
|
||||
"green": "#13A10E",
|
||||
"name": "Campbell",
|
||||
"purple": "#881798",
|
||||
"red": "#C50F1F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#CCCCCC",
|
||||
"yellow": "#C19C00"
|
||||
},
|
||||
{
|
||||
"background": "#012456",
|
||||
"black": "#0C0C0C",
|
||||
"blue": "#0037DA",
|
||||
"brightBlack": "#767676",
|
||||
"brightBlue": "#3B78FF",
|
||||
"brightCyan": "#61D6D6",
|
||||
"brightGreen": "#16C60C",
|
||||
"brightPurple": "#B4009E",
|
||||
"brightRed": "#E74856",
|
||||
"brightWhite": "#F2F2F2",
|
||||
"brightYellow": "#F9F1A5",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#3A96DD",
|
||||
"foreground": "#CCCCCC",
|
||||
"green": "#13A10E",
|
||||
"name": "Campbell Powershell",
|
||||
"purple": "#881798",
|
||||
"red": "#C50F1F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#CCCCCC",
|
||||
"yellow": "#C19C00"
|
||||
},
|
||||
{
|
||||
"background": "#282C34",
|
||||
"black": "#282C34",
|
||||
"blue": "#61AFEF",
|
||||
"brightBlack": "#5A6374",
|
||||
"brightBlue": "#61AFEF",
|
||||
"brightCyan": "#56B6C2",
|
||||
"brightGreen": "#98C379",
|
||||
"brightPurple": "#C678DD",
|
||||
"brightRed": "#E06C75",
|
||||
"brightWhite": "#DCDFE4",
|
||||
"brightYellow": "#E5C07B",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#56B6C2",
|
||||
"foreground": "#DCDFE4",
|
||||
"green": "#98C379",
|
||||
"name": "One Half Dark",
|
||||
"purple": "#C678DD",
|
||||
"red": "#E06C75",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#DCDFE4",
|
||||
"yellow": "#E5C07B"
|
||||
},
|
||||
{
|
||||
"background": "#FAFAFA",
|
||||
"black": "#383A42",
|
||||
"blue": "#0184BC",
|
||||
"brightBlack": "#4F525D",
|
||||
"brightBlue": "#61AFEF",
|
||||
"brightCyan": "#56B5C1",
|
||||
"brightGreen": "#98C379",
|
||||
"brightPurple": "#C577DD",
|
||||
"brightRed": "#DF6C75",
|
||||
"brightWhite": "#FFFFFF",
|
||||
"brightYellow": "#E4C07A",
|
||||
"cursorColor": "#4F525D",
|
||||
"cyan": "#0997B3",
|
||||
"foreground": "#383A42",
|
||||
"green": "#50A14F",
|
||||
"name": "One Half Light",
|
||||
"purple": "#A626A4",
|
||||
"red": "#E45649",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#FAFAFA",
|
||||
"yellow": "#C18301"
|
||||
},
|
||||
{
|
||||
"background": "#002B36",
|
||||
"black": "#002B36",
|
||||
"blue": "#268BD2",
|
||||
"brightBlack": "#073642",
|
||||
"brightBlue": "#839496",
|
||||
"brightCyan": "#93A1A1",
|
||||
"brightGreen": "#586E75",
|
||||
"brightPurple": "#6C71C4",
|
||||
"brightRed": "#CB4B16",
|
||||
"brightWhite": "#FDF6E3",
|
||||
"brightYellow": "#657B83",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#2AA198",
|
||||
"foreground": "#839496",
|
||||
"green": "#859900",
|
||||
"name": "Solarized Dark",
|
||||
"purple": "#D33682",
|
||||
"red": "#DC322F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#EEE8D5",
|
||||
"yellow": "#B58900"
|
||||
},
|
||||
{
|
||||
"background": "#FDF6E3",
|
||||
"black": "#002B36",
|
||||
"blue": "#268BD2",
|
||||
"brightBlack": "#073642",
|
||||
"brightBlue": "#839496",
|
||||
"brightCyan": "#93A1A1",
|
||||
"brightGreen": "#586E75",
|
||||
"brightPurple": "#6C71C4",
|
||||
"brightRed": "#CB4B16",
|
||||
"brightWhite": "#FDF6E3",
|
||||
"brightYellow": "#657B83",
|
||||
"cursorColor": "#002B36",
|
||||
"cyan": "#2AA198",
|
||||
"foreground": "#657B83",
|
||||
"green": "#859900",
|
||||
"name": "Solarized Light",
|
||||
"purple": "#D33682",
|
||||
"red": "#DC322F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#EEE8D5",
|
||||
"yellow": "#B58900"
|
||||
},
|
||||
{
|
||||
"background": "#000000",
|
||||
"black": "#000000",
|
||||
"blue": "#3465A4",
|
||||
"brightBlack": "#555753",
|
||||
"brightBlue": "#729FCF",
|
||||
"brightCyan": "#34E2E2",
|
||||
"brightGreen": "#8AE234",
|
||||
"brightPurple": "#AD7FA8",
|
||||
"brightRed": "#EF2929",
|
||||
"brightWhite": "#EEEEEC",
|
||||
"brightYellow": "#FCE94F",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#06989A",
|
||||
"foreground": "#D3D7CF",
|
||||
"green": "#4E9A06",
|
||||
"name": "Tango Dark",
|
||||
"purple": "#75507B",
|
||||
"red": "#CC0000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#D3D7CF",
|
||||
"yellow": "#C4A000"
|
||||
},
|
||||
{
|
||||
"background": "#FFFFFF",
|
||||
"black": "#000000",
|
||||
"blue": "#3465A4",
|
||||
"brightBlack": "#555753",
|
||||
"brightBlue": "#729FCF",
|
||||
"brightCyan": "#34E2E2",
|
||||
"brightGreen": "#8AE234",
|
||||
"brightPurple": "#AD7FA8",
|
||||
"brightRed": "#EF2929",
|
||||
"brightWhite": "#EEEEEC",
|
||||
"brightYellow": "#FCE94F",
|
||||
"cursorColor": "#000000",
|
||||
"cyan": "#06989A",
|
||||
"foreground": "#555753",
|
||||
"green": "#4E9A06",
|
||||
"name": "Tango Light",
|
||||
"purple": "#75507B",
|
||||
"red": "#CC0000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#D3D7CF",
|
||||
"yellow": "#C4A000"
|
||||
},
|
||||
{
|
||||
"background": "#000000",
|
||||
"black": "#000000",
|
||||
"blue": "#000080",
|
||||
"brightBlack": "#808080",
|
||||
"brightBlue": "#0000FF",
|
||||
"brightCyan": "#00FFFF",
|
||||
"brightGreen": "#00FF00",
|
||||
"brightPurple": "#FF00FF",
|
||||
"brightRed": "#FF0000",
|
||||
"brightWhite": "#FFFFFF",
|
||||
"brightYellow": "#FFFF00",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#008080",
|
||||
"foreground": "#C0C0C0",
|
||||
"green": "#008000",
|
||||
"name": "Vintage",
|
||||
"purple": "#800080",
|
||||
"red": "#800000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#C0C0C0",
|
||||
"yellow": "#808000"
|
||||
}
|
||||
],
|
||||
"themes": []
|
||||
}
|
9
scripts/windows_terminal_state.json.default
Normal file
9
scripts/windows_terminal_state.json.default
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"generatedProfiles" :
|
||||
[
|
||||
"{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
|
||||
"{589cd367-e65f-5e6a-a1c7-2b8d6f250da8}",
|
||||
"{3b26d644-1d3b-5a0c-ab09-39d4dd9ae00e}"
|
||||
],
|
||||
"settingsHash" : "6e0f2330b78337f3-01d95614596b3f65"
|
||||
}
|
39
vendor/bin/add-tovscode.ps1
vendored
Normal file
39
vendor/bin/add-tovscode.ps1
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# VSCode
|
||||
$VSCodeUserSettings = "$env:APPDATA/Code/User"
|
||||
$VSCodeSettings = "$VSCodeUserSettings/settings.json";
|
||||
$VSCodeSettingsNew = $VSCodeSettings.replace('.json', '-new.json')
|
||||
|
||||
if (test-path $VSCodeSettings) {
|
||||
$data = get-content -path $VSCodeSettings -ErrorAction silentlycontinue | out-string | ConvertFrom-Json
|
||||
}
|
||||
else {
|
||||
New-Item -ItemType directory $VSCodeUserSettings -force
|
||||
$data = @{}
|
||||
}
|
||||
|
||||
write-host $data
|
||||
|
||||
$data | Add-Member -force -Name 'terminal.integrated.defaultProfile.windows' -MemberType NoteProperty -Value "Cmder"
|
||||
|
||||
if ($null -eq $data.'terminal.integrated.profiles.windows') {
|
||||
write-host "Adding 'terminal.integrated.profiles.windows'..."
|
||||
$data | Add-Member -force -Name 'terminal.integrated.profiles.windows' -MemberType NoteProperty -Value @{}
|
||||
}
|
||||
|
||||
write-host "Adding 'terminal.integrated.profiles.windows.Cmder' profile..."
|
||||
$data.'terminal.integrated.profiles.windows'.'Cmder' = @{
|
||||
"name" = "Cmder";
|
||||
"path" = @(
|
||||
"`${env:windir}/Sysnative/cmd.exe";
|
||||
"`${env:windir}/System32/cmd.exe";
|
||||
);
|
||||
"args" = @(
|
||||
"/k";
|
||||
"`${env:USERPROFILE}/cmderdev/vendor/bin/vscode_init.cmd");
|
||||
"icon" = "terminal-cmd";
|
||||
"color" = "terminal.ansiGreen";
|
||||
};
|
||||
|
||||
$data | ConvertTo-Json -depth 100 | set-content $VSCodeSettings
|
||||
|
||||
|
70
vendor/bin/add-towindowsterminal.ps1
vendored
Normal file
70
vendor/bin/add-towindowsterminal.ps1
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
# Windows Terminal
|
||||
$windowsTerminalFolder = (dir "$env:userprofile/AppData/Local/Packages/Microsoft.WindowsTerminal_*").name
|
||||
$windowsTerminalPath = "$env:userprofile/AppData/Local/Packages/$windowsTerminalFolder"
|
||||
$windowsTerminalSettings = $windowsTerminalPath + '/localState/settings.json'
|
||||
$windowsTerminalSettingsNew = $windowsTerminalPath + '/localState/settings-new.json'
|
||||
|
||||
if (test-path "$env:userprofile/Documents/windows_terminal_settings.json.default") {
|
||||
if (test-path "$windowsTerminalPath/LocalState/settings.json") {
|
||||
del "$env:userprofile/Documents/windows_terminal_settings.json.default"
|
||||
} else {
|
||||
move-item -path $env:userprofile/Documents/windows_terminal_settings.json.default -destination $windowsTerminalPath/LocalState/settings.json
|
||||
}
|
||||
}
|
||||
|
||||
if (test-path "$env:userprofile/Documents/windows_terminal_state.json.default") {
|
||||
if (test-path "$windowsTerminalPath/LocalState/state.json") {
|
||||
del "$env:userprofile/Documents/windows_terminal_state.json.default"
|
||||
} else {
|
||||
move-item -path $env:userprofile/Documents/windows_terminal_state.json.default -destination $windowsTerminalPath/LocalState/state.json
|
||||
}
|
||||
}
|
||||
|
||||
$json = get-content $windowsTerminalSettings | ConvertFrom-Json
|
||||
|
||||
$json.defaultProfile="{00000000-0000-0000-ba54-000000000132}"
|
||||
|
||||
$cmderFound = $false
|
||||
$cmderAsAdminFound = $false
|
||||
|
||||
foreach ($profile in $json.profiles.list) {
|
||||
if ($profile.Name -eq "Cmder") {
|
||||
$cmderFound = $true
|
||||
}
|
||||
elseIf ($profile.Name -eq "Cmder as Admin") {
|
||||
$cmderAsAdminFound = $true
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $cmderFound) {
|
||||
write-host "Adding 'Cmder' to Windows Terminal..."
|
||||
|
||||
$json.profiles.list += @{
|
||||
commandline="cmd.exe /k `"%USERPROFILE%/cmderdev/vendor/init.bat`"";
|
||||
startingDirectory="%USERPROFILE%/cmderdev";
|
||||
icon="%USERPROFILE%/cmderdev/icons/cmder.ico";
|
||||
closeOnExit="graceful";
|
||||
guid="{00000000-0000-0000-ba54-000000000132}";
|
||||
hidden=$false;
|
||||
name="Cmder"
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $cmderAsAdminFound) {
|
||||
write-host "Adding 'Cmder as Admin' to Windows Terminal..."
|
||||
|
||||
$json.profiles.list += @{
|
||||
commandline="cmd.exe /k `"%USERPROFILE%/cmderdev/vendor/init.bat`"";
|
||||
startingDirectory="%USERPROFILE%/cmderdev";
|
||||
icon="%USERPROFILE%/cmderdev/icons/cmder_red.ico";
|
||||
closeOnExit="graceful";
|
||||
guid="{00000000-0000-0000-ba54-000000000133}";
|
||||
hidden=$false;
|
||||
elevate=$true;
|
||||
name="Cmder as Admin"
|
||||
}
|
||||
}
|
||||
|
||||
$json | ConvertTo-Json -depth 100 | set-content $windowsTerminalSettings
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user