https://www.deviantart.com/cybergen49/art/CyberSearch-for-Rainmeter-826087442
I currently have 5 search bars on my desktop. 2 searches two different places of a local intranet website, 2 opens the Everything app to search the network via explorer, and 1 is for google. I think it would be much cleaner to just have one search bar with a drop down menu on the left side which when clicked allows me choose between the 5 search bars while still retaining search history for each individual search option. Any clue on how I'd go about doing this? The first code is the main file for the skin and the second is for the google search bar settings.
Code: Select all
# This is the template that will be imported by all the parent search bar skins.
# Editing this template will effect all search bars equally.
[Variables]
backgroundLight=ffffff
background2Light=eeeeee
background3Light=dddddd
textC1Light=000000
textC2Light=aaaaaa
backgroundDark=222222
background2Dark=333333
background3Dark=444444
textC1Dark=ffffff
textC2Dark=777777
[SwitchColourMode]
Measure=String
String=#switchMode#.#mode#
IfMatch=1.Light
IfMatchAction=[!WriteKeyValue Variables mode "Dark"][!Refresh]
IfMatch2=1.Dark
IfMatchAction2=[!WriteKeyValue Variables mode "Light"][!Refresh]
DynamicVariables=1
[GetURL]
Measure=String
String=#engineURLQuery#
Substitute="{q}":"#query#"
DynamicVariables=1
[RunSearch]
Measure=Calc
Formula=0
IfCondition=#runSearch#=1
IfTrueAction=["[GetURL]"][!SetVariable runSearch 0][!SetVariable updateHistory 1][!Update]
DynamicVariables=1
[RecallSearch]
Measure=Calc
Formula=0
IfCondition=#recallSearch#=1
IfTrueAction=["https://www.google.com/search?q=#query#"][!SetVariable recallSearch 0][!Update]
DynamicVariables=1
[ShowHistory]
Measure=Calc
Formula=1
IfCondition=#showHistory#=1
IfTrueAction=[!ShowMeterGroup history][!Update]
IfFalseAction=[!HideMeterGroup history][!Update]
DynamicVariables=1
[UpdateHistory]
Measure=String
String=#updateHistory#
IfMatch=1
IfMatchAction=[!SetVariable history5 "#history4#"][!SetVariable history4 "#history3#"][!SetVariable history3 "#history2#"][!SetVariable history2 "#history1#"][!SetVariable history1 "#query#"][!SetVariable starterHistory 0][!SetVariable writeHistory 1][!SetVariable updateHistory 0][!Update]
DynamicVariables=1
[WriteHistory]
Measure=String
String=#writeHistory#
IfMatch=1
IfMatchAction=[!WriteKeyValue Variables history1 "#history1#"][!WriteKeyValue Variables history2 "#history2#"][!WriteKeyValue Variables history3 "#history3#"][!WriteKeyValue Variables history4 "#history4#"][!WriteKeyValue Variables history5 "#history5#"][!WriteKeyValue Variables starterHistory 0][!SetVariable writeHistory 0][!Update]
DynamicVariables=1
[CheckStarterHistory]
Measure=String
String=#starterHistory#
IfMatch=1
IfMatchAction=[!SetOption RecentSearchesHeading Text "Popular searches"][!Update]
[Background]
Meter=Shape
Group=history
Shape=Rectangle 0,0,370,215,20,20 | Fill Color [#background2[#mode]] | StrokeWidth 0
Hidden=1
DynamicVariables=1
[SearchBar]
Meter=Shape
Shape=Rectangle 0,0,370,40,20,20 | Fill Color [#background[#mode]] | StrokeWidth 0
DynamicVariables=1
[TextClickArea]
Meter=Shape
Shape=Rectangle [DefaultText:X],0,[DefaultText:W],[SearchBar:H] | Fill Color 00000001 | StrokeWidth 0
DynamicVariables=1
MouseActionCursorName=Text
LeftMouseUpAction=[!SetVariable showHistory 1][!CommandMeasure SearchInput "ExecuteBatch ALL"][!Update]
[EngineLogo]
Meter=Image
ImageName="#engineIcon#"
X=12
Y=8
W=24
H=24
SolidColor=00000001
TooltipText=Double click me to change the colour mode!#CRLF#(It could take a few seconds)
MouseActionCursor=0
LeftMouseDoubleClickAction=[!SetVariable switchMode 1][!Update]
[DefaultText]
Meter=String
#Text=#query#
Text=Type here to search #engineName#
X=45
Y=20
W=([SearchBar:W]-[DefaultText:X]-20)
FontFace=Segoe UI
FontSize=11
FontColor=[#textC2[#mode]]
StringAlign=LeftCenter
AntiAlias=1
ClipString=1
DynamicVariables=1
[SearchInput]
Measure=Plugin
Plugin=InputText
FocusDismiss=1
X=([DefaultText:X]-3)
Y=[DefaultText:Y]
W=[DefaultText:W]
H=25
SolidColor=[#background[#mode]]
FontFace=Segoe UI
FontSize=11
FontColor=[#textC1[#mode]]
StringAlign=LeftCenter
AntiAlias=1
ClipString=1
DynamicVariables=1
OnDismissAction=[!SetVariable showHistory 0][!Update]
Command1=[!SetVariable query "$UserInput$"][!SetVariable runSearch 1][!SetVariable showHistory 0][!Update]
[RecentSearchesHeading]
Meter=String
Group=history
Text=Recent searches
X=15
Y=50
W=([SearchBar:W]-[DefaultText:X]-20)
FontFace=Segoe UI
FontSize=10
FontColor=[#textC1[#mode]]
InlineSetting=Weight | 700
StringAlign=LeftTop
AntiAlias=1
ClipString=1
DynamicVariables=1
Hidden=1
[InstructionHeading]
Meter=String
Group=history
Text=Press Enter to search
X=355
Y=50
W=([SearchBar:W]-[DefaultText:X]-20)
FontFace=Segoe UI
FontSize=10
FontColor=[#textC2[#mode]]
InlineSetting=Weight | 700
StringAlign=RightTop
AntiAlias=1
ClipString=1
DynamicVariables=1
Hidden=1
[History1]
Meter=String
Group=history
Text=#history1#
X=15
Y=4R
W=320
Padding=10,4,10,4
SolidColor=00000001
FontFace=Segoe UI
FontSize=10
FontColor=[#textC1[#mode]]
StringAlign=LeftTop
AntiAlias=1
ClipString=1
DynamicVariables=1
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "[#background3[#mode]]"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "[#background2[#mode]]"][!Update]
LeftMouseUpAction=[!SetVariable query "#history1#"][!SetVariable recallSearch 1][!Update]
Hidden=1
[History2]
Meter=String
MeterStyle=History1
Text=#history2#
Y=0R
SolidColor=00000001
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "[#background3[#mode]]"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "[#background2[#mode]]"][!Update]
LeftMouseUpAction=[!SetVariable query "#history2#"][!SetVariable recallSearch 1][!Update]
[History3]
Meter=String
MeterStyle=History1
Text=#history3#
Y=0R
SolidColor=00000001
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "[#background3[#mode]]"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "[#background2[#mode]]"][!Update]
LeftMouseUpAction=[!SetVariable query "#history3#"][!SetVariable recallSearch 1][!Update]
[History4]
Meter=String
MeterStyle=History1
Text=#history4#
Y=0R
SolidColor=00000001
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "[#background3[#mode]]"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "[#background2[#mode]]"][!Update]
LeftMouseUpAction=[!SetVariable query "#history4#"][!SetVariable recallSearch 1][!Update]
[History5]
Meter=String
MeterStyle=History1
Text=#history5#
Y=0R
SolidColor=00000001
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "[#background3[#mode]]"][!Update]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "[#background2[#mode]]"][!Update]
LeftMouseUpAction=[!SetVariable query "#history5#"][!SetVariable recallSearch 1][!Update]1
Code: Select all
[Rainmeter]
Update=-1
AccurateText=1
RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Edit
ContextAction=["#CONFIGEDITOR#" "#CURRENTPATH##CURRENTFILE#"]
ContextTitle2=-
ContextAction2=[]
ContextTitle3=Reload skin
ContextAction3=[!Refresh]
ContextTitle4=Unload Skin
ContextAction4=[!DeactivateConfig]
ContextTitle5=-
ContextAction5=[]
ContextTitle6=Standard context menu
ContextAction6=[!SkinMenu]
[Metadata]
Name=Search Bar
Author=CyberOfficial
Information=A straightforward search bar with search history. Customizable to your website of choice.
Version=1.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0
[Variables]
# Search settings
engineName=Google
engineIcon=#@#google.png
# "{q}" (without quotes) will be replaced with the user's input.
engineURLQuery=https://www.google.com/search?q={q}
# History storage
history1=fdsgfd
history2=dd
history3=hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgggggggggggggggggg
history4=disney plus
history5=hurricane dorian
starterHistory=0
# Color mode: Type "Light" or "Dark" (without quotation marks) after mode=
mode=Dark
# Search bar template import
# Don't change anything after this line!
@include=#@#searchBarTemplate.ini