wf-shell icon indicating copy to clipboard operation
wf-shell copied to clipboard

Newline for clock

Open Melechtna opened this issue 1 year ago • 24 comments

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.

Melechtna avatar Dec 24 '24 10:12 Melechtna

try this in your wf-shell.ini file

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

mrsteve0924 avatar Dec 25 '24 02:12 mrsteve0924

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.

Melechtna avatar Dec 25 '24 03:12 Melechtna

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

soreau avatar Dec 25 '24 03:12 soreau

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

As far as I can tell they get stripped

Melechtna avatar Dec 25 '24 03:12 Melechtna

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

soreau avatar Dec 25 '24 03:12 soreau

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

Melechtna avatar Dec 25 '24 04:12 Melechtna

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

soreau avatar Dec 25 '24 04:12 soreau

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

Melechtna avatar Dec 25 '24 04:12 Melechtna

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

soreau avatar Dec 25 '24 04:12 soreau

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 avatar Dec 25 '24 04:12 Melechtna

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

Melechtna avatar Dec 25 '24 04:12 Melechtna

Check the wiki regarding style.

soreau avatar Dec 25 '24 04:12 soreau

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

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

soreau avatar Dec 25 '24 05:12 soreau

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

Melechtna avatar Dec 25 '24 05:12 Melechtna

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.

soreau avatar Dec 25 '24 05:12 soreau

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.

Melechtna avatar Dec 25 '24 05:12 Melechtna

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.

soreau avatar Dec 25 '24 05:12 soreau

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;  
}

Melechtna avatar Dec 25 '24 05:12 Melechtna

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

soreau avatar Dec 25 '24 05:12 soreau

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 avatar Dec 25 '24 05:12 Melechtna

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.

Melechtna avatar Dec 25 '24 05:12 Melechtna

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

soreau avatar Dec 25 '24 05:12 soreau

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 avatar Jan 11 '25 00:01 NamorNiradnug

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.

NamorNiradnug avatar Jan 11 '25 01:01 NamorNiradnug