Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newline for clock #282

Open
Melechtna opened this issue Dec 24, 2024 · 24 comments · May be fixed by #285
Open

Newline for clock #282

Melechtna opened this issue Dec 24, 2024 · 24 comments · May be fixed by #285

Comments

@Melechtna
Copy link

I prefer the time above the date, so if we could put something like \n in the feild to do this, that would be much appreciated.

@mrsteve0924
Copy link

try this in your wf-shell.ini file

clock_format = %H:%M%n%e %a

@Melechtna
Copy link
Author

try this in your wf-shell.ini file

clock_format = %H:%M%n%e %a

This works, however, is there a way to better center everything?
The time isn't centered on the date.

@soreau
Copy link
Member

soreau commented Dec 25, 2024

Are you able to use spaces in the format or do they get stripped?

@Melechtna
Copy link
Author

Melechtna commented Dec 25, 2024

Are you able to use spaces in the format or do they get stripped?

As far as I can tell they get stripped

@soreau
Copy link
Member

soreau commented Dec 25, 2024

Well you might have better results with the command-output widget, if you don't need to click on it for the calendar.

@Melechtna
Copy link
Author

Well you might have better results with the command-output widget, if you don't need to click on it for the calendar.

Gonna be honest, I have no idea what I'm looking at with that, or its implications

@soreau
Copy link
Member

soreau commented Dec 25, 2024

I tested here, and it seems this works clock_format = %l:%M:%S %p%n %a %b %d.

@Melechtna
Copy link
Author

I tested here, and it seems this works clock_format = %l:%M:%S %p%n %a %b %d.

You're correct, however
screenshot-2024-12-24_22-37-49

@soreau
Copy link
Member

soreau commented Dec 25, 2024

Try this for command-output:

[panel]
command_output_datetime = date +'  %H:%M:%S%n %b/%m/%d'
command_output_period_datetime = 1
command_output_icon_datetime =
widgets_right = tray command-output

@Melechtna
Copy link
Author

command_output_datetime = date +' %H:%M:%S%n %b/%m/%d'
command_output_period_datetime = 1
command_output_icon_datetime =
widgets_right = tray command-output

That kind of worked, but opening the wcm instantly nukes that

@Melechtna
Copy link
Author

Fixed it by making sure WCM was closed before opening it agian, and it's correct looking now, but, the fonts super tiny

@soreau
Copy link
Member

soreau commented Dec 25, 2024

Check the wiki regarding style.

@soreau
Copy link
Member

soreau commented Dec 25, 2024

For example, you can write this in ~/.config/wf-shell/css/command-output.css:

.wf-panel .command-output {
  font-size: 20px;
}

@Melechtna
Copy link
Author

Melechtna commented Dec 25, 2024

Check the wiki regarding style.

I'm pretty sure I understand what to do there, but, after opening wcm to set a css directory, it ate the command_output again from wf-shell.ini

@soreau
Copy link
Member

soreau commented Dec 25, 2024

In general, you have to close wcm while saving the config file in an editor. The file isn't reloaded by wcm when it is modified externally.

@Melechtna
Copy link
Author

In general, you have to close wcm while saving the config file in an editor. The file isn't reloaded by wcm when it is modified externally.

Either I don't understand what you mean, or you're not understanding what I mean. I opened wcm to set a css directory, closed wcm, pulled up the panel, saw the clock was missing, opened wf-shell.ini in my text editor, and the command was eaten again.

@soreau
Copy link
Member

soreau commented Dec 25, 2024

Either I don't understand what you mean, or you're not understanding what I mean. I opened wcm to set a css directory, closed wcm, pulled up the panel, saw the clock was missing, opened wf-shell.ini in my text editor, and the command was eaten again.

Hm, maybe @NamorNiradnug has an idea about that, but that's a wcm/wf-config issue and not a wf-shell issue.

But if you write a file in ~/.config/wf-shell/css/*.css such as ~/.config/wf-shell/css/command-output.css, you can drop your css in there without needing to set css_path.

@Melechtna
Copy link
Author

Melechtna commented Dec 25, 2024

command_output_datetime = date +' %H:%M:%S%n %b/%m/%d'
command_output_period_datetime = 1
command_output_icon_datetime =

On another note, perhaps I'm misunderstanding, but why couldn't we just

.wf-panel .clock {
  text-align: center;  
}

@soreau
Copy link
Member

soreau commented Dec 25, 2024

If that works, I don't see a reason why not. 👍

@Melechtna
Copy link
Author

If that works, I don't see a reason why not. 👍

It doesn't, and I don't know why. I have it saved in ~/.config/wf-shell/css/clock.css. Even from reading the docs I'm not entirely sure how much normal css translates to this.

@Melechtna
Copy link
Author

I tried something silly, and set the clocks font-size to 40, just to see if anything actually changes, and nothing happens. There is clearly something I am doing wrong.

@soreau
Copy link
Member

soreau commented Dec 25, 2024

You can try this patch, because it seems there is no way to center widget text with css.

@NamorNiradnug
Copy link
Collaborator

You can try this patch, because it seems there is no way to center widget text with css.

The patch is already unavailable, but label.set_justify(Gtk::JUSTIFY_CENTER) does exactly what's desired. I'll open a PR.

@NamorNiradnug NamorNiradnug linked a pull request Jan 11, 2025 that will close this issue
@NamorNiradnug
Copy link
Collaborator

Either I don't understand what you mean, or you're not understanding what I mean. I opened wcm to set a css directory, closed wcm, pulled up the panel, saw the clock was missing, opened wf-shell.ini in my text editor, and the command was eaten again.

Hm, maybe @NamorNiradnug has an idea about that, but that's a wcm/wf-config issue and not a wf-shell issue.

But if you write a file in ~/.config/wf-shell/css/*.css such as ~/.config/wf-shell/css/command-output.css, you can drop your css in there without needing to set css_path.

This is definitely a problem with wf-config, I'll look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants