Skip to content

Instantly share code, notes, and snippets.

@utilmind
Created July 16, 2021 20:12
Show Gist options
  • Save utilmind/ea93b036d0c3075756d539cba9159c67 to your computer and use it in GitHub Desktop.
Save utilmind/ea93b036d0c3075756d539cba9159c67 to your computer and use it in GitHub Desktop.
set-background-color
:: See also set-wallpaper.bat
@echo off
if [%1]==[] (
echo USAGE: set-background-color.bat [6 hexadecimal digit color value]
echo EXAMPLE: "set-background-color.bat ffffff". This will set background color to white.
exit
)
echo Set solid background color to 0x%1
:: Because the main color of our wallpaper is white. We need black color for the text on desktop icons...
powershell -command add-type -typedefinition """"using System;`n using System.Runtime.InteropServices;`n public class PInvoke { [DllImport(`"""user32.dll`""")] public static extern bool SetSysColors(int cElements, int[] lpaElements, int[] lpaRgbValues); }""""; [PInvoke]::SetSysColors(1, @(1), @(0x%1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment