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

Hyprland : Clock Module not showing at startup, needs Waybar restart #2863

Closed
Azercoco opened this issue Jan 24, 2024 · 10 comments
Closed

Hyprland : Clock Module not showing at startup, needs Waybar restart #2863

Azercoco opened this issue Jan 24, 2024 · 10 comments

Comments

@Azercoco
Copy link

I am using waybar on Hyprland (starting it with exec-once = waybar) and the clock module is not showing up. I need to manually kill and restart waybar for it to appear.

@zjeffer
Copy link
Contributor

zjeffer commented Jan 24, 2024

Any logs?

@Azercoco
Copy link
Author

Azercoco commented Jan 24, 2024

`[2024-01-24 20:56:07.663] [info] Using configuration file /home/Azercoco/.config/waybar/config.jsonc

[2024-01-24 20:56:07.664] [info] Unable to receive desktop appearance:
GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

[2024-01-24 20:56:07.664] [info] Using CSS file /home/Azercoco/.config/waybar/style.css

[2024-01-24 20:56:07.668] [warning] Mapping is not an object

[2024-01-24 20:56:07.668] [info] Hyprland IPC starting

[2024-01-24 20:56:07.676] [warning] module clock: Disabling module "clock", locale::facet::_S_create_c_locale name not valid

[2024-01-24 20:56:07.799] [warning] Requested height: 25 is less than the minimum height: 52 required by the modules

[2024-01-24 20:56:07.799] [info] Bar configured (width: 2540, height: 52) for output: HDMI-A-1`

[2024-01-24 20:56:07.676] [warning] module clock: Disabling module "clock", locale::facet::_S_create_c_locale name not valid seems to be the error

@zjeffer
Copy link
Contributor

zjeffer commented Jan 24, 2024

How did you install/compile Waybar?

Also take a look at this stackoverflow thread, might help you: https://stackoverflow.com/questions/20105167/c-error-failure-localefacet-s-create-c-locale-name-not-valid-when-runni
What's your output of locale?

I need to manually kill and restart waybar for it to appear.

This makes me think you might be setting some kind of configuration after executing waybar with exec-once.
What's your Hyprland config?

@Azercoco
Copy link
Author

Azercoco commented Jan 24, 2024

How did you install/compile Waybar?

I am on Arch so I probably just did pacman -S waybar

Also take a look at this stackoverflow thread, might help you: https://stackoverflow.com/questions/20105167/c-error-failure-localefacet-s-create-c-locale-name-not-valid-when-runni

What's your output of locale?

LANG=en_us.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

What's your Hyprland config?

Here it is but I am not seing anything which could cause the issue

#so nvidia will work
env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = WLR_NO_HARDWARE_CURSORS,1


# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto

# Execute apps at launch


# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf

# Set programs that you use
$terminal = konsole
$fileManager = dolphin
$menu = anyrun

# Some default env vars.
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that

layerrule = blur,waybar

exec-once = dunst
exec-once = /usr/lib/polkit-kde-authentication-agent-1
exec-once = firefox
exec-once = waybar > ~/waybarlog.txt

# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
    kb_layout = be
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =

    follow_mouse = 1

    touchpad {
        natural_scroll = no
    }

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}

general {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    gaps_in = 5
    gaps_out = 20
    border_size = 2
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(595959aa)

    layout = dwindle

    # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
    allow_tearing = false
}

decoration {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    rounding = 10
    
    blur {
        enabled = true
        size = 3
        passes = 1
    }

    drop_shadow = yes
    shadow_range = 4
    shadow_render_power = 3
    col.shadow = rgba(1a1a1aee)
}

animations {
    enabled = yes

    # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    bezier = myBezier, 0.05, 0.9, 0.1, 1.05

    animation = windows, 1, 7, myBezier
    animation = windowsOut, 1, 7, default, popin 80%
    animation = border, 1, 10, default
    animation = borderangle, 1, 8, default
    animation = fade, 1, 7, default
    animation = workspaces, 1, 6, default
}

dwindle {
    # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
    pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = yes # you probably want this
}

master {
    # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
    new_is_master = true
}

gestures {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more
    workspace_swipe = off
}

misc {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more
    force_default_wallpaper = -1 # Set to 0 to disable the anime mascot wallpapers
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic-mouse-v1 {
    sensitivity = -0.5
}

# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = nomaximizerequest, class:.* # You'll probably like this.


# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER

# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, M, exit, 
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating, 
bind = $mainMod, R, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle$

# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

# Switch workspaces with mainMod + [0-9]
bind = $mainMod, ampersand, workspace, 1
bind = $mainMod, eacute, workspace, 2
bind = $mainMod, quotedbl, workspace, 3
bind = $mainMod, apostrophe, workspace, 4
bind = $mainMod, parenleft, workspace, 5
bind = $mainMod, section, workspace, 6
bind = $mainMod, egrave, workspace, 7
bind = $mainMod, exclam, workspace, 8
bind = $mainMod, ccedilla, workspace, 9
bind = $mainMod, agrave, workspace, 10

# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, ampersand, movetoworkspace, 1
bind = $mainMod SHIFT, eacute, movetoworkspace, 2
bind = $mainMod SHIFT, quotedbl, movetoworkspace, 3
bind = $mainMod SHIFT, apostrophe, movetoworkspace, 4
bind = $mainMod SHIFT, parenleft, movetoworkspace, 5
bind = $mainMod SHIFT, section, movetoworkspace, 6
bind = $mainMod SHIFT, egrave, movetoworkspace, 7
bind = $mainMod SHIFT, exclam, movetoworkspace, 8
bind = $mainMod SHIFT, ccedilla, movetoworkspace, 9
bind = $mainMod SHIFT, agrave, movetoworkspace, 10

# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic

# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1

# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

xwayland {
  force_zero_scaling = true
}

# toolkit-specific scale
env = GDK_SCALE, 1.5
env = XCURSOR_SIZE, 24

@zjeffer
Copy link
Contributor

zjeffer commented Jan 24, 2024

Everything looks fine to me as well.

If it doesn't work the first time through Hyprland, but it does work if you manually start it afterwards, maybe something is wrong with how you launch it?

Does it make a difference if you execute waybar through a bash script instead of directly from your hyprland config?
For example, I have exec-once = bash ~/.config/hypr/apps/waybar/launch.sh in my hyprland config, and the script contains:

#!/bin/bash

WAYBAR_FOLDER="$HOME/.config/hypr/apps/waybar"
CONFIG_PATH="$WAYBAR_FOLDER/config.jsonc"
STYLE_PATH="$WAYBAR_FOLDER/style.css"
# space-separated string of files to watch
CONFIG_FILES="$CONFIG_PATH $STYLE_PATH"

while true; do
    waybar --config $CONFIG_PATH --style $STYLE_PATH >$WAYBAR_FOLDER/.waybar.err 2>&1 &
    inotifywait -e create,modify $CONFIG_FILES
    pkill -f media-player.py 2>/dev/null
    killall waybar 2>/dev/null
done

@Azercoco
Copy link
Author

No it does not fixes the issue, Waybar is still lanching but I still get in the waybar.err

[2024-01-26 00:18:05.430] [warning] module clock: Disabling module "clock", locale::facet::_S_create_c_locale name not valid

@Azercoco
Copy link
Author

I did regenerate my local and it seemed to fix the issue. Still have no idea of what did cause it to happen only at start. Thank for your help anyway.

@positroniumx
Copy link

positroniumx commented Jan 26, 2024

Have the same issue with clock not showing up anymore, after latest update.
[error] clock: chrono format error: no '%' at start of chrono-specs

config.jasonc

"clock": {
      "format": "{: %R   %d/%m}",
       "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
 },

Figured I post here instead of opening a new issue
edit: Forgot to mention that date +%R seems to correctly output the time in terminal

@zjeffer
Copy link
Contributor

zjeffer commented Jan 26, 2024

@positroniumx

You're seeing this issue: #2496 (comment)
Put the icons outside of the {} brackets and it should be fixed.

@positroniumx
Copy link

positroniumx commented Jan 26, 2024

yeah it works with " {:%R %d/%m}" but I can't insert the icon for date. should I define the date separately?
" {:%R}  {%d/%m}" fails with [error] clock: format error: invalid arg-id in format string
edit: yeah got it like this " {:%R  %d/%m}", icon shouldn't be at beginning in the brackets

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

No branches or pull requests

3 participants