Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
keep WNP connection alive with dummy skin
Browse files Browse the repository at this point in the history
  • Loading branch information
reisir committed Feb 2, 2024
1 parent aa1e225 commit 30b2057
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 6 deletions.
17 changes: 17 additions & 0 deletions @Resources/ContextMenu.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Rainmeter]
RightMouseUpAction=[!SkinCustomMenu]
Group=Progress
ContextTitle=#CURRENTCONFIG#
ContextAction=["#CURRENTPATH#"]
ContextTitle2=-
ContextAction2=
ContextTitle3=Center horizontally
ContextAction3=[!SetWindowPosition "50%" "[#CURRENTCONFIGY]" "50%" "0%"]
ContextTitle4=Center vertically
ContextAction4=[!SetWindowPosition "([#CURRENTCONFIGX] + ([#CURRENTCONFIGWIDTH] / 2))" "50%" "50%" "50%"]
ContextTitle5=-
ContextAction5=
ContextTitle6=Open skin menu
ContextAction6=[!SkinMenu]
ContextTitle7=Unload Progress
ContextAction7=[!DeactivateConfigGroup "Progress"]
4 changes: 2 additions & 2 deletions @Resources/WebNowPlaying.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Plugin=WebNowPlaying
PlayerType=STATE
OnChangeAction=[!UpdateMeterGroup Controls][!Redraw]
IfCondition=[#CURRENTSECTION#:] = 0
IfTrueAction=[!Delay 30][!Hide]
IfTrueAction=[!Hide]
IfCondition2=[#CURRENTSECTION#:] = 1
IfTrueAction2=[!Show]
DynamicVariables=1
Expand Down Expand Up @@ -54,7 +54,7 @@ Measure=Plugin
Plugin=WebNowPlaying
PlayerType=TITLE
Substitute="":"N/A"
OnChangeAction=[!UpdateMeter MeterTitle][!Redraw]
OnChangeAction=[!Refresh]

[MeasureRemaining]
Measure=Plugin
Expand Down
55 changes: 55 additions & 0 deletions Context.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
$SkinName = "Progress"
$ROOTCONFIG = $SkinName
$editVariablesFile = "#@#settings.inc"
$useLanguage = $False
$out = "@Resources\ContextMenu.inc"

$spacer = @{
Title = '-'
Action = ''
}
$current = @{
Title = '#CURRENTCONFIG#'
Action = '["#CURRENTPATH#"]'
}
$skinmenu = @{
Title = if ($useLanguage) { '#__SkinMenu#' } else { 'Open skin menu' }
Action = '[!SkinMenu]'
}
$centerHorizontal = @{
Title = if ($useLanguage) { '#__CenterHorizontal#' } else { 'Center horizontally' }
Action = '[!SetWindowPosition "50%" "[#CURRENTCONFIGY]" "50%" "0%"]'
}
$centerVertical = @{
Title = if ($useLanguage) { '#__CenterVertical#' } else { 'Center vertically' }
Action = '[!SetWindowPosition "([#CURRENTCONFIGX] + ([#CURRENTCONFIGWIDTH] / 2))" "50%" "50%" "50%"]'
}
$unloadSelf = @{
Title = "Unload $SkinName"
Action = "[!DeactivateConfigGroup `"$SkinName`"]"
}

$menu = @(
$current, $spacer,
$centerHorizontal, $centerVertical, $spacer,
$skinmenu, $unloadSelf
)

function Write-Menu {
$output = "[Rainmeter]`nRightMouseUpAction=[!SkinCustomMenu]`nGroup=$SkinName`n"
$count = ""

$menu | % {
$output += @"
ContextTitle$($count)=$($_.Title)
ContextAction$($count)=$($_.Action)
"@
$count = 1 + $count
if ($count -eq 1) { $count++ }
}

$output | Out-File -FilePath $out
}

Write-Menu
11 changes: 11 additions & 0 deletions KeepConnectionAlive/wnp.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Rainmeter]
DefaultUpdateDivider=-1
Group=Progress

[MeasureVolume]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Status

[ummy]
Meter=Image
7 changes: 3 additions & 4 deletions Progress.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[Rainmeter]
Update=16
; SolidColor=255,0,0
; BackgroundMode=2
; MouseOverAction=[!SetVariable BorderColor #BorderOnHover#][!UpdateMeter Border][!Redraw]
; MouseLeaveAction=[!SetVariable BorderColor #BorderOnLeave#][!UpdateMeter Border][!Redraw]
Group=Progress
OnRefreshAction=[!ActivateConfig "Progress\KeepConnectionAlive"]
@IncludeContextMenu=#@#ContextMenu.inc

[Variables]
Details=0
Expand Down

0 comments on commit 30b2057

Please sign in to comment.