Move waybar modules into importable nix expressions
This commit is contained in:
parent
7a3534ee1b
commit
733d86c759
|
@ -1,6 +1,4 @@
|
|||
{...}: let
|
||||
modules = import ./modules.nix;
|
||||
in {
|
||||
{...}: {
|
||||
imports = [./default.nix];
|
||||
programs.waybar.settings.laptop = {
|
||||
layer = "top";
|
||||
|
@ -27,16 +25,16 @@ in {
|
|||
"battery#compact"
|
||||
"tray"
|
||||
];
|
||||
"clock#compact" = modules."clock#compact";
|
||||
cpu = modules.cpu;
|
||||
memory = modules.memory;
|
||||
temperature = modules.temperature;
|
||||
"wlr/workspaces" = modules."wlr/workspaces";
|
||||
"pulseaudio#compact" = modules."pulseaudio#compact";
|
||||
"bluetooth#compact" = modules."bluetooth#compact";
|
||||
"network#compact" = modules."network#compact";
|
||||
backlight = modules.backlight;
|
||||
"battery#compact" = modules."battery#compact";
|
||||
tray = modules.tray;
|
||||
"clock#compact" = import ./modules/clock.compact.nix;
|
||||
cpu = import ./modules/cpu.nix;
|
||||
memory = import ./modules/memory.nix;
|
||||
temperature = import ./modules/temperature.nix;
|
||||
"wlr/workspaces" = import ./modules/wlr_workspaces.nix;
|
||||
"pulseaudio#compact" = import ./modules/pulseaudio.compact.nix;
|
||||
"bluetooth#compact" = import ./modules/bluetooth.compact.nix;
|
||||
"network#compact" = import ./modules/network.compact.nix;
|
||||
backlight = import ./modules/backlight.nix;
|
||||
"battery#compact" = import ./modules/battery.compact.nix;
|
||||
tray = import ./modules/tray.nix;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
{...}: let
|
||||
modules = import ./modules.nix;
|
||||
in {
|
||||
{...}: {
|
||||
imports = [./default.nix];
|
||||
programs.waybar.settings.main = {
|
||||
layer = "top";
|
||||
|
@ -26,16 +24,16 @@ in {
|
|||
"battery"
|
||||
"tray"
|
||||
];
|
||||
clock = modules.clock;
|
||||
cpu = modules.cpu;
|
||||
memory = modules.memory;
|
||||
temperature = modules.temperature;
|
||||
"wlr/workspaces" = modules."wlr/workspaces";
|
||||
pulseaudio = modules.pulseaudio;
|
||||
bluetooth = modules.bluetooth;
|
||||
network = modules.network;
|
||||
backlight = modules.backlight;
|
||||
battery = modules.battery;
|
||||
tray = modules.tray;
|
||||
clock = import ./modules/clock.nix;
|
||||
cpu = import ./modules/cpu.nix;
|
||||
memory = import ./modules/memory.nix;
|
||||
temperature = import ./modules/temperature.nix;
|
||||
"wlr/workspaces" = import ./modules/wlr_workspaces.nix;
|
||||
pulseaudio = import ./modules/pulseaudio.nix;
|
||||
bluetooth = import ./modules/bluetooth.nix;
|
||||
network = import ./modules/network.nix;
|
||||
backlight = import ./modules/backlight.nix;
|
||||
battery = import ./modules/battery.nix;
|
||||
tray = import ./modules/tray.nix;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,232 +0,0 @@
|
|||
{
|
||||
keyboard-state = {
|
||||
numlock = true;
|
||||
capslock = true;
|
||||
format = "{name} {icon}";
|
||||
format-icons = {
|
||||
locked = "";
|
||||
unlocked = "";
|
||||
};
|
||||
};
|
||||
tray.spacing = 10;
|
||||
clock = {
|
||||
format = "{:%A %Y-%m-%d | %R }";
|
||||
tooltip-format = "<tt>{calendar}</tt>";
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
||||
today = "<span color='#ff6699'><b><u>{}</u></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";
|
||||
};
|
||||
};
|
||||
"clock#compact" = {
|
||||
format = "{:%R }";
|
||||
format-alt = "{:%A %Y-%m-%d }";
|
||||
tooltip-format = "<tt>{calendar}</tt>";
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
||||
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||
};
|
||||
};
|
||||
};
|
||||
cpu = {
|
||||
format = "{usage}% ";
|
||||
tooltip = false;
|
||||
};
|
||||
memory.format = "{}% ";
|
||||
temperature = {
|
||||
critical-threshold = 80;
|
||||
format = "{temperatureC}°C {icon}";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
backlight = {
|
||||
format = "{icon}";
|
||||
tooltip-format = "{percent}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{time} {capacity}% {icon}";
|
||||
format-charging = "{time} {capacity}% ";
|
||||
format-plugged = "{capacity}% ";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"battery#compact" = {
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon}";
|
||||
format-charging = "";
|
||||
format-plugged = "";
|
||||
tooltip-format = "{time} {capacity}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
network = {
|
||||
format-wifi = "{essid} ({signalStrength}%) ";
|
||||
format-ethernet = "Connected ";
|
||||
tooltip-format = "{ifname}";
|
||||
format-linked = "{ifname} (No IP) ";
|
||||
format-disconnected = "Disconnected ";
|
||||
on-click = "nm-connection-editor";
|
||||
};
|
||||
"network#compact" = {
|
||||
format-wifi = "({signalStrength}%) ";
|
||||
format-ethernet = "";
|
||||
tooltip-format = "{essid}";
|
||||
format-linked = "(No IP) ";
|
||||
format-disconnected = "";
|
||||
on-click = "nm-connection-editor";
|
||||
};
|
||||
bluetooth = {
|
||||
format = " {status}";
|
||||
format-disabled = " {status}";
|
||||
format-off = " {status}";
|
||||
format-on = " {status}";
|
||||
format-connected = " {device_alias}";
|
||||
on-click = "blueman-manager";
|
||||
};
|
||||
"bluetooth#compact" = {
|
||||
format = "";
|
||||
format-disabled = "";
|
||||
format-off = "";
|
||||
format-on = "";
|
||||
format-connected = "";
|
||||
tooltip-format = "{status} | {device_alias}";
|
||||
on-click = "blueman-manager";
|
||||
};
|
||||
pulseaudio = {
|
||||
scroll-step = 5;
|
||||
format = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-muted = " {format_source}";
|
||||
format-source = "{volume}% ";
|
||||
format-source-muted = "";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
hands-free = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
"pulseaudio#compact" = {
|
||||
scroll-step = 5;
|
||||
format = "{icon} {format_source}";
|
||||
format-bluetooth = "{icon} {format_source}";
|
||||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-muted = " {format_source}";
|
||||
format-source = "";
|
||||
format-source-muted = "";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
hands-free = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
"custom/power" = {
|
||||
format = "";
|
||||
on-click = "powermenu";
|
||||
};
|
||||
"wlr/workspaces" = {
|
||||
on-click = "activate";
|
||||
disable-scroll = true;
|
||||
all-outputs = false;
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
"1" = "";
|
||||
"2" = "";
|
||||
"3" = "";
|
||||
"4" = "";
|
||||
"5" = "";
|
||||
"6" = "";
|
||||
"7" = "";
|
||||
"8" = "";
|
||||
urgent = "";
|
||||
default = "";
|
||||
};
|
||||
sort-by-number = true;
|
||||
};
|
||||
}
|
5
home/desktop/waybar/modules/backlight.nix
Normal file
5
home/desktop/waybar/modules/backlight.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
format = "{icon}";
|
||||
tooltip-format = "{percent}%";
|
||||
format-icons = ["" "" "" "" "" "" "" "" ""];
|
||||
}
|
11
home/desktop/waybar/modules/battery.compact.nix
Normal file
11
home/desktop/waybar/modules/battery.compact.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon}";
|
||||
format-charging = "";
|
||||
format-plugged = "";
|
||||
tooltip-format = "{time} {capacity}%";
|
||||
format-icons = ["" "" "" "" "" "" "" "" "" "" ""];
|
||||
}
|
10
home/desktop/waybar/modules/battery.nix
Normal file
10
home/desktop/waybar/modules/battery.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{time} {capacity}% {icon}";
|
||||
format-charging = "{time} {capacity}% ";
|
||||
format-plugged = "{capacity}% ";
|
||||
format-icons = ["" "" "" "" "" "" "" "" "" "" ""];
|
||||
}
|
9
home/desktop/waybar/modules/bluetooth.compact.nix
Normal file
9
home/desktop/waybar/modules/bluetooth.compact.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
format = "";
|
||||
format-disabled = "";
|
||||
format-off = "";
|
||||
format-on = "";
|
||||
format-connected = "";
|
||||
tooltip-format = "{status} | {device_alias}";
|
||||
on-click = "blueman-manager";
|
||||
}
|
8
home/desktop/waybar/modules/bluetooth.nix
Normal file
8
home/desktop/waybar/modules/bluetooth.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
format = " {status}";
|
||||
format-disabled = " {status}";
|
||||
format-off = " {status}";
|
||||
format-on = " {status}";
|
||||
format-connected = " {device_alias}";
|
||||
on-click = "blueman-manager";
|
||||
}
|
19
home/desktop/waybar/modules/clock.compact.nix
Normal file
19
home/desktop/waybar/modules/clock.compact.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
format = "{:%R }";
|
||||
format-alt = "{:%A %Y-%m-%d }";
|
||||
tooltip-format = "<tt>{calendar}</tt>";
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
||||
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||
};
|
||||
};
|
||||
}
|
25
home/desktop/waybar/modules/clock.nix
Normal file
25
home/desktop/waybar/modules/clock.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
format = "{:%A %Y-%m-%d | %R }";
|
||||
tooltip-format = "<tt>{calendar}</tt>";
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
||||
today = "<span color='#ff6699'><b><u>{}</u></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";
|
||||
};
|
||||
}
|
4
home/desktop/waybar/modules/cpu.nix
Normal file
4
home/desktop/waybar/modules/cpu.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
format = "{usage}% ";
|
||||
tooltip = false;
|
||||
}
|
9
home/desktop/waybar/modules/keyboard-state.nix
Normal file
9
home/desktop/waybar/modules/keyboard-state.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
numlock = true;
|
||||
capslock = true;
|
||||
format = "{name} {icon}";
|
||||
format-icons = {
|
||||
locked = "";
|
||||
unlocked = "";
|
||||
};
|
||||
}
|
1
home/desktop/waybar/modules/memory.nix
Normal file
1
home/desktop/waybar/modules/memory.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{format = "{}% ";}
|
8
home/desktop/waybar/modules/network.compact.nix
Normal file
8
home/desktop/waybar/modules/network.compact.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
format-wifi = "({signalStrength}%) ";
|
||||
format-ethernet = "";
|
||||
tooltip-format = "{essid}";
|
||||
format-linked = "(No IP) ";
|
||||
format-disconnected = "";
|
||||
on-click = "nm-connection-editor";
|
||||
}
|
8
home/desktop/waybar/modules/network.nix
Normal file
8
home/desktop/waybar/modules/network.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
format-wifi = "{essid} ({signalStrength}%) ";
|
||||
format-ethernet = "Connected ";
|
||||
tooltip-format = "{ifname}";
|
||||
format-linked = "{ifname} (No IP) ";
|
||||
format-disconnected = "Disconnected ";
|
||||
on-click = "nm-connection-editor";
|
||||
}
|
23
home/desktop/waybar/modules/pulseaudio.compact.nix
Normal file
23
home/desktop/waybar/modules/pulseaudio.compact.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
scroll-step = 5;
|
||||
format = "{icon} {format_source}";
|
||||
format-bluetooth = "{icon} {format_source}";
|
||||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-muted = " {format_source}";
|
||||
format-source = "";
|
||||
format-source-muted = "";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
hands-free = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
on-click = "pavucontrol";
|
||||
}
|
19
home/desktop/waybar/modules/pulseaudio.nix
Normal file
19
home/desktop/waybar/modules/pulseaudio.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
scroll-step = 5;
|
||||
format = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-muted = " {format_source}";
|
||||
format-source = "{volume}% ";
|
||||
format-source-muted = "";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
hands-free = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = ["" "" ""];
|
||||
};
|
||||
on-click = "pavucontrol";
|
||||
}
|
5
home/desktop/waybar/modules/temperature.nix
Normal file
5
home/desktop/waybar/modules/temperature.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
critical-threshold = 80;
|
||||
format = "{temperatureC}°C {icon}";
|
||||
format-icons = ["" "" ""];
|
||||
}
|
1
home/desktop/waybar/modules/tray.nix
Normal file
1
home/desktop/waybar/modules/tray.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{spacing = 10;}
|
19
home/desktop/waybar/modules/wlr_workspaces.nix
Normal file
19
home/desktop/waybar/modules/wlr_workspaces.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
on-click = "activate";
|
||||
disable-scroll = true;
|
||||
all-outputs = false;
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
"1" = "";
|
||||
"2" = "";
|
||||
"3" = "";
|
||||
"4" = "";
|
||||
"5" = "";
|
||||
"6" = "";
|
||||
"7" = "";
|
||||
"8" = "";
|
||||
urgent = "";
|
||||
default = "";
|
||||
};
|
||||
sort-by-number = true;
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
{...}: let
|
||||
modules = import ./modules.nix;
|
||||
in {
|
||||
{...}: {
|
||||
imports = [./default.nix];
|
||||
programs.waybar.settings = {
|
||||
vertical = {
|
||||
|
@ -14,9 +12,9 @@ in {
|
|||
"modules-left" = ["wlr/workspaces"];
|
||||
"modules-center" = ["clock#compact"];
|
||||
"modules-right" = ["tray"];
|
||||
"wlr/workspaces" = modules."wlr/workspaces";
|
||||
"clock#compact" = modules."clock#compact";
|
||||
tray = modules.tray;
|
||||
"wlr/workspaces" = import ./modules/wlr_workspaces.nix;
|
||||
"clock#compact" = import ./modules/clock.compact.nix;
|
||||
tray = import ./modules/tray.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue