It is currently March 28th, 2024, 10:01 am

Possible to show folder contents as a menu?

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
Netherspark
Posts: 7
Joined: February 23rd, 2016, 1:41 pm

Possible to show folder contents as a menu?

Post by Netherspark »

What I'm hoping to be able to do is have a button on my desktop that when clicked displays the contents of a specific folder as a menu (rather than just open the folder itself). I know you can do something similar to this by creating a clickable menu and manually adding items to it via the config file, but I was hoping to have it just read a folder and display the contents dynamically.

Is this at all possible?

Failing that, would it be possible to have it open a specific submenu of the Windows start menu?
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Possible to show folder contents as a menu?

Post by balala »

Netherspark wrote:Is this at all possible?
Yep, it is. You have to use the FileView plugin for this. Here is a quick workaround:

Code: Select all

[Rainmeter]
Update=1000
MouseScrollUpAction=[!CommandMeasure mPath "IndexUp"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!CommandMeasure mPath "IndexDown"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,150

[Variables]
Path=C:
ShowHidden=0
ShowSystem=0
ShowContent=0

[TextStyle]
X=0r
Y=0R
FontColor=220,220,220
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
Padding=10,0,10,0
Group=Content

[mPath]
Measure=Plugin
Plugin=FileView
ShowDotDot=0
ShowHidden=#ShowHidden#
Showsystem=#ShowSystem#
Path=#Path#
Count=8

[mIndex1Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=1
Group=Children

[mIndex2Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=2
Group=Children

[mIndex3Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=3
Group=Children

[mIndex4Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=4
Group=Children

[mIndex5Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=5
Group=Children

[mIndex6Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=6
Group=Children

[mIndex7Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=7
Group=Children

[mIndex8Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=8
Group=Children

[MeasureContent]
Measure=Calc
Formula=#ShowContent#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeterGroup "Content"][!Redraw]
IfFalseAction=[!ShowMeterGroup "Content"][!Redraw]
DynamicVariables=1

[PathTitle]
Meter=String
X=0r
Y=0R
Padding=10,5,10,5
FontColor=220,220,220
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Path: #Path#
LeftMouseUpAction=[!SetVariable ShowContent "(1-#ShowContent#)"][!UpdateMeasure "MeasureContent"][!UpdateMeter "#CURRENTSECTION#"]
DynamicVariables=1

[MeterIndex1]
Meter=String
MeasureName=mIndex1Name
MeterStyle=TextStyle

[MeterIndex2]
Meter=String
MeasureName=mIndex2Name
MeterStyle=TextStyle

[MeterIndex3]
Meter=String
MeasureName=mIndex3Name
MeterStyle=TextStyle

[MeterIndex4]
Meter=String
MeasureName=mIndex4Name
MeterStyle=TextStyle

[MeterIndex5]
Meter=String
MeasureName=mIndex5Name
MeterStyle=TextStyle

[MeterIndex6]
Meter=String
MeasureName=mIndex6Name
MeterStyle=TextStyle

[MeterIndex7]
Meter=String
MeasureName=mIndex7Name
MeterStyle=TextStyle

[MeterIndex8]
Meter=String
MeasureName=mIndex8Name
MeterStyle=TextStyle
Take care the followings:
  • Add the path of the desired folder as the Path variable ([Variables] section).
  • The ShowHidden and ShowSystem variables can be either 1 (if you want to see -) or 0 (if you want to hide the appropriate files). Modify them accordingly to your needs (Don't do anything with the ShowContent variable, it is dynamically used by the skin).
  • The skin shows the first 8 elements of the folder, you can scroll to see the others as well.
If this code fits your needs, it can be modified to can open a folder (or even file) with a double click to the appropriate name. For now I didn't add this possibility, but it can be added.
Tony Ryan
Posts: 17
Joined: December 7th, 2016, 2:27 pm

Re: Possible to show folder contents as a menu?

Post by Tony Ryan »

Hi Balala
this code fits my needs could you add the code to open a file for me please
as you said it could be added.
thanks in advance
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Possible to show folder contents as a menu?

Post by balala »

Tony Ryan wrote:Hi Balala
this code fits my needs could you add the code to open a file for me please
as you said it could be added.
thanks in advance
Yes, it can be. Add the following options accordingly:

Code: Select all

[MeterIndex1]
...
LeftMouseDoubleClickAction=[!CommandMeasure "mIndex1Name" "FollowPath"][!UpdateMeasure "mPath"][!UpdateMeasureGroup "Children"][!UpdateMeter *][!Redraw]

[MeterIndex2]
...
LeftMouseDoubleClickAction=[!CommandMeasure "mIndex2Name" "FollowPath"][!UpdateMeasure "mPath"][!UpdateMeasureGroup "Children"][!UpdateMeter *][!Redraw]

[MeterIndex3]
...
LeftMouseDoubleClickAction=[!CommandMeasure "mIndex3Name" "FollowPath"][!UpdateMeasure "mPath"][!UpdateMeasureGroup "Children"][!UpdateMeter *][!Redraw]

[MeterIndex4]
...
LeftMouseDoubleClickAction=[!CommandMeasure "mIndex4Name" "FollowPath"][!UpdateMeasure "mPath"][!UpdateMeasureGroup "Children"][!UpdateMeter *][!Redraw]

[MeterIndex5]
...
LeftMouseDoubleClickAction=[!CommandMeasure "mIndex5Name" "FollowPath"][!UpdateMeasure "mPath"][!UpdateMeasureGroup "Children"][!UpdateMeter *][!Redraw]

[MeterIndex6]
...
LeftMouseDoubleClickAction=[!CommandMeasure "mIndex6Name" "FollowPath"][!UpdateMeasure "mPath"][!UpdateMeasureGroup "Children"][!UpdateMeter *][!Redraw]

[MeterIndex7]
...
LeftMouseDoubleClickAction=[!CommandMeasure "mIndex7Name" "FollowPath"][!UpdateMeasure "mPath"][!UpdateMeasureGroup "Children"][!UpdateMeter *][!Redraw]

[MeterIndex8]
...
LeftMouseDoubleClickAction=[!CommandMeasure "mIndex8Name" "FollowPath"][!UpdateMeasure "mPath"][!UpdateMeasureGroup "Children"][!UpdateMeter *][!Redraw]
Tony Ryan
Posts: 17
Joined: December 7th, 2016, 2:27 pm

Re: Possible to show folder contents as a menu?

Post by Tony Ryan »

Thanks Balala
works great
much obliged....
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Possible to show folder contents as a menu?

Post by balala »

Tony Ryan wrote:works great
I'm glad.
Post Reply