Skip to content

Instantly share code, notes, and snippets.

View Mufaddal1125's full-sized avatar
๐Ÿ“š
Learning

Mufaddal Patanwala Mufaddal1125

๐Ÿ“š
Learning
  • Cleverflow
  • Mumbai, India.
View GitHub Profile
@Mufaddal1125
Mufaddal1125 / switch_to_dark_at_specified_time
Last active January 25, 2022 05:54
Switch themes at specified time for windows
$time = Get-Date
$hourToSwitch = 18
$tillHour = 6
$shouldSwitchSystemTheme = 1
# function to get list of hours between hourtoswitch and tillhour
function GetDarkHours()
{
$hours = New-Object System.Collections.Generic.List[int]
@Mufaddal1125
Mufaddal1125 / switch_app_theme.ps1
Created January 23, 2022 17:02
Switch app theme in windows
$mode = Get-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme
if ($mode.AppsUseLightTheme -eq 1) {
Write-Output "Mode is 1, changing to 0"
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0
}
elseif ($mode.AppsUseLightTheme -eq 0) {
Write-Output "Mode is 0, changing to 1"
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 1
@Mufaddal1125
Mufaddal1125 / Set-PsEnv.psm1
Created December 29, 2021 06:11 — forked from grenzi/Set-PsEnv.psm1
sets powershell environment variables from python-dotenv formatted .env file
<#
.Synopsis
Exports environment variable from the .env file to the current process.
.Description
This function looks for .env file in the current directoty, if present
it loads the environment variable mentioned in the file to the current process.
based on https://github.com/rajivharris/Set-PsEnv