Move out the waybar config
This commit is contained in:
parent
8c18115208
commit
1411269c58
2 changed files with 106 additions and 136 deletions
95
hmModules/waybar/config.json
Normal file
95
hmModules/waybar/config.json
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backlight": {
|
||||||
|
"device": "ddcci2",
|
||||||
|
"format": "{percent}% {icon}",
|
||||||
|
"format-icons": [" ", " "]
|
||||||
|
},
|
||||||
|
"battery": {
|
||||||
|
"format": "{capacity}% {icon}",
|
||||||
|
"format-alt": "{time} {icon}",
|
||||||
|
"format-charging": "{capacity}% ",
|
||||||
|
"format-icons": [" ", " ", " ", " ", " "],
|
||||||
|
"format-plugged": "{capacity}% ",
|
||||||
|
"states": {
|
||||||
|
"critical": 15,
|
||||||
|
"warning": 30
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"clock": {
|
||||||
|
"format-alt": "{:%Y-%m-%d}",
|
||||||
|
"tooltip-format": "{:%Y-%m-%d | %H:%M}"
|
||||||
|
},
|
||||||
|
"cpu": {
|
||||||
|
"format": "{usage}% ",
|
||||||
|
"tooltip": false
|
||||||
|
},
|
||||||
|
"height": 30,
|
||||||
|
"hyprland/workspaces": {
|
||||||
|
"all-outputs": true,
|
||||||
|
"disable-scroll-wraparound": true,
|
||||||
|
"on-click": "activate"
|
||||||
|
},
|
||||||
|
"ipc": true,
|
||||||
|
"layer": "top",
|
||||||
|
"memory": {
|
||||||
|
"format": "{}% "
|
||||||
|
},
|
||||||
|
"modules-center": ["hyprland/window", "niri/window"],
|
||||||
|
"modules-left": ["wlr/mode", "hyprland/workspaces", "niri/workspaces"],
|
||||||
|
"modules-right": [
|
||||||
|
"network",
|
||||||
|
"tray",
|
||||||
|
"pulseaudio",
|
||||||
|
"cpu",
|
||||||
|
"memory",
|
||||||
|
"temperature",
|
||||||
|
"backlight",
|
||||||
|
"battery",
|
||||||
|
"clock"
|
||||||
|
],
|
||||||
|
"network": {
|
||||||
|
"format-alt": "{ifname}: {ipaddr}/{cidr}",
|
||||||
|
"format-disconnected": "Disconnected ⚠",
|
||||||
|
"format-ethernet": "{ifname}: {ipaddr}/{cidr} up: {bandwidthUpBits:>4} down: {bandwidthDownBits:>4}",
|
||||||
|
"format-linked": "{ifname} (No IP) ",
|
||||||
|
"format-wifi": "{essid} ({signalStrength}%) {ipaddr}/{cidr} up: {bandwidthUpBits:>4} down: {bandwidthDownBits:>4}",
|
||||||
|
"interval": 1
|
||||||
|
},
|
||||||
|
"position": "top",
|
||||||
|
"pulseaudio": {
|
||||||
|
"format": "{volume}% {icon} {format_source}",
|
||||||
|
"format-bluetooth": "{volume}% {icon} {format_source}",
|
||||||
|
"format-bluetooth-muted": " {icon} {format_source}",
|
||||||
|
"format-icons": {
|
||||||
|
"car": "",
|
||||||
|
"default": [" ", " ", " "],
|
||||||
|
"handsfree": "",
|
||||||
|
"headphones": " ",
|
||||||
|
"headset": "",
|
||||||
|
"phone": "",
|
||||||
|
"portable": ""
|
||||||
|
},
|
||||||
|
"format-muted": " {format_source}",
|
||||||
|
"format-source": "{volume}% ",
|
||||||
|
"format-source-muted": "",
|
||||||
|
"on-click": "/nix/store/rya5a9r0ryh9x8yf03m3s420r4ay6ysg-pavucontrol-6.1/bin/pavucontrol"
|
||||||
|
},
|
||||||
|
"temperature": {
|
||||||
|
"critical-threshold": 80,
|
||||||
|
"format": "{temperatureC}°C {icon}",
|
||||||
|
"format-icons": ["", "", ""],
|
||||||
|
"hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input"
|
||||||
|
},
|
||||||
|
"tray": {
|
||||||
|
"spacing": 10
|
||||||
|
},
|
||||||
|
"wlr/mode": {
|
||||||
|
"format": "<span style=\"italic\">{}</span>",
|
||||||
|
"tooltip": false
|
||||||
|
},
|
||||||
|
"wlr/window": {
|
||||||
|
"max_length": 50
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
|
@ -7,144 +7,19 @@
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
style = builtins.readFile ./style.css;
|
|
||||||
settings = {
|
|
||||||
mainBar = {
|
|
||||||
ipc = true;
|
|
||||||
layer = "top";
|
|
||||||
position = "top";
|
|
||||||
height = 30;
|
|
||||||
|
|
||||||
modules-left = [
|
|
||||||
"wlr/mode"
|
|
||||||
"hyprland/workspaces"
|
|
||||||
"niri/workspaces"
|
|
||||||
];
|
|
||||||
modules-center = [
|
|
||||||
"hyprland/window"
|
|
||||||
"niri/window"
|
|
||||||
];
|
|
||||||
modules-right = [
|
|
||||||
"network"
|
|
||||||
"tray"
|
|
||||||
"pulseaudio"
|
|
||||||
"cpu"
|
|
||||||
"memory"
|
|
||||||
"temperature"
|
|
||||||
"backlight"
|
|
||||||
"battery"
|
|
||||||
"clock"
|
|
||||||
];
|
|
||||||
|
|
||||||
"hyprland/workspaces" = {
|
|
||||||
all-outputs = true;
|
|
||||||
disable-scroll-wraparound = true;
|
|
||||||
# format = "{icon}";
|
|
||||||
on-click = "activate";
|
|
||||||
# format-icons = {
|
|
||||||
# "1" = "";
|
|
||||||
# "2" = "";
|
|
||||||
# "3" = "";
|
|
||||||
# "9" = "ﬧ";
|
|
||||||
# urgent = "";
|
|
||||||
# };
|
|
||||||
# sort-by-number = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
"wlr/mode" = {
|
|
||||||
tooltip = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
"wlr/window" = {
|
|
||||||
max_length = 50;
|
|
||||||
};
|
|
||||||
tray = {
|
|
||||||
spacing = 10;
|
|
||||||
};
|
|
||||||
battery = {
|
|
||||||
format = "{capacity}% {icon}";
|
|
||||||
format-alt = "{time} {icon}";
|
|
||||||
format-charging = "{capacity}% ";
|
|
||||||
format-icons = [
|
|
||||||
" "
|
|
||||||
" "
|
|
||||||
" "
|
|
||||||
" "
|
|
||||||
" "
|
|
||||||
];
|
|
||||||
format-plugged = "{capacity}% ";
|
|
||||||
states = {
|
|
||||||
critical = 15;
|
|
||||||
warning = 30;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
clock = {
|
|
||||||
format-alt = "{:%Y-%m-%d}";
|
|
||||||
tooltip-format = "{:%Y-%m-%d | %H:%M}";
|
|
||||||
};
|
|
||||||
cpu = {
|
|
||||||
format = "{usage}% ";
|
|
||||||
tooltip = false;
|
|
||||||
};
|
|
||||||
memory = {
|
|
||||||
format = "{}% ";
|
|
||||||
};
|
|
||||||
network = {
|
|
||||||
interval = 1;
|
|
||||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
|
||||||
format-disconnected = "Disconnected ⚠";
|
|
||||||
format-ethernet = "{ifname}: {ipaddr}/{cidr} up: {bandwidthUpBits:>4} down: {bandwidthDownBits:>4}";
|
|
||||||
format-linked = "{ifname} (No IP) ";
|
|
||||||
format-wifi = "{essid} ({signalStrength}%) {ipaddr}/{cidr} up: {bandwidthUpBits:>4} down: {bandwidthDownBits:>4}";
|
|
||||||
};
|
|
||||||
pulseaudio = {
|
|
||||||
format = "{volume}% {icon} {format_source}";
|
|
||||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
|
||||||
format-bluetooth-muted = " {icon} {format_source}";
|
|
||||||
format-icons = {
|
|
||||||
car = "";
|
|
||||||
default = [
|
|
||||||
" "
|
|
||||||
" "
|
|
||||||
" "
|
|
||||||
];
|
|
||||||
handsfree = "";
|
|
||||||
headphones = " ";
|
|
||||||
headset = "";
|
|
||||||
phone = "";
|
|
||||||
portable = "";
|
|
||||||
};
|
|
||||||
format-muted = " {format_source}";
|
|
||||||
format-source = "{volume}% ";
|
|
||||||
format-source-muted = "";
|
|
||||||
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
|
|
||||||
};
|
|
||||||
"wlr/mode" = {
|
|
||||||
format = ''<span style="italic">{}</span>'';
|
|
||||||
};
|
|
||||||
temperature = {
|
|
||||||
critical-threshold = 80;
|
|
||||||
format = "{temperatureC}°C {icon}";
|
|
||||||
format-icons = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
];
|
|
||||||
hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input"; # picard FIXME
|
|
||||||
# hwmon-path = "/sys/class/thermal/thermal_zone4/temp"; # thinkpad
|
|
||||||
};
|
|
||||||
backlight = {
|
|
||||||
device = "ddcci2";
|
|
||||||
format = "{percent}% {icon}";
|
|
||||||
format-icons = [
|
|
||||||
" "
|
|
||||||
" "
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
catppuccin.waybar.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
home.activation.linkWaybarConfig = lib.hm.dag.entryAnywhere ''
|
||||||
|
if [ ! -d "$HOME/.config/waybar" ]; then
|
||||||
|
$DRY_RUN_CMD mkdir -p "$HOME/.config/waybar"
|
||||||
|
$DRY_RUN_CMD ln -s "$HOME/projects/aciceri/nixfleet/hmModules/waybar/config.json" "$HOME/.config/waybar/config"
|
||||||
|
$DRY_RUN_CMD ln -s "$HOME/projects/aciceri/nixfleet/hmModules/waybar/style.css" "$HOME/.config/waybar/style.css"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
# waybar needs the hyprctl binary in PATH when started in hyprland
|
# waybar needs the hyprctl binary in PATH when started in hyprland
|
||||||
|
# TODO still needed?
|
||||||
systemd.user.services.waybar.Service.Environment = "PATH=${lib.makeBinPath [ pkgs.hyprland ]}";
|
systemd.user.services.waybar.Service.Environment = "PATH=${lib.makeBinPath [ pkgs.hyprland ]}";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue