It is currently March 29th, 2024, 9:18 am

Anyone familiar with the Grayhound theme?

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Anyone familiar with the Grayhound theme?

Post by Yincognito »

AdrianJC wrote: November 22nd, 2020, 1:44 pm I have this little piece of script:

Code: Select all

[MotherboardGather]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\BIOS
RegValue=BaseBoardManufacturer

[TitleString]
Meter=String
X=0
Y=0
W=180
H=#BoxHeight#
FontFace=#Font#
FontSize=#FontHeight#
FontColor=#TitleColor#
SolidColor=#MouseBiteColor#
StringStyle=Bold
AntiAlias=#AntiA#
Text="BRAND"

[DataString]
Meter=String
MeasureName=MotherboardGather
X=80
Y=0
FontFace=#Font#
FontColor=#DataColor#
FontSize=#FontHeight#
AntiAlias=#AntiA#
Text="%1"
the outcome of script is:
BRAND ASUSTek COMPUTER INC.

I would like it to show only ASUS
Add this to [MotherboardGather]:

Code: Select all

RegExpSubstitute=1
Substitute="(?siU)Tek COMPUTER INC\.$":""
and get rid of [TitleString] entirely, if you don't use it or you want all its text removed. Of course, instead of removing the latter, you could do a:

Code: Select all

RegExpSubstitute=1
Substitute="^.*$":""
in [TitleString] and achieve the same thing, but unless yo want to follow some consistent formatting in your code where "title meters" exist even if they don't display anything, removing it entirely seems less redundant.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
AdrianJC
Posts: 41
Joined: April 14th, 2020, 9:48 am

Re: Anyone familiar with the Grayhound theme?

Post by AdrianJC »

Thnx Yincognito, that did the job.....
I'm totally lost in what is possible with all commands.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Anyone familiar with the Grayhound theme?

Post by Yincognito »

AdrianJC wrote: November 23rd, 2020, 2:56 pm Thnx Yincognito, that did the job.....
I'm totally lost in what is possible with all commands.
The manual should help though. As a principle, there are very few things that aren't possible (in general and with Rainmeter), so the real question would be HOW to make it possible, and not IF. Then, you just pick the related section from the manual (i.e. the measure, meter or plugin) and start from there in identifying how to achieve something.

Apart from that, in terms of string or text manipulation, regular expressions (i.e. RegExp or RegEx) is your friend, and using some online regex testers (or even Rainmeter's own RainRegExp) is a wise thing to do. As long as you use it in a measure (and not a meter, since meters are pretty limited to just displaying things), you can pretty much turn a string into whatever you like.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth