Changing the time on waybar #118
Replies: 2 comments
|
waybar configs are pulled from HyDE as per the in this case you would add a new waybar module using note main branch HyDE has a rework i'm porting to hydenix, i linked the current commit above im looking to add more module option parity in the future. and a demo-vm is being worked on to have more educational content as i feel its needed |
|
Thanks for your response. It took me some time to understand how it works. I find some of the naming with NixOS a bit confusing. For anyone else that runs into the issue, I decided to type it out. Changing the time on waybar to 24H formatIn your hydenix folder go into modules/hm and create a new folder called waybar and modules. In my case it looks like so: hm/waybar/modules main ✘!? ❯ pwd 09:46
/home/michael/hydenix/modules/hm/waybar/modulesIn case of waybar there are 2 relevant configuration files you need to change. By default we pull the configuration and settings of these things from HyDE. This is our starting template. We copy these configuration files to our hydenix folder for editing. cp ~/.config/waybar/config.ctl /home/michael/hydenix/modules/hm/waybar
cp ~./local/share/waybar/modules/clock.jsonc /home/michael/hydenix/modules/hm/waybar/modules/custom_clock.jsoncPlease note: I changed the name to custom_clock.jsonc. For some reason if I used clock.jsonc it would not accept it. In your editor change the time format: {
"clock": {
"format": "{:%H:%M}",
"rotate": 0,
"format-alt": "{:%R \udb80\udced %d\u00b7%m\u00b7%y}",
"tooltip-format": "<span>{calendar}</span>",
"calendar": {
"mode": "month",
"mode-mon-col": 3,
"on-scroll": 1,
"on-click-right": "mode",
"format": {
"months": "<span color='#ffead3'><b>{}</b></span>",
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
"today": "<span color='#ff6699'><b>{}</b></span>"
}
},
"actions": {
"on-click-right": "mode",
"on-click-forward": "tz_up",
"on-click-backward": "tz_down",
"on-scroll-up": "shift_up",
"on-scroll-down": "shift_down"
}
}
}Because cofig.ctl controls the layout of modules on waybar we need to change the references from clock to custom_clock like so: Just use a find and replace on clock to custom_clock. We now have our new configurations. We want to overwrite our current conifguration with our new files. We can use the home.file option for this. By default there a {lib, ... }:
{
imports = [
# ./example.nix - add your modules here
./software.nix
];
# home-manager options go here
home.packages = [
# pkgs.vscode - hydenix's vscode version
# pkgs.userPkgs.vscode - your personal nixpkgs version
];
home.file = {
".config/waybar/modules/custom_clock.jsonc" = {
source = ./waybar/modules/custom_clock.jsonc;
};
".config/waybar/config.ctl" = {
source = ./waybar/config.ctl;
};
};
# hydenix home-manager options go here
hydenix.hm = {
#! Important options
enable = true;
hyprland = {
enable = true;
extraConfig = ''
monitor=DP-1,3440x1440@144,1920x0,1
monitor=HDMI-A-2,1920x1080@60,0x0,1
'';
};
spotify = {
enable = false;
};
};
}For me this seemed to work! |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
Let me start off by saying I'm a beginner at NixOS. Wanting to pimp my look and feel of hyprland and NixOS a bit I decided to use this.
I originally had some issues with my monitors not being correctly recognized. After some googling I fixed it like so.
modules/hm/default.nix
After this I felt like I somewhat understood how it works. I set the challenge to change the default time of the clock on waybar to 24h. and I cannot get it to work.
Using the same file I tried
this works but results in a config file in ~/.config/warbar that is completely empty except this settting. My thought process was that I would use all the default settings in the configuration except the one I mention. Apparently this is not the case.
What would be the easiest way to accomplish this?
All reactions