Ask SWAY configuration questions here

This Topic is for asking about SWAY configuration and possibly theming questions.

The clock in Waybar always shows UTC time. Is there a way to have it show local time?

I have used timedatectl to choose my Time zone.

[don@RPi-5 ~]$ timedatectl
               Local time: Tue 2024-12-31 12:21:24 MST
           Universal time: Tue 2024-12-31 19:21:24 UTC
                 RTC time: Tue 2024-12-31 19:21:24
                Time zone: America/Denver (MST, -0700)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

and date shows the local time.

[don@RPi-5 ~]$ date
Tue Dec 31 12:24:15 PM MST 2024

I have not figured out how to make the Waybar clock show local time.

Pudge

1 Like

If you are on ARM, you may be stuck on 14.1.1 of GCC.

gcc --version

There is a bug with 14.1.1 that causes the issue you are describing with Waybar.

With the normal Arch repos, the issue was resolved when GCC was updated to 14.2.1.

Some folks in that thread mentioned downgrading tzdata worked around the issue (while still on GCC 14.1.1). In your case, until GCC 14.2.1 becomes available in the ARM repo perhaps that will be worth a shot.

1 Like

You are correct.

[don@RPi-5 ~]$ gcc --version
gcc (GCC) 14.1.1 20240507

So I went to my oldest ARM installation and checked /var/cache/pacman/pkg and found
tzdata-2024-a-2
tzdata-2024-b-1
tzdata-2024-b-2

tzdata-2024-a-2 worked
tzdata-2024-b-1 and tzdata-2024-b-2 did not work.

It annoys me probably more than it should, so I guess I will block updating tzdata in pacman.conf and live with that until Archliux ARM gets around to updating GCC.

Thank you for your assistance. It would have taken me a long time to figure that one out.

Pudge

1 Like

Problem with greeter login and default keyboard: I was locked out after too many failed attempts to login until I realised that it was using a US kybd and as mine is set to UK English, which works after login.
Is there any way to modify greeter so that it uses my normal UK keyboard? I can see nothing in the toml files or greetd.conf which relates to keyboard choice.

1 Like

That’s good to hear. It is this block that sets the keyboard layout in the Sway config, based on localectl status: https://github.com/EndeavourOS-Community-Editions/sway/blob/main/.config/sway/config.d/input#L15-L19

# Set keyboard layout and variant based on current system settings
exec_always {
    'swaymsg input type:keyboard xkb_layout "$(localectl status | grep "X11 Layout" | sed -e "s/^.*X11 Layout://")"'
    'swaymsg input type:keyboard xkb_variant "$(localectl status | grep "X11 Variant" | sed -e "s/^.*X11 Variant://")"'
}

You could try adding something similar to the Greetd sway config and see if it works. Edit this file:

/etc/greetd/sway.cfg

Add input commands after the ReGreet command (be sure to escape the internal double-quotes):

# Config for sway

exec "regreet"
exec "swaymsg input type:keyboard xkb_layout \"$(localectl status | grep 'X11 Layout' | sed -e 's/^.*X11 Layout://')\""
exec "swaymsg input type:keyboard xkb_variant \"$(localectl status | grep 'X11 Variant' | sed -e 's/^.*X11 Variant://')\""
exec "swaymsg exit"

Restart Greetd to apply the changes:

sudo systemctl restart greetd

Let me know if that works and I’ll add it to the default config.

1 Like

In ~/.config/waybar/config, there should be a section titled “clock” and you can set your local timezone in there.

Here is an example where the timezone is configured and it displays the date and time on waybar:

      "clock": {
          "timezone": "America/New_York",
          "format": "{:%A, %b %d, %Y - %I:%M:%OS %p}",
          "on-click": ""
      },

The upstream documentation is a bit confusing, but it is located here if you want to do more complex config of the clock.

1 Like

Good point, explicitly setting the time zone may be useful for working around the 14.1.1 GCC bug. Are you testing on an ARM device?

1 Like

I’m not using an ARM device & haven’t tested this with one. I had my tzdata package held at 2024a-2, as the newer ones messed the waybar time up & I had forgotten to try updating it until I read more in this thread.

I have gcc 14.2.1 and have now just updated the tzdata package to 2025a-1 and it’s not broken.

The OP issue is only on ARM then?

1 Like

Archlinux ARM is now up to 14.2.1
https://archlinuxarm.org/packages/aarch64/gcc
but I have not had time to test it yet. I will bump it up on my to-do list and see if it is fixed.

Pudge

1 Like

Well it was originally an issue on x86 as well, back in September of last year when GCC was on 14.1.1. GCC was quickly updated and the issue was resolved. But ARM sort of lingered for a while on 14.1.1 (the packages in the ARM repo are updated on a totally different cadence).

I have been working on getting ARM up to date with Mercury. In the testing process, I must have reformatted my Sway uSD card. So I had to start from scratch, this meaning I was using the Release Candidate image which is probably better anyway,

Anyway, it still has a problem.

[don@RPi-5 ~]$ pacman -Q tzdata gcc
tzdata 2025a-1
gcc 14.1.1+r1+g43b730b9134-1

As above, the Archlinux ARM web site says gcc 14.2.1 is the newest version. However, the update has not been completed yet and has not been distributed to their mirrors yet. Resulting in the panel time always being UTC.
tzdata 2025a-1 does not fix the problem either.

I will install tzdata-2024-a-2, reboot and be back shortly.

[don@RPi-5 ~]$ pacman -Q tzdata gcc
tzdata 2024a-2
gcc 14.1.1+r1+g43b730b9134-1

And the time displayed is UTC still.

As @jahway603 suggested, I looked in
~/.config/waybar/config and added the timezone statement in the “clock” module as the first statement.

    "clock": {
        "timezone": "America/Denver",
        "format": "󰅐 {:%H:%M}",
        "format-alt": "󰅐 {:%OI:%M %p}",
        "tooltip-format": " {:%A %m/%d}\n\n<tt><small>{calendar}</small></tt>",

Now it is showing the UTC time minus 7 hours, but one must click on the waybar clock to switch between 24 hour format and AM / PM format. Which I kind of like.

Whenever Sway is booted up, the 24 hour format is displayed by default, then click on wayclock to switch to AM / PM format.

I would prefer tohave the AM / PM format as default, and 24 Hour format by click.
I looked here, but did not come up with how to set AM / PM as default.

https://man.archlinux.org/man/extra/waybar/waybar-clock.5.en

Pudge

Have look here @Pudge

" %I:%M %p "

reverse format
for ref
" https://cplusplus.com/reference/ctime/strftime/

below post explain what i try say

1 Like

The one that shows when you click the module is the format-alt one.

You can just switch those around if you want to.

        "format": "󰅐 {:%OI:%M %p}",
        "format-alt": "󰅐 {:%H:%M}",
2 Likes

Switching the format & format-alt commands: AM / PM format was default, and 24 Hour format appeared when clicked.

Updated to tzdata-2025-a-1 and it no longer works.

Final solution for ARM

Downgrade to tzdata-2024-a-2 and edit the first three lines of the “clock” module in
~/.config/waybar/config to

    "clock": {
        "timezone": "America/Denver",
        "format": "󰅐 {:%OI:%M %p}",
        "format-alt": "󰅐 {:%H:%M}",

Pudge

1 Like

Having trouble with a gtk4 app using the dark theme being configured.

My ~/.config/gtk-3.0/settings.ini is:

[Settings]
gtk-theme-name=Arc-Dark
gtk-icon-theme-name=Qogir-dark
gtk-font-name=Noto Sans 10
gtk-cursor-theme-name=Qogir-dark
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0
gtk-menu-images=0
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintmedium
gtk-xft-rgba=rgb

I created a ~/.config/gtk-4.0/settings.ini with:

[Settings]
gtk-application-prefer-dark-theme = 1

gtk-theme-name=Arc-Dark
gtk-icon-theme-name=Qogir-dark
gtk-font-name=Noto Sans 10
gtk-cursor-theme-name=Qogir-dark
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0
gtk-menu-images=0
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintmedium
gtk-xft-rgba=rgb

I noticed sway on EOS is using ~/.config/sway/config.d/theme to process exec_always ~/.config/sway/scripts/import-gsettings. I tried adding another script which is identical except for gtk-4.0 and to exec in sway’s config, but no go.

When I run fastfetch, I do see

Theme: Arc-Dark [GTK2/3/4]

If I run GTK_THEME=Arc-Dark command-NAME at CLI, the dark theme works in the app.

What am I missing?

I found another thread on the Gnome forum which suggested running

gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

And now it appears to work. Let’s hope it stays after reboots.

1 Like

Glad you got it fixed.

Thank you for the feedback and the possible solution.
Let us know how it’s working after some reboots.

Pudge

I just ran into an issue with regreet after an update which touched wl-roots. I’ve been using these configs and have had to modify the greetd.conf file to include the ‘–unsupported-gpu’ option as my hardware requires the use of the mainline closed source nvidia driver package due to Nvidia Optimus / Prime. This option has worked up until two days ago after said update.

$ cat /etc/greetd/greetd.conf 
[terminal]
vt = 1
[default_session]
command = "sway --unsupported-gpu -c /etc/greetd/sway.cfg > /dev/null 2>&1"
user = "greeter"
$ cat /etc/greetd/config.toml 
[terminal]
// The VT to run the greeter on. Can be "next", "current" or a number
// designating the VT.
vt = 1
// The default session, also known as the greeter.
[default_session]
// 'agreety' is the bundled agetty/login-lookalike. You can replace '/bin/sh'
// with whatever you want started, such as 'sway'.
command = "agreety --cmd /bin/sh"
// The user to run the command as. The privileges this user must have depends
// on the greeter. A graphical greeter may for example require the user to be
// in the 'video' group.
user = "greeter"
$ cat /etc/greetd/sway.cfg 
// Config for sway
exec "regreet; swaymsg exit"
include /etc/sway/config.d/*
cat /etc/sway/config.d/50-systemd-user.conf 
// sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
// See FS#63021
// Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.
// Upstream refuses to set XDG_CURRENT_DESKTOP so we have to.
exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway
exec systemctl --user import-environment DISPLAY \
SWAYSOCK \
WAYLAND_DISPLAY \
                                    XDG_CURRENT_DESKTOP
exec hash dbus-update-activation-environment 2>/dev/null && \
     dbus-update-activation-environment --systemd DISPLAY \
SWAYSOCK \
XDG_CURRENT_DESKTOP=sway \
WAYLAND_DISPLAY

I’ll not be much help with Nvidia I’m afraid (I had to borrow a laptop from work to figure out how to add Nvidia support to the EOS Community Sway installation script). But what specifically is the issue you are getting with ReGreet?

If the greeter won’t start, try switching to a TTY to check for clues in the journal.

journalctl -b -u greetd.service
1 Like

Thanks for replying, and making my codeblocks actually codeblocks, this is what it seems like greeter is doing in the background until I swapped over to TTY2 and logged in and ran $ sway --unsupported-gpu from there.

journalctl -b -u greetd.service
Jun 05 07:51:23 eucleia systemd[1]: Started Greeter daemon.
Jun 05 07:51:23 eucleia greetd[867]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), switch: true }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", ser>
Jun 05 07:51:23 eucleia greetd[875]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: false }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", service: >
Jun 05 07:51:23 eucleia greetd[875]: pam_unix(greetd:session): session opened for user greeter(uid=963) by greeter(uid=0)
Jun 05 07:51:24 eucleia greetd[867]: error: check_children: greeter exited without creating a session
Jun 05 07:51:24 eucleia systemd[1]: greetd.service: Deactivated successfully.
Jun 05 07:51:25 eucleia systemd[1]: greetd.service: Scheduled restart job, restart counter is at 1.
Jun 05 07:51:25 eucleia systemd[1]: Started Greeter daemon.
Jun 05 07:51:25 eucleia greetd[960]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), switch: true }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", ser>
Jun 05 07:51:25 eucleia greetd[961]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: false }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", service: >
Jun 05 07:51:25 eucleia greetd[961]: pam_unix(greetd:session): session opened for user greeter(uid=963) by greeter(uid=0)
Jun 05 07:51:26 eucleia greetd[961]: pam_unix(greetd:session): session closed for user greeter
Jun 05 07:51:26 eucleia greetd[960]: error: check_children: greeter exited without creating a session
Jun 05 07:51:26 eucleia systemd[1]: greetd.service: Deactivated successfully.
Jun 05 07:51:27 eucleia systemd[1]: greetd.service: Scheduled restart job, restart counter is at 2.
Jun 05 07:51:27 eucleia systemd[1]: Started Greeter daemon.
Jun 05 07:51:27 eucleia greetd[995]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), switch: true }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", ser>
Jun 05 07:51:27 eucleia greetd[996]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: false }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", service: >
Jun 05 07:51:27 eucleia greetd[996]: pam_unix(greetd:session): session opened for user greeter(uid=963) by greeter(uid=0)
Jun 05 07:51:27 eucleia greetd[996]: pam_unix(greetd:session): session closed for user greeter
Jun 05 07:51:27 eucleia greetd[995]: error: check_children: greeter exited without creating a session
Jun 05 07:51:27 eucleia systemd[1]: greetd.service: Deactivated successfully.
Jun 05 07:51:29 eucleia systemd[1]: greetd.service: Scheduled restart job, restart counter is at 3.
Jun 05 07:51:29 eucleia systemd[1]: Started Greeter daemon.
Jun 05 07:51:29 eucleia greetd[1020]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), switch: true }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", se>
Jun 05 07:51:29 eucleia greetd[1021]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: false }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", service:>
Jun 05 07:51:29 eucleia greetd[1021]: pam_unix(greetd:session): session opened for user greeter(uid=963) by greeter(uid=0)
Jun 05 07:51:29 eucleia greetd[1021]: pam_unix(greetd:session): session closed for user greeter
Jun 05 07:51:29 eucleia greetd[1020]: error: check_children: greeter exited without creating a session
Jun 05 07:51:29 eucleia systemd[1]: greetd.service: Deactivated successfully.
Jun 05 07:51:30 eucleia systemd[1]: greetd.service: Scheduled restart job, restart counter is at 4.
Jun 05 07:51:30 eucleia systemd[1]: Started Greeter daemon.
Jun 05 07:51:30 eucleia greetd[1047]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: Specific(1), switch: true }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", se>
Jun 05 07:51:30 eucleia greetd[1048]: config: Config { file: ConfigFile { terminal: ConfigTerminal { vt: None, switch: false }, general: ConfigGeneral { source_profile: true, runfile: "/run/greetd.run", service:>
Jun 05 07:51:30 eucleia greetd[1048]: pam_unix(greetd:session): session opened for user greeter(uid=963) by greeter(uid=0)
Jun 05 07:51:31 eucleia greetd[1048]: pam_unix(greetd:session): session closed for user greeter
Jun 05 07:51:31 eucleia greetd[1047]: error: check_children: greeter exited without creating a session
Jun 05 07:51:31 eucleia systemd[1]: greetd.service: Deactivated successfully.
Jun 05 07:51:32 eucleia systemd[1]: greetd.service: Scheduled restart job, restart counter is at 5.
Jun 05 07:51:32 eucleia systemd[1]: greetd.service: Start request repeated too quickly.
Jun 05 07:51:32 eucleia systemd[1]: greetd.service: Failed with result 'start-limit-hit'.
Jun 05 07:51:32 eucleia systemd[1]: Failed to start Greeter daemon.