It is currently November 4th, 2024, 7:03 am

Using Text= with [MeterUserName]

Get help with creating, editing & fixing problems with skins
User avatar
TildaNiobe
Posts: 6
Joined: September 29th, 2019, 5:33 pm

Using Text= with [MeterUserName]

Post by TildaNiobe »

Good morning,

I'm not great with this kind of thing, so maybe the answer is super easy:

I'm using the following string to display a machine's hostname to the user:

Code: Select all

[MeterUserName]
Meter=String
MeterStyle=styleLeftText
MeasureName=MeasureUserName
X=10
Y=10r
W=190
H=14
FontColor=255,255,255
With this string the result is as follows:

Image

I want to stick the label "hostname" in front of the text. So I created this string, which seems to match other values that have labels:

Code: Select all

[MeterUserName]
Meter=String
MeterStyle=styleLeftText
MeasureName=MeasureUserName
X=10
Y=10r
W=190
H=14
FontColor=255,255,255
Text=Hostname
The problem with this addtion is that it obfuscates the computer's hostname:

Image

What am I doing wrong here?

If needed, here is the "Measures" part of the script:

Code: Select all

[MeasureUserName]
Measure=Plugin
Plugin=SysInfo
SysInfoType=COMPUTER_NAME
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Using Text= with [MeterUserName]

Post by tass_co »

TildaNiobe wrote: September 4th, 2022, 1:58 pm I want to stick the label "hostname" in front of the text. So I created this string, which seems to match other values that have labels:
You haven't added the [MeasureUserName] data
ps: %1=MeasureUserName

Code: Select all

[MeterUserName]
Meter=String
MeterStyle=styleLeftText
MeasureName=MeasureUserName ;<=== %1
X=10
Y=10r
W=190
H=14
FontColor=255,255,255
Text=Hostname:%1
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
TildaNiobe
Posts: 6
Joined: September 29th, 2019, 5:33 pm

Re: Using Text= with [MeterUserName]

Post by TildaNiobe »

I ended up with the following MeterUserName block and it works now, thank you.

Code: Select all

[MeterUserName]
Meter=String
MeterStyle=styleLeftText
MeasureName=MeasureUserName
X=10
Y=10r
W=190
H=14
FontColor=255,255,255
Text=Hostname: %1
Image
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Using Text= with [MeterUserName]

Post by tass_co »

TildaNiobe wrote: September 4th, 2022, 3:28 pm I ended up with the following MeterUserName block and it works now, thank you.

Code: Select all

[MeterUserName]
Meter=String
MeterStyle=styleLeftText
MeasureName=MeasureUserName
X=10
Y=10r
W=190
H=14
FontColor=255,255,255
Text=Hostname: %1
Image
:thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16699
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using Text= with [MeterUserName]

Post by balala »

TildaNiobe wrote: September 4th, 2022, 3:28 pm I ended up with the following MeterUserName block and it works now, thank you.
Even if this does work, it's not a proper solution, because as can be seen in the posted screenshot, the information returned by the skin (for instance the up- and download speed) are positioned to right, far from the labels (Upload and Download). But your hostname is position right after the colon. This makes the whole skin to look weird (maybe just my opinion!?).
If you want to fix this, for sirst you should post the whole code of your skin. Would be much easier to make proper recommendations.
User avatar
TildaNiobe
Posts: 6
Joined: September 29th, 2019, 5:33 pm

Re: Using Text= with [MeterUserName]

Post by TildaNiobe »

I agree, the placement and font makes it look wonky. I was going to tackle that another time. It's Labor Day weekend, I have building projects to work on! Only came to the computer to get my hardware store order placed for pickup later this afternoon.

OK, off I go. Got all my electrical installed, time for testing.
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Using Text= with [MeterUserName]

Post by tass_co »

TildaNiobe wrote: September 4th, 2022, 8:38 pm I agree, the placement and font makes it look wonky. I was going to tackle that another time. It's Labor Day weekend, I have building projects to work on! Only came to the computer to get my hardware store order placed for pickup later this afternoon.

OK, off I go. Got all my electrical installed, time for testing.
I think the code below will fix the view

It will look like this
dfcoxfb-21c7745e-5d2f-4eb3-9c7d-94a28ff3579a.png

Code: Select all

[MeterUserName1]
Meter=String
MeterStyle=styleLeftText
X=10
Y=10r
W=190
H=14
Text=Hostname

[MeterUserName2]
Meter=String
MeterStyle=styleLeftText
MeasureName=MeasureUserName
X=138
Y=r
Text=%1
You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16699
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using Text= with [MeterUserName]

Post by balala »

tass_co wrote: September 4th, 2022, 9:45 pm I think the code below will fix the view
Sorry, but I believe it doesn't, because the user name rarely is the same (DEATHSTAR in this case). This is returned by the [MeasureUserName] measure, so it varies from computer to computer. That's why its length varies as well, so aligning it to left and placing it to certain position, is not doing properly the job.
Based on the posted screenshot and code snippets, I assume TildaNiobe works with illustro's Network skin. If I am right, the [MeterUserName1] and [MeterUserName2] meters should look this way:

Code: Select all

[MeterUserName1]
Meter=String
MeterStyle=styleLeftText
X=10
Y=10r
W=190
H=14
Text=Hostname

[MeterUserName2]
Meter=String
MeterStyle=styleRightText
MeasureName=MeasureUserName
X=200
Y=r
Text=%1
User avatar
tass_co
Posts: 523
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Using Text= with [MeterUserName]

Post by tass_co »

balala wrote: September 5th, 2022, 10:39 am Sorry, but I believe it doesn't, because the user name rarely is the same (DEATHSTAR in this case). This is returned by the [MeasureUserName] measure, so it varies from computer to computer. That's why its length varies as well, so aligning it to left and placing it to certain position, is not doing properly the job.
Based on the posted screenshot and code snippets, I assume TildaNiobe works with illustro's Network skin. If I am right, the [MeterUserName1] and [MeterUserName2] meters should look this way:
it's true if you say balala :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
TildaNiobe
Posts: 6
Joined: September 29th, 2019, 5:33 pm

Re: Using Text= with [MeterUserName]

Post by TildaNiobe »

Thank you, all I was able to get the look corrected.