From d90098c95d620e5de93fb866e15d701208e1288e Mon Sep 17 00:00:00 2001 From: Felix Teupke Date: Tue, 26 May 2020 13:56:51 +0200 Subject: [PATCH 1/2] fixed and improved Spotify Widgets fixed bug that caused Spotify widgets to not work properly. Also added the ability to hide Spotify Widgets automatically, when Spotify is closed. --- Win10 Widgets/Spotify/Spotify-Large.ini | 1 + Win10 Widgets/Spotify/Spotify-Small.ini | 44 ++++++++++++++++++------- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Win10 Widgets/Spotify/Spotify-Large.ini b/Win10 Widgets/Spotify/Spotify-Large.ini index b1c66d0..c96ae39 100644 --- a/Win10 Widgets/Spotify/Spotify-Large.ini +++ b/Win10 Widgets/Spotify/Spotify-Large.ini @@ -27,6 +27,7 @@ Version=1.0.0 @Include=Spotify-Small.ini BackgroundHeight=418 LeftPadding=10 +ShowIfSpotifyClosed=1 ; ------------------------------------------------------------------------ diff --git a/Win10 Widgets/Spotify/Spotify-Small.ini b/Win10 Widgets/Spotify/Spotify-Small.ini index 7af7a3d..b246fb2 100644 --- a/Win10 Widgets/Spotify/Spotify-Small.ini +++ b/Win10 Widgets/Spotify/Spotify-Small.ini @@ -1,6 +1,12 @@ [Rainmeter] Update=100 MouseActionCursor=0 +ContextTitle3=---- +ContextAction3=[] +ContextTitle4="Show when Spotify is closed" +ContextAction4=[!WriteKeyValue Variables ShowIfSpotifyClosed "1"][!Refresh] +ContextTitle5="Hide when Spotify is closed" +ContextAction5=[!WriteKeyValue Variables ShowIfSpotifyClosed "0"][!Refresh] [Metadata] Name=Spotify (small) @@ -23,6 +29,7 @@ HoverColor2=#SpotifyGreen# ClickColor=#ForegroundFaintColor# LeftPadding=60 AutoBorder=1 +ShowIfSpotifyClosed=1 ; ------------------------------------------------------------------------ @@ -35,24 +42,30 @@ Plugin=WebNowPlaying PlayerType=Cover DefaultPath=#@#Images\nocover.png CoverPath=#@#Images\cover.png -UpdateDivider = 5 +UpdateDivider = #UpdateRate# [MeasurePlayPause] Measure=Plugin Plugin=WebNowPlaying PlayerType=State -Substitute="0":"Play","1":"Pause","2":"Play","3":"Replay" +Substitute="0":"Closed","1":"Pause","2":"Play","3":"Replay" +UpdateDivider = #UpdateRate# -[MeasurePlaying] -; Returns playing status of currently playing Spotify track. +[MeasureState] Measure=Plugin Plugin=WebNowPlaying PlayerType=State -IfCondition=(MeasurePlaying=1) -IfTrueAction=[!SetVariable HovorColor #ForegroundColor#][!SetVariable HoverColor2 #SpotifyGreen#][!SetVariable ClickColor #ForegroundFaintColor#][!ShowMeterGroup Pause][!HideMeterGroup Play] -IfFalseAction=[!SetVariable HovorColor #SpotifyGreen#][!SetVariable HoverColor2 #ForegroundColor#][!SetVariable ClickColor #SpotifyGreen#][!HideMeterGroup Pause][!ShowMeterGroup Play] -OnChangeAction=[!UpdateMeter PlayPauseCircle] +IfCondition=MeasureState = 1 +IfTrueAction=[!Show][!SetVariable HovorColor #ForegroundColor#][!SetVariable HoverColor2 #SpotifyGreen#][!SetVariable ClickColor #ForegroundFaintColor#][!ShowMeterGroup Pause][!HideMeterGroup Play] +IfCondition2=MeasureState = 2 +IfTrueAction2=[!Show][!SetVariable HovorColor #SpotifyGreen#][!SetVariable HoverColor2 #ForegroundColor#][!SetVariable ClickColor #SpotifyGreen#][!HideMeterGroup Pause][!ShowMeterGroup Play] +IfCondition3=(MeasureState=0) +IfTrueAction3=[!HideMeterGroup Pause] +IfCondition4=(MeasureState=0) && (#ShowIfSpotifyClosed#=0) +IfTrueAction4=[!Hide] +IfConditionMode=1 +DynamicVariables=1 UpdateDivider=0.2 [MeasurePosition] @@ -85,7 +98,7 @@ UpdateDivider=#UpdateRate# Measure=Plugin Plugin=WebNowPlaying PlayerType=Title -UpdateDivider = 5 +UpdateDivider = #UpdateRate# Substitute="":"Track" [MeasureArtist] @@ -93,7 +106,7 @@ Substitute="":"Track" Measure=Plugin Plugin=WebNowPlaying PlayerType=Artist -UpdateDivider = 5 +UpdateDivider = #UpdateRate# Substitute="":"Artist" @@ -514,7 +527,7 @@ X=1r Y=1r W=1 H=2 -SolidColor=#ForegroundColor# +SolidColor=#ForegroundColor# [NextDiagonalTop] Meter=Image @@ -550,8 +563,9 @@ Y=2 W=50 H=[MeterDefaultCoverBackground:W] SolidColor=#SpotifyCoverBackground# -LeftMouseUpAction=["C:\Users\dninja21\AppData\Roaming\Spotify\Spotify.exe"] +LeftMouseUpAction=["%AppData%\Spotify\Spotify.exe"] MouseActionCursor=1 +UpdateDivider=#UpdateRate# [MeterDefaultCoverForeground] ; Shows the default cover foreground; i.e. a gray CD (for when a cover is not available or Spotify is closed). @@ -564,6 +578,7 @@ LineStart=18.8 LineLength=6 LineColor=#SpotifyCoverForeground# Solid=1 +UpdateDivider=#UpdateRate# [MeterCover] ; Shows cover image of currently playing Spotify track. @@ -575,6 +590,7 @@ W=[MeterDefaultCoverBackground:W] H=[MeterCover:W] DynamicVariables=1 AntiAlias=1 +UpdateDivider=#UpdateRate# ; ------------------------------------------------------------------------ @@ -592,6 +608,7 @@ H=4 SolidColor=#ForegroundFaintColor# BarColor=#BarColor# BarOrientation=Horizontal +UpdateDivider=#UpdateRate# ; ------------------------------------------------------------------------ @@ -607,6 +624,7 @@ MeasureName2=MeasureLength X=(#BackgroundWidth#-4) Y=([MeterBar:Y]-18) Text="%1 / %2" +UpdateDivider=#UpdateRate# [MeterTrack] ; Shows name of currently playing Spotify track. @@ -619,6 +637,7 @@ ClipString=2 ClipStringW=(#BackgroundWidth#-[MeterTrack:X]-9) Text="%1" FontFace=Segoe UI Semibold +UpdateDivider=#UpdateRate# [MeterArtist] ; Shows artist of currently playing Spotify track. @@ -631,3 +650,4 @@ ClipString=2 ClipStringW=(#BackgroundWidth#-[MeterArtist:X]-[MeterTime:W]-8) Text="%1" DynamicVariables=1 +UpdateDivider=#UpdateRate# \ No newline at end of file From 29359fb454a84f1ceda11be6da31e2c74286999c Mon Sep 17 00:00:00 2001 From: Felix Teupke Date: Tue, 26 May 2020 14:02:03 +0200 Subject: [PATCH 2/2] fixed little oversight fixed a little oversight where the play symbol would not be shown when Spotify was closed --- Win10 Widgets/Spotify/Spotify-Small.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Win10 Widgets/Spotify/Spotify-Small.ini b/Win10 Widgets/Spotify/Spotify-Small.ini index b246fb2..b81f7ed 100644 --- a/Win10 Widgets/Spotify/Spotify-Small.ini +++ b/Win10 Widgets/Spotify/Spotify-Small.ini @@ -61,7 +61,7 @@ IfTrueAction=[!Show][!SetVariable HovorColor #ForegroundColor#][!SetVariable Hov IfCondition2=MeasureState = 2 IfTrueAction2=[!Show][!SetVariable HovorColor #SpotifyGreen#][!SetVariable HoverColor2 #ForegroundColor#][!SetVariable ClickColor #SpotifyGreen#][!HideMeterGroup Pause][!ShowMeterGroup Play] IfCondition3=(MeasureState=0) -IfTrueAction3=[!HideMeterGroup Pause] +IfTrueAction3=[!HideMeterGroup Pause][!ShowMeterGroup Play] IfCondition4=(MeasureState=0) && (#ShowIfSpotifyClosed#=0) IfTrueAction4=[!Hide] IfConditionMode=1