Skip to content

Commit

Permalink
v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EnhancedJax committed Jul 5, 2022
1 parent 853d63a commit 55071b7
Show file tree
Hide file tree
Showing 23 changed files with 96 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added @Resources/Icons/Tray/MixerDark/Volume0.ico
Binary file not shown.
Binary file added @Resources/Icons/Tray/MixerDark/Volume1.ico
Binary file not shown.
Binary file added @Resources/Icons/Tray/MixerDark/Volume2.ico
Binary file not shown.
Binary file added @Resources/Icons/Tray/MixerDark/Volume3.ico
Binary file not shown.
Binary file added @Resources/Icons/Tray/MixerDark/Volume4.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added @Resources/Icons/Tray/MixerLight/Volume0.ico
Binary file not shown.
Binary file added @Resources/Icons/Tray/MixerLight/Volume1.ico
Binary file not shown.
Binary file added @Resources/Icons/Tray/MixerLight/Volume2.ico
Binary file not shown.
Binary file added @Resources/Icons/Tray/MixerLight/Volume3.ico
Binary file not shown.
Binary file added @Resources/Icons/Tray/MixerLight/Volume4.ico
Binary file not shown.
Binary file added @Resources/Images/AppIcons/javaw.exe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified @Resources/Lua/Func.lua
Binary file not shown.
96 changes: 96 additions & 0 deletions @Resources/Powershell/toggleWidgetMode.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@

# ---------------------------------------------------------------------------- #
# Functions #
# ---------------------------------------------------------------------------- #

function Get-IniContent ($filePath) {
$ini = [ordered]@{}
if (![System.IO.File]::Exists($filePath)) {
throw "$filePath invalid"
}
# $section = ';ItIsNotAFuckingSection;'
# $ini.Add($section, [ordered]@{})

foreach ($line in [System.IO.File]::ReadLines($filePath)) {
if ($line -match "^\s*\[(.+?)\]\s*$") {
$section = $matches[1]
$secDup = 1
while ($ini.Keys -contains $section) {
$section = $section + '||ps' + $secDup
}
$ini.Add($section, [ordered]@{})
}
elseif ($line -match "^\s*;.*$") {
$notSectionCount = 0
while ($ini[$section].Keys -contains ';NotSection' + $notSectionCount) {
$notSectionCount++
}
$ini[$section][';NotSection' + $notSectionCount] = $matches[1]
}
elseif ($line -match "^\s*(.+?)\s*=\s*(.+?)$") {
$key, $value = $matches[1..2]
$ini[$section][$key] = $value
}
else {
$notSectionCount = 0
while ($ini[$section].Keys -contains ';NotSection' + $notSectionCount) {
$notSectionCount++
}
$ini[$section][';NotSection' + $notSectionCount] = $line
}
}

return $ini
}

function Set-IniContent($ini, $filePath) {
$str = @()

foreach ($section in $ini.GetEnumerator()) {
if ($section -ne ';ItIsNotAFuckingSection;') {
$str += "[" + ($section.Key -replace '\|\|ps\d+$', '') + "]"
}
foreach ($keyvaluepair in $section.Value.GetEnumerator()) {
if ($keyvaluepair.Key -match "^;NotSection\d+$") {
$str += $keyvaluepair.Value
}
else {
$str += $keyvaluepair.Key + "=" + $keyvaluepair.Value
}
}
}

$finalStr = $str -join [System.Environment]::NewLine

$finalStr | Out-File -filePath $filePath -Force -Encoding unicode
}

# ---------------------------------------------------------------------------- #
# Actions #
# ---------------------------------------------------------------------------- #


function Toggle-MixerMode {

$CurrentMode = $RmAPI.VariableStr('StayOnDesktop')
$SaveLocation = $RmAPI.VariableStr('Sec.SaveLocation')

$Ini = Get-IniContent -filePath "$($RmAPI.VariableStr('SETTINGSPATH'))Rainmeter.ini"
if ($CurrentMode -eq 1) {
# ---------------------------- Set to module mode ---------------------------- #
$Ini['YourMixer\Main\Elements\ControlScreen'].SavePosition = 0
$Ini['YourMixer\Main\Elements\ControlScreen'].AlphaValue = 1
$Ini['YourMixer\Main\Elements\ControlScreen'].Remove('WindowX')
$Ini['YourMixer\Main\Elements\ControlScreen'].Remove('WindowY')
Set-IniContent -ini $Ini -filePath "$($RmAPI.VariableStr('SETTINGSPATH'))Rainmeter.ini"
# ------------- Standard actions ------------- #
$RmAPI.Bang('[!SetVariable StayOnDesktop 0][!WriteKeyValue Variables StayOnDesktop "0" '+$SaveLocation+'][!UpdateMeasure Auto_Refresh:M][!UpdateMeter *][!Redraw]')
} else {
# ---------------------------- Set to widget mode ---------------------------- #
$Ini['YourMixer\Main\Elements\ControlScreen'].SavePosition = 1
$Ini['YourMixer\Main\Elements\ControlScreen'].AlphaValue = 255
Set-IniContent -ini $Ini -filePath "$($RmAPI.VariableStr('SETTINGSPATH'))Rainmeter.ini"
# ------------- Standard actions ------------- #
$RmAPI.Bang('[!SetVariable StayOnDesktop 1][!WriteKeyValue Variables StayOnDesktop "1" '+$SaveLocation+'][!UpdateMeasure Auto_Refresh:M][!UpdateMeter *][!Redraw]')
}
}
Binary file modified @Resources/Version.inc
Binary file not shown.
Binary file modified Core/General.inc
Binary file not shown.
Binary file modified Core/InteractionBox/MixerIconTheme.inc
Binary file not shown.
Binary file modified Core/PatchNote/Main1.inc
Binary file not shown.
Binary file modified Core/Window/Setup/2.inc
Binary file not shown.
File renamed without changes.
Binary file added Core/Window/Setup/RemoveDefaultIcon-Win11.inc
Binary file not shown.
Binary file modified Main/Elements/ControlScreen/Cache/MixerContent.inc
Binary file not shown.

0 comments on commit 55071b7

Please sign in to comment.