How can I set a theme for all profiles in Windows Terminal? - windows-terminal

I have been experimenting with the new Windows Terminal and I would like to set some properties for all profiles (PowerShell, Cmd, Azure Cloud Shell).
Specifically, I want to theme each terminal profile with the same color scheme, padding, etc.
{
"colorScheme": "One Half Dark",
"fontFace": "Cascadia Code",
"padding": "20"
}
I had to add these lines to each profile. Is there a way to specify it only once for all profiles?

Maybe your profile is created by old version windows terminal. You can backup your profile(I lost my profile on last updating) and update it.
The new profile has changed to settings.json. The profiles in settings.json has defaults and list settings. What you need is in defaults.

Related

How to change the font color of SageMath terminal version 9.5?

I am rocking a Ubuntu 22.04 laptop, so I am stuck to SageMath v9.5, instead of the current version as of today. The font is currently blue, which is not the best match at all with the default purple terminal background. How could I change the color to, let's say, green?
I've tried something in this link, but the approach is so old, it doesn't apply to this version anymore. I can type %colors Linux at the Sage shell itself, but it resets whenever I log off.
You can change the font colour of the terminal by modifying the Sage Terminal profile in the terminal's preferences.
Open the terminal in SageMath.
Go to Edit > Profile Preferences.
In the Profile Preferences window, select the Colours tab.
4.Under Text colour, you can use the colour picker to select a new font colour for the terminal.
5.Click Close to apply the changes and close the window.
I've tried something in this link, but the approach is so old, it
doesn't apply to this version anymore. I can type %colors Linux at the
Sage shell itself, but it resets whenever I log off.
You have to save the command %colors Linux into init.sage file which will be save at location ~/.sage/init.sage you can flow the below steps to achieve this
Open the Terminal by pressing keys Ctrl+Alt+T or from all programs
Go to ~/.sage directory by using cd ~/.sage command
Enter touch init.sage to create a file by the name init.sage
Open the file with an editor like vim/nano etc
Now write the command %colors Linux and save the file and close it
New font color will not change after restarting sage

How to set the background color of the git bash terminal

I would like to set the background color of my whole terminal. google didn't help.
The idea is to have it set to red when working in a prod context and black when in dev context.
Ideally would like to do it using the .bash_profile file where I have code to switch environment context.
Console colors are stored in the registry under HKCU/Console/[window name]/ColorTable00-15.
[window name] is either "Git Bash" for the start menu entry or something like "C:_Program Files (x86)_Git_git-cheetah_.._bin_sh.exe" for the Windows Explorer context menu entry (supplied by Git-Cheetah).
Alternatively, the registry settings can be overridden by storing an NT_CONSOLE_PROPS structure with appropriate ColorTable settings in the "Git Bash.lnk" shortcut via IShellLinkDataList::AddDataBlock. This happens e.g. if you edit the properties of a console window started via shortcut, or if you edit the shortcut properties directly.
If you want the values from the registry instead, create a new "Git Bash.lnk" shortcut from scratch and leave the Options/Font/Layout/Colors tabs alone.
It seems the only way I can see so far is to manually edit the boxes from the properties window, but this is buggy and tedious - you can't use hex strings, and selecting the color to inspect it sometimes alters the color wildly.
enter image description here

programmatically open 'system properties'

How can I open the various windows in system properties from command line or using VBS or JS?
By this I mean windows such as User Profiles, environment variables, performance options, DEP, hardware profiles, windows update settings, remote desktop settings, etc I am using windows XP but it wont let me create a shortcut to these dialogs. Sysdm.cpl cant do it either it seems.
System properties is the window that opnes when you right click my computer and hit properties.
One way to open the edit environment variables of the windows through the command line would be to call the run.exe:
"C:\Windows\system32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables
So there must be something similar for other windows.
You can also open a specific tab of the system properties window by using the control command and the tab number:
control sysdm.cpl,,3

How to change Terminal background color when I open new tab?

I wanted to change color when I login to remote server by ssh.
The problem solved by this question.
How do I make the apple terminal window auto change colour scheme when I ssh to a specific server
But the solution above have a little problem.
Connet to remote server by ssh. (Background color is changed)
Open new terminal Tab.
This Tab's background is still changed.
So I want to "reset" background color when I open new Terminal Tab.
How can I do it?
By default, Terminal creates new tabs with the same settings as the current tab. You can change it to always use your default profile for new tabs in Preferences > Startup by changing New tabs open with: to Default Settings.
Note that there’s a built-in way to automatically set the background color for specific commands instead of using the script from that other answer:
You can set the name of a settings profile to a command name and Terminal will select that profile when you create a new terminal via either Shell > New Command… or Shell > New Remote Connection….
For example, duplicate your default profile, name it “ssh” and set its background color to red. Then use New Command… to run ssh host.example.com.
It also matches on arguments, so you can have it choose different settings for different remote hosts, for example. You could have one named “ssh host.example.com” with a blue background and another named “ssh” with a red background to handle any ssh commands that don’t match other profiles.

Windows 7: Set "Copy Settings" programmatically from a batch file

I'm constructing a batch file that will auto-configure Windows 7's regional settings for all users.
So far, I've successfully been able to set (mostly) all of the regional settings for the current user, but I need to be able to apply the same settings to all new users. You can do this via the GUI, by going into Region and Language > Administrative > Copy Settings and selecting both checkboxes. I would like to do this programmatically, though. Does anyone know of a registry key I can set or something that will do this?
Failing that, I'll settle for a way to programmatically open the Region and Language > Administrative > Copy Settings window. I've been able to successfully open the Region and Language > Administrative window with start rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,3, but I would like to eliminate one more step from the process, if possible.
Update
Sorry, I seem to have forgotten to mention how I'm applying these settings. I'm doing this by executing an exported .reg file, that contains the optimal settings, with regedit.exe /s "regional.reg"
How are you applying the settings now? Via the registry?
If you put the settings under HKEY_USERS\.DEFAULT instead of (or in addition to) HKEY_CURRENT_USER, they should be used during profile creation.

Resources