waybar split in files
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/02/09 22:01:56 by tomoron #+# #+# #
|
||||
# Updated: 2026/06/15 12:35:56 by tomoron ### ########.fr #
|
||||
# Updated: 2026/06/16 23:07:00 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
|
||||
activate-linux
|
||||
brightnessctl
|
||||
playerctl
|
||||
vlc
|
||||
yubikey-manager
|
||||
bibata-cursors
|
||||
|
||||
@ -1,239 +0,0 @@
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.waybar.enable = true;
|
||||
/*
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background: transparent;
|
||||
color: white;
|
||||
border-top: 2px solid transparent;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: #c9545d;
|
||||
border-top: 2px solid #c9545d;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color : #88ff88;
|
||||
background-color : rgba(220,255, 220, 0.3)
|
||||
}
|
||||
*/
|
||||
programs.waybar.style = ''
|
||||
* {
|
||||
font-family: "Iosevka Nerd Font";
|
||||
font-size: 14px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.modules-right, #window {
|
||||
border: 1px solid #444444;
|
||||
background-color: #1e1e2e;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
|
||||
.modules-right .module {
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
background-color: rgba(127, 132, 156, 0.3);
|
||||
padding: 1px 6px;
|
||||
border-radius: 5px;
|
||||
color: #cdd6f4;
|
||||
|
||||
transition: background-color 200ms ease;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
border: 1px solid #444444;
|
||||
background-color: #1e1e2e;
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
background-color: transparent;
|
||||
padding: 0px 3px;
|
||||
margin: 0px 5px;
|
||||
min-height: 0px;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
background-color: rgba(127, 132, 156, 0.6);
|
||||
}
|
||||
|
||||
@keyframes red_blink {
|
||||
from { background-color: rgba(127, 132, 156, 0.6); }
|
||||
to { background-color: rgba(193,89,118, 0.5); }
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
animation: red_blink 500ms infinite alternate;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
window#waybar.empty #window {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#custom-separator {
|
||||
background-color: transparent;
|
||||
margin: 0px;
|
||||
padding: 0px
|
||||
}
|
||||
|
||||
#network, #clock {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
color: #f53c3c;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.module.warning {
|
||||
background-color: rgba(249, 226, 175, 0.4);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.module.high, .module.critical {
|
||||
background-color: rgba(193,89,118, 0.5);
|
||||
color: #ffffff;
|
||||
}
|
||||
'';
|
||||
|
||||
programs.waybar.settings.mainBar = {
|
||||
layer = "top";
|
||||
position ="top";
|
||||
height = 24;
|
||||
margin-left = 5;
|
||||
margin-right = 5;
|
||||
modules-left = ["hyprland/workspaces" "custom/music"];
|
||||
modules-center = ["hyprland/window"];
|
||||
modules-right = ["disk" "pulseaudio" "cpu" "te⚠ Disconnectedmperature" "memory" "battery" "network" "custom/separator" "clock"];
|
||||
|
||||
"hyprland/window" = {
|
||||
max-length = 50;
|
||||
};
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
disable-scroll = true;
|
||||
all-outputs = false;
|
||||
format = "{id}";
|
||||
};
|
||||
|
||||
clock = {
|
||||
interval = 1;
|
||||
format-alt = "{:%Y-%m-%d}";
|
||||
format = "{:%H:%M:%S}";
|
||||
};
|
||||
|
||||
cpu = {
|
||||
format = " {usage}%";
|
||||
format-low = "";
|
||||
states = {
|
||||
low = 0;
|
||||
working = 30;
|
||||
high = 80;
|
||||
};
|
||||
interval = 5;
|
||||
};
|
||||
|
||||
memory = {
|
||||
format = " {}%";
|
||||
format-low = "";
|
||||
interval = 5;
|
||||
states = {
|
||||
low = 0;
|
||||
show = 50;
|
||||
elevated = 80;
|
||||
critical = 95;
|
||||
};
|
||||
};
|
||||
|
||||
battery = {
|
||||
bat = "BAT0";
|
||||
full-at = 79;
|
||||
states = {
|
||||
good = 20;
|
||||
critical = 15;
|
||||
};
|
||||
format-time = " {H}:{m}";
|
||||
format-discharging = "{icon} {capacity}%{time}";
|
||||
format-charging = " {capacity}%{time}";
|
||||
format-plugged = "";
|
||||
format-icons = [" " " " " " " " " "];
|
||||
interval = 10;
|
||||
};
|
||||
|
||||
network = {
|
||||
format-wifi = "{icon} {essid}";
|
||||
format-ethernet = " {ifname}";
|
||||
format-disconnected = " ";
|
||||
format-icons = [" " " " " " " "];
|
||||
max-length = 20;
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
format = "{icon}{volume}%";
|
||||
format-bluetooth = " {icon} {volume}%";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
headphones = " ";
|
||||
handsfree = " ";
|
||||
headset = " ";
|
||||
phone = " ";
|
||||
portable = " ";
|
||||
car = " ";
|
||||
default = [" " " " " "];
|
||||
};
|
||||
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
states = {
|
||||
low = 79;
|
||||
warning = 99;
|
||||
high = 100000;
|
||||
};
|
||||
};
|
||||
|
||||
temperature = {
|
||||
thermal-zone = lib.mkDefault 0;
|
||||
critical-threshold = lib.mkDefault 85;
|
||||
warning-threshold = lib.mkDefault 60;
|
||||
interval = 5;
|
||||
format = "";
|
||||
format-warning ="{icon} {temperatureC}°C";
|
||||
format-critical ="{icon} {temperatureC}°C";
|
||||
format-icons = ["" "" "" "" ""];
|
||||
};
|
||||
|
||||
disk = {
|
||||
format-low ="";
|
||||
format = " {percentage_used}%";
|
||||
states.low = 0;
|
||||
states.warning = 70;
|
||||
states.high= 90;
|
||||
};
|
||||
|
||||
"custom/separator" = {
|
||||
format = "|";
|
||||
};
|
||||
|
||||
"custom/music" = {
|
||||
exec-if = "playerctl metadata 2>&1 >/dev/null";
|
||||
exec = "playerctl metadata --format ' {{ artist }} - {{title}}'";
|
||||
interval = 1;
|
||||
interval-if = 5;
|
||||
max-length = 50;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
19
homeConfigs/global/wayland/waybar/battery.nix
Normal file
19
homeConfigs/global/wayland/waybar/battery.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
battery = {
|
||||
bat = "BAT0";
|
||||
full-at = 79;
|
||||
states = {
|
||||
good = 20;
|
||||
critical = 15;
|
||||
};
|
||||
format-time = " {H}:{m}";
|
||||
format-discharging = "{icon} {capacity}%{time}";
|
||||
format-charging = " {capacity}%{time}";
|
||||
format-plugged = "";
|
||||
format-icons = [" " " " " " " " " "];
|
||||
interval = 10;
|
||||
};
|
||||
};
|
||||
}
|
||||
10
homeConfigs/global/wayland/waybar/clock.nix
Normal file
10
homeConfigs/global/wayland/waybar/clock.nix
Normal file
@ -0,0 +1,10 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
clock = {
|
||||
interval = 1;
|
||||
format-alt = "{:%Y-%m-%d}";
|
||||
format = "{:%H:%M:%S}";
|
||||
};
|
||||
};
|
||||
}
|
||||
15
homeConfigs/global/wayland/waybar/cpu.nix
Normal file
15
homeConfigs/global/wayland/waybar/cpu.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
cpu = {
|
||||
format = " {usage}%";
|
||||
format-low = "";
|
||||
states = {
|
||||
low = 0;
|
||||
working = 30;
|
||||
high = 80;
|
||||
};
|
||||
interval = 5;
|
||||
};
|
||||
};
|
||||
}
|
||||
12
homeConfigs/global/wayland/waybar/disk.nix
Normal file
12
homeConfigs/global/wayland/waybar/disk.nix
Normal file
@ -0,0 +1,12 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
disk = {
|
||||
format-low ="";
|
||||
format = " {percentage_used}%";
|
||||
states.low = 0;
|
||||
states.warning = 70;
|
||||
states.high= 90;
|
||||
};
|
||||
};
|
||||
}
|
||||
61
homeConfigs/global/wayland/waybar/global_style.nix
Normal file
61
homeConfigs/global/wayland/waybar/global_style.nix
Normal file
@ -0,0 +1,61 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.waybar.style = ''
|
||||
* {
|
||||
font-family: "Iosevka Nerd Font";
|
||||
font-size: 14px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.modules-right, #window {
|
||||
border: 1px solid #444444;
|
||||
background-color: #1e1e2e;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.modules-right .module {
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
background-color: rgba(127, 132, 156, 0.3);
|
||||
padding: 1px 6px;
|
||||
border-radius: 5px;
|
||||
color: #cdd6f4;
|
||||
|
||||
transition: background-color 200ms ease;
|
||||
}
|
||||
|
||||
@keyframes red_blink {
|
||||
from { background-color: rgba(127, 132, 156, 0.6); }
|
||||
to { background-color: rgba(193,89,118, 0.5); }
|
||||
}
|
||||
|
||||
#custom-separator {
|
||||
background-color: transparent;
|
||||
margin: 0px;
|
||||
padding: 0px
|
||||
}
|
||||
|
||||
#network, #clock {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
color: #f53c3c;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.module.warning {
|
||||
background-color: rgba(249, 226, 175, 0.4);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.module.high, .module.critical {
|
||||
background-color: rgba(193,89,118, 0.5);
|
||||
color: #ffffff;
|
||||
}
|
||||
'';
|
||||
}
|
||||
16
homeConfigs/global/wayland/waybar/memory.nix
Normal file
16
homeConfigs/global/wayland/waybar/memory.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
memory = {
|
||||
format = " {}%";
|
||||
format-low = "";
|
||||
interval = 5;
|
||||
states = {
|
||||
low = 0;
|
||||
show = 50;
|
||||
elevated = 80;
|
||||
critical = 95;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
12
homeConfigs/global/wayland/waybar/music.nix
Normal file
12
homeConfigs/global/wayland/waybar/music.nix
Normal file
@ -0,0 +1,12 @@
|
||||
{lib, pkgs, ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
"custom/music" = {
|
||||
exec-if = "${lib.getExe pkgs.playerctl} metadata 2>&1 >/dev/null";
|
||||
exec = "${lib.getExe pkgs.playerctl} metadata --format ' {{ artist }} - {{title}}'";
|
||||
interval = 1;
|
||||
interval-if = 5;
|
||||
max-length = 50;
|
||||
};
|
||||
};
|
||||
}
|
||||
12
homeConfigs/global/wayland/waybar/network.nix
Normal file
12
homeConfigs/global/wayland/waybar/network.nix
Normal file
@ -0,0 +1,12 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
network = {
|
||||
format-wifi = "{icon} {essid}";
|
||||
format-ethernet = " {ifname}";
|
||||
format-disconnected = " ";
|
||||
format-icons = [" " " " " " " "];
|
||||
max-length = 20;
|
||||
};
|
||||
};
|
||||
}
|
||||
25
homeConfigs/global/wayland/waybar/pulseaudio.nix
Normal file
25
homeConfigs/global/wayland/waybar/pulseaudio.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
pulseaudio = {
|
||||
format = "{icon}{volume}%";
|
||||
format-bluetooth = " {icon} {volume}%";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
headphones = " ";
|
||||
handsfree = " ";
|
||||
headset = " ";
|
||||
phone = " ";
|
||||
portable = " ";
|
||||
car = " ";
|
||||
default = [" " " " " "];
|
||||
};
|
||||
on-click = "${lib.getExe pkgs.pavucontrol}";
|
||||
states = {
|
||||
low = 79;
|
||||
warning = 99;
|
||||
high = 100000;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
15
homeConfigs/global/wayland/waybar/temperature.nix
Normal file
15
homeConfigs/global/wayland/waybar/temperature.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
programs.waybar.settings.mainBar = {
|
||||
temperature = {
|
||||
thermal-zone = lib.mkDefault 0;
|
||||
critical-threshold = lib.mkDefault 85;
|
||||
warning-threshold = lib.mkDefault 60;
|
||||
interval = 5;
|
||||
format = "";
|
||||
format-warning ="{icon} {temperatureC}°C";
|
||||
format-critical ="{icon} {temperatureC}°C";
|
||||
format-icons = ["" "" "" "" ""];
|
||||
};
|
||||
};
|
||||
}
|
||||
35
homeConfigs/global/wayland/waybar/waybar.nix
Normal file
35
homeConfigs/global/wayland/waybar/waybar.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.waybar.enable = true;
|
||||
programs.waybar.settings.mainBar = {
|
||||
layer = "top";
|
||||
position ="top";
|
||||
height = 24;
|
||||
margin-left = 5;
|
||||
margin-right = 5;
|
||||
modules-left = ["hyprland/workspaces" "custom/music"];
|
||||
modules-center = ["hyprland/window"];
|
||||
modules-right = [
|
||||
"disk"
|
||||
"pulseaudio"
|
||||
"cpu"
|
||||
"temperature"
|
||||
"memory"
|
||||
"battery"
|
||||
|
||||
"network"
|
||||
"custom/separator"
|
||||
"clock"
|
||||
];
|
||||
|
||||
"hyprland/window" = {
|
||||
max-length = 50;
|
||||
};
|
||||
|
||||
"custom/separator" = {
|
||||
format = "|";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
42
homeConfigs/global/wayland/waybar/workspaces.nix
Normal file
42
homeConfigs/global/wayland/waybar/workspaces.nix
Normal file
@ -0,0 +1,42 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.waybar.style = ''
|
||||
#workspaces {
|
||||
border: 1px solid #444444;
|
||||
background-color: #1e1e2e;
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
background-color: transparent;
|
||||
padding: 0px 3px;
|
||||
margin: 0px 5px;
|
||||
min-height: 0px;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
background-color: rgba(127, 132, 156, 0.6);
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
animation: red_blink 500ms infinite alternate;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
window#waybar.empty #window {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
'';
|
||||
programs.waybar.settings.mainBar = {
|
||||
"hyprland/workspaces" = {
|
||||
disable-scroll = true;
|
||||
all-outputs = false;
|
||||
format = "{id}";
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -6,11 +6,11 @@
|
||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/02/10 00:32:47 by tomoron #+# #+# #
|
||||
# Updated: 2025/02/10 01:17:29 by tomoron ### ########.fr #
|
||||
# Updated: 2026/06/16 23:09:20 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
{ lib, config, ... }:
|
||||
{pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.x11.enable {
|
||||
@ -67,9 +67,9 @@
|
||||
"alt + F7" = "brightnessctl s 10-";
|
||||
"alt + F8" = "brightnessctl s 10+";
|
||||
|
||||
"super + shift + o" = "playerctl play-pause";
|
||||
"super + shift + p" = "playerctl previous";
|
||||
"super + shift + n" = "playerctl next";
|
||||
"super + shift + o" = "${lib.getExe pkgs.playerctl} play-pause";
|
||||
"super + shift + p" = "${lib.getExe pkgs.playerctl} previous";
|
||||
"super + shift + n" = "${lib.getExe pkgs.playerctl} next";
|
||||
"super + shift + alt + b" = "polybar-msg cmd hide";
|
||||
"super + shift + b" = "polybar-msg cmd show";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user