Closed pupbrained closed 10 months ago
welp, there's quite a lot of things wrong here lol, you probably didn't read through/understand the first 17 lines of guiding i provided :(
but it's fine, since you asked for help, help you shall receieve!
so you see, the whole working of a custom info snippet is based on the naming of the three [sections]
let's take our name
to be komorebi
. thus:
[mKomorebiDisp]
(follows the format of [mNameDisp]
) (the measure that provides the string value to be displayed next to the icon)[komorebiDisp]
(follows the format of [nameDisp]
) (the meter for the text displayed next to the icon) (should compulsorily be followed by the line: meterstyle=info|dispT
)[komorebi]
(follows the format of [name]
) (the meter for the icon next to the text) (should compulsorily be followed by the line: meterstyle=info|icon|dispI
)(note that these section names are case-insensitive, i just gave them different cases for better readibility)
sooo,
one of your mistakes was naming it [Command_1]
and not [mCustomDisp]
(because the name
is custom
in this case)
also, you removed the meterstyle
from [customDisp]
which resulted in it not being positioned correctly and you having to manually add the font attributes, anti-alias and the text field. (and also the separator not being shown)
the meterstyle IS what is supposed to automagically do all of that for you lol, that's why this specific naming sequence exists for this functionality
also, the snippets.inc is merely an .inc file, it can only ADD to what's already in the main bar.ini file, which already has a [rainmeter]
section, thus, you're kinda not achieving anything with that section lol
if you really wanna know how most of this works, you can refer to the rainmeter docs
from my observation, it probably would not be fun running the command as frequent as the skin updates we can make it update only every few seconds
anyways... the final code should be:
[variables]
komorebiIcon=EA6F
komorebiDisp=1
[mKomorebiDisp]
Measure=Plugin
Plugin=RunCommand
Parameter=Powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "[int]((komorebic query focused-workspace-index) | Out-String) + 1"
OutputType=ANSI
;update only every #updateRate# seconds
OnUpdateAction=[!CommandMeasure [#CurrentSection] Run]
updatedivider=-1
group=rate
[komorebiDisp]
meter=string
meterstyle=info|dispT
[komorebi]
meter=string
meterstyle=info|icon|dispI
i haven't gotten to setting up komorebi on my pc yet, so i can't personally test this, but do let me know if this helped! :3
never mind lol, i got it to work on my pc:
so THIS is because the text outputted from the measure has a newline in it. simplest fix is substituting it out of the output:
[mKomorebiDisp]
Measure=Plugin
Plugin=RunCommand
Parameter=Powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "[int]((komorebic query focused-workspace-index) | Out-String) + 1"
OutputType=ANSI
;update only every #updateRate# seconds
OnUpdateAction=[!CommandMeasure [#CurrentSection] Run]
updatedivider=-1
group=rate
regexpsubstitute=1
substitute="\n":""
which produces the desired result:
Thank you so much! Apologies for not reading the top comments in the template file, I think I honestly just glazed over it haha
This works perfectly :) (Originally asked a question but realized you answered it already, oops)
@modkavartini Sorry I'm a RM noob, I tried it years ago but reinstalled it now for this project in combo with komorebi like the OP. I was wondering if in the meantime there could be a way to manually trigger updates?
I've seen that we are apparently able to send bangs to RM from the cli: https://docs.rainmeter.net/manual/bangs/ But I don't understand most of it especially in the context of the "snippet.inc" case.
My thinking it to wrap the shortcut to change workspace to also call RM just after the komorebi command, would you have a suggestion for such a flow?
Thanks
Hi! I'm trying to write a custom widget/snippet for this skin so I can see what komorebi workspace I'm currently on at any given time. I currently have the following:
This current iteration has a few issues though, mainly that I have to manually set the Y value for the text to be aligned with the rest of the widgets on the bar, and the separator doesn't show:
How would I go about fixing these issues? Apologies if these are easy fixes, I'm new to rainmeter. Thanks!