mirror of
https://github.com/youwen5/liminalOS.git
synced 2025-06-20 05:59:51 -07:00
refactor: massively overhaul home manager module system
This commit is contained in:
parent
b2270408fc
commit
a506d2aed4
64 changed files with 5201 additions and 64 deletions
208
hm/modules/linux/desktop-environment/waybar/default.nix
Normal file
208
hm/modules/linux/desktop-environment/waybar/default.nix
Normal file
|
@ -0,0 +1,208 @@
|
|||
{
|
||||
pkgs,
|
||||
osConfig,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.liminalOS.desktop.waybar;
|
||||
in
|
||||
{
|
||||
options.liminalOS.desktop.waybar = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.liminalOS.desktop.enable;
|
||||
description = ''
|
||||
Whether to enable Waybar and the liminalOS rice.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.waybar = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
style = ./style.css;
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
name = "bar0";
|
||||
|
||||
layer = "top";
|
||||
position = "top";
|
||||
|
||||
height = 28;
|
||||
|
||||
"margin" = "5px 10px 0px 10px";
|
||||
"spacing" = 10;
|
||||
|
||||
"mode" = "top";
|
||||
|
||||
reload_style_on_change = true;
|
||||
|
||||
modules-left = [
|
||||
"hyprland/workspaces"
|
||||
"hyprland/window"
|
||||
];
|
||||
modules-right = [
|
||||
"tray"
|
||||
"idle_inhibitor"
|
||||
"backlight"
|
||||
"wireplumber"
|
||||
"network"
|
||||
"battery"
|
||||
"disk"
|
||||
"memory"
|
||||
"cpu"
|
||||
"temperature"
|
||||
"clock"
|
||||
"custom/notification"
|
||||
];
|
||||
|
||||
idle_inhibitor = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
activated = " ";
|
||||
deactivated = " ";
|
||||
};
|
||||
};
|
||||
|
||||
network = {
|
||||
format = "{ifname}";
|
||||
format-wifi = "{icon}{essid}";
|
||||
format-ethernet = " {essid}";
|
||||
format-disconnected = " Disconnected";
|
||||
format-icons = [
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
];
|
||||
tooltip-format = " {bandwidthUpBits} | {bandwidthDownBits}";
|
||||
tooltip-format-wifi = " {bandwidthUpBits} | {bandwidthDownBits} | {signalStrength}";
|
||||
};
|
||||
|
||||
backlight = {
|
||||
interval = 2;
|
||||
format = " {percent}%";
|
||||
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl set +4";
|
||||
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl set 4-";
|
||||
};
|
||||
|
||||
wireplumber = {
|
||||
format = "{icon} {volume}%";
|
||||
format-muted = " ";
|
||||
on-click = "pamixer -t";
|
||||
on-scroll-up = "${pkgs.pamixer}/bin/pamixer set 5%+";
|
||||
on-scroll-down = "${pkgs.pamixer}/bin/pamixer set 5%-";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
|
||||
battery = {
|
||||
interval = 10;
|
||||
format = "{icon} {capacity}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
tooltip = true;
|
||||
tooltip-format = "{timeTo}";
|
||||
};
|
||||
|
||||
disk = {
|
||||
intervel = 30;
|
||||
format = " {percentage_used}%";
|
||||
tooltip-format = "{used} used out of {total} on \"{path}\" ({percentage_used}%)";
|
||||
};
|
||||
|
||||
memory = {
|
||||
interval = 10;
|
||||
format = " {used}";
|
||||
tooltip-format = "{used}GiB used of {total}GiB ({percentage}%)";
|
||||
};
|
||||
|
||||
cpu = {
|
||||
interval = 10;
|
||||
format = " {usage}%";
|
||||
};
|
||||
|
||||
temperature = {
|
||||
interval = 10;
|
||||
};
|
||||
|
||||
clock = {
|
||||
interval = 1;
|
||||
format = "{:%H:%M:%S}";
|
||||
};
|
||||
|
||||
"custom/notification" = lib.mkIf config.liminalOS.desktop.swaync.enable {
|
||||
tooltip = false;
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
notification = "<span foreground='red'><small><sup>⬤</sup></small></span>";
|
||||
none = " ";
|
||||
dnd-notification = "<span foreground='red'><small><sup>⬤</sup></small></span>";
|
||||
dnd-none = " ";
|
||||
};
|
||||
return-type = "json";
|
||||
exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb";
|
||||
on-click = "sleep 0.1 && ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
|
||||
on-click-right = "sleep 0.1 && ${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw";
|
||||
escape = true;
|
||||
};
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
show-special = true;
|
||||
persistent-workspaces = {
|
||||
"*" = [
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
];
|
||||
};
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
active = "";
|
||||
empty = "";
|
||||
default = "";
|
||||
urgent = "";
|
||||
special = "";
|
||||
};
|
||||
};
|
||||
|
||||
"hyprland/window" = {
|
||||
icon = true;
|
||||
icon-size = 20;
|
||||
max-length = 50;
|
||||
rewrite = {
|
||||
"(.*) — LibreWolf" = "$1";
|
||||
"(.*) — Zen Browser" = "$1";
|
||||
"^$" = "👾";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
171
hm/modules/linux/desktop-environment/waybar/desktop/default.nix
Normal file
171
hm/modules/linux/desktop-environment/waybar/desktop/default.nix
Normal file
|
@ -0,0 +1,171 @@
|
|||
{
|
||||
# home.file.".config/waybar/config".source = ./config.jsonc;
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
style = ./style.css;
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
name = "bar0";
|
||||
|
||||
layer = "top";
|
||||
position = "top";
|
||||
|
||||
height = 28;
|
||||
# "width" = 1920;
|
||||
|
||||
"margin" = "5px 10px 0px 10px";
|
||||
"spacing" = 10;
|
||||
|
||||
"mode" = "top";
|
||||
# "exclusive" = true;
|
||||
|
||||
# "output" = "eDP-1";
|
||||
|
||||
reload_style_on_change = true;
|
||||
|
||||
modules-left = [ "hyprland/workspaces" ];
|
||||
modules-center = [ "hyprland/window" ];
|
||||
modules-right = [
|
||||
"tray"
|
||||
"idle_inhibitor"
|
||||
"backlight"
|
||||
"wireplumber"
|
||||
"network"
|
||||
"battery"
|
||||
"disk"
|
||||
"memory"
|
||||
"cpu"
|
||||
"temperature"
|
||||
"clock"
|
||||
];
|
||||
|
||||
idle_inhibitor = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
activated = " ";
|
||||
deactivated = " ";
|
||||
};
|
||||
};
|
||||
|
||||
network = {
|
||||
format = "{ifname}";
|
||||
format-wifi = "{icon}{essid}";
|
||||
format-ethernet = " {essid}";
|
||||
format-disconnected = " Disconnected";
|
||||
format-icons = [
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
];
|
||||
tooltip-format = " {bandwidthUpBits} | {bandwidthDownBits}";
|
||||
tooltip-format-wifi = " {bandwidthUpBits} | {bandwidthDownBits} | {signalStrength}";
|
||||
};
|
||||
|
||||
backlight = {
|
||||
interval = 2;
|
||||
format = " {percent}%";
|
||||
on-scroll-up = "brightnessctl set +4";
|
||||
on-scroll-down = "brightnessctl set 4-";
|
||||
};
|
||||
|
||||
wireplumber = {
|
||||
format = "{icon} {volume}%";
|
||||
format-muted = " ";
|
||||
on-click = "pamixer -t";
|
||||
on-scroll-up = "pamixer set 5%+";
|
||||
on-scroll-down = "pamixer set 5%-";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
|
||||
battery = {
|
||||
interval = 10;
|
||||
format = "{icon}{capacity}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
tooltip = true;
|
||||
tooltip-format = "{timeTo}";
|
||||
};
|
||||
|
||||
disk = {
|
||||
intervel = 30;
|
||||
format = " {percentage_used}%";
|
||||
tooltip-format = "{used} used out of {total} on \"{path}\" ({percentage_used}%)";
|
||||
};
|
||||
|
||||
memory = {
|
||||
interval = 10;
|
||||
format = " {used}";
|
||||
tooltip-format = "{used}GiB used of {total}GiB ({percentage}%)";
|
||||
};
|
||||
|
||||
cpu = {
|
||||
interval = 10;
|
||||
format = " {usage}%";
|
||||
};
|
||||
|
||||
temperature = {
|
||||
interval = 10;
|
||||
};
|
||||
|
||||
clock = {
|
||||
interval = 1;
|
||||
format = "{:%H:%M:%S}";
|
||||
};
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
show-special = true;
|
||||
persistent-workspaces = {
|
||||
"*" = [
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
];
|
||||
};
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
active = "";
|
||||
empty = "";
|
||||
default = "";
|
||||
urgent = "";
|
||||
special = "";
|
||||
};
|
||||
};
|
||||
"hyprland/window" = {
|
||||
icon = true;
|
||||
icon-size = 20;
|
||||
max-length = 50;
|
||||
rewrite = {
|
||||
"(.*) — Ablaze Floorp" = "$1";
|
||||
"(.*) — Zen Browser" = "$1";
|
||||
"^$" = "👾";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
window#waybar {
|
||||
font-family: "CaskaydiaCove Nerd Font";
|
||||
background-color: rgba(0,0,0,0);
|
||||
font-size: 0.8rem;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.modules-left, .modules-center {
|
||||
opacity: 1;
|
||||
background: linear-gradient(45deg, rgb(214, 39, 200), rgb(5, 83, 252));
|
||||
border-radius: 0.5rem;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
opacity: 1;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
border-radius: 0.5rem;
|
||||
padding: 2px 2px 2px 10px
|
||||
}
|
||||
|
||||
/* label.module {
|
||||
margin-left: -1px;
|
||||
} */
|
||||
|
||||
#workspaces {
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
border-radius: 0.5rem;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
font-size: 0.6rem;
|
||||
padding: 0 0.3rem 0 0;
|
||||
}
|
||||
|
||||
#window {
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
border-radius: 0.5rem;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
font-weight: bolder;
|
||||
border-radius: 0.5rem;
|
||||
padding: 0 3px 0 0;
|
||||
}
|
||||
|
||||
#battery {
|
||||
color: lightgreen;
|
||||
}
|
||||
|
||||
#memory {
|
||||
color: lightpink;
|
||||
}
|
||||
|
||||
#disk {
|
||||
color: lightskyblue;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
color: lightgoldenrodyellow;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
color: lightslategray;
|
||||
}
|
||||
|
||||
#network {
|
||||
color: lightsteelblue;
|
||||
}
|
78
hm/modules/linux/desktop-environment/waybar/style.css
Normal file
78
hm/modules/linux/desktop-environment/waybar/style.css
Normal file
|
@ -0,0 +1,78 @@
|
|||
window#waybar {
|
||||
font-family: "CaskaydiaCove Nerd Font";
|
||||
background-color: rgba(0,0,0,0);
|
||||
font-size: 0.8rem;
|
||||
border-radius: 0.5rem;
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
.modules-left {
|
||||
opacity: 1;
|
||||
background: linear-gradient(45deg, rgb(214, 39, 200), rgb(5, 83, 252));
|
||||
border-radius: 0.5rem;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.modules-center {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
opacity: 1;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
border-radius: 0.5rem;
|
||||
padding: 2px 2px 2px 10px
|
||||
}
|
||||
|
||||
/* label.module {
|
||||
margin-left: -1px;
|
||||
} */
|
||||
|
||||
#workspaces {
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
border-radius: 0.5rem;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
font-size: 0.6rem;
|
||||
padding: 0 0.3rem 0 0;
|
||||
border: #cccccc;
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
#window {
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
border-radius: 0.5rem;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
font-weight: bolder;
|
||||
border-radius: 0.5rem;
|
||||
padding: 0 3px 0 0;
|
||||
}
|
||||
|
||||
#battery {
|
||||
color: lightgreen;
|
||||
}
|
||||
|
||||
#memory {
|
||||
color: lightpink;
|
||||
}
|
||||
|
||||
#disk {
|
||||
color: lightskyblue;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
color: lightgoldenrodyellow;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
color: lightslategray;
|
||||
}
|
||||
|
||||
#network {
|
||||
color: lightsteelblue;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue