feat: add laptop w/ notch configuration for waybar

This commit is contained in:
Youwen Wu 2025-04-19 20:59:57 -07:00
parent 43062a22f5
commit 1689f677d0
Signed by: youwen
GPG key ID: 865658ED1FE61EC3
2 changed files with 387 additions and 365 deletions

View file

@ -2,6 +2,7 @@
pkgs, pkgs,
config, config,
lib, lib,
osConfig,
... ...
}: }:
let let
@ -21,7 +22,12 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ playerctl ]; home.packages = with pkgs; [ playerctl ];
programs.waybar = { programs.waybar =
let
isDesktop = osConfig.liminalOS.formFactor == "desktop";
isLaptop = osConfig.liminalOS.formFactor == "laptop";
in
{
enable = true; enable = true;
settings.mainBar = { settings.mainBar = {
position = "top"; position = "top";
@ -31,14 +37,19 @@ in
margin-bottom = 0; margin-bottom = 0;
margin-left = 0; margin-left = 0;
margin-right = 0; margin-right = 0;
modules-left = [ modules-left =
[
"custom/launcher" "custom/launcher"
"custom/playerctl#backward" "custom/playerctl#backward"
"custom/playerctl#play" "custom/playerctl#play"
"custom/playerctl#foward" "custom/playerctl#foward"
"custom/playerlabel" "custom/playerlabel"
]; ]
modules-center = [ ++ (lib.optionals isLaptop [
"cava#left"
"hyprland/workspaces"
]);
modules-center = lib.mkIf isDesktop [
"cava#left" "cava#left"
"hyprland/workspaces" "hyprland/workspaces"
"cava#right" "cava#right"
@ -60,8 +71,8 @@ in
active-only = false; active-only = false;
all-outputs = false; all-outputs = false;
disable-scroll = false; disable-scroll = false;
on-scroll-up = "${pkgs.hyprnome}/bin/hyprnome --move"; on-scroll-down = "${pkgs.hyprnome}/bin/hyprnome --move";
on-scroll-down = "${pkgs.hyprnome}/bin/hyprnome --move --previous"; on-scroll-up = "${pkgs.hyprnome}/bin/hyprnome --move --previous";
format = "{icon}"; format = "{icon}";
on-click = "activate"; on-click = "activate";
format-icons = { format-icons = {
@ -263,12 +274,13 @@ in
tooltip = "false"; tooltip = "false";
}; };
}; };
style = '' style =
''
* { * {
border: none; border: none;
border-radius: 0px; border-radius: 0px;
font-family: GeistMono Nerd Font; font-family: GeistMono Nerd Font;
font-size: 13px; /* Reduced font size */ font-size: 13px;
min-height: 0; min-height: 0;
} }
window#waybar { window#waybar {
@ -277,8 +289,8 @@ in
#cava.left, #cava.right { #cava.left, #cava.right {
background: #${palette.base00}; background: #${palette.base00};
margin: 4px; /* Reduced margin */ margin: 4px;
padding: 6px 16px; /* Reduced vertical padding */ padding: 6px 16px;
color: #${palette.base00}; color: #${palette.base00};
} }
#cava.left { #cava.left {
@ -289,9 +301,6 @@ in
} }
#workspaces { #workspaces {
background: #${palette.base00}; background: #${palette.base00};
margin: 4px 5px; /* Reduced vertical margin */
padding: 6px 5px; /* Reduced vertical padding */
border-radius: 16px;
color: #${palette.base00} color: #${palette.base00}
} }
#workspaces button { #workspaces button {
@ -324,7 +333,7 @@ in
#custom-playerctl.backward, #custom-playerctl.play, #custom-playerctl.foward{ #custom-playerctl.backward, #custom-playerctl.play, #custom-playerctl.foward{
background: #${palette.base00}; background: #${palette.base00};
font-weight: bold; font-weight: bold;
margin: 4px 0px; /* Reduced vertical margin */ margin: 4px 0px;
} }
#tray, #pulseaudio, #network, #battery{ #tray, #pulseaudio, #network, #battery{
color: #${palette.base05}; color: #${palette.base05};
@ -336,10 +345,10 @@ in
color: #${palette.base05}; color: #${palette.base05};
background: #${palette.base00}; background: #${palette.base00};
border-radius: 0px 0px 0px 40px; border-radius: 0px 0px 0px 40px;
padding: 8px 10px 8px 25px; /* Reduced vertical padding */ padding: 8px 10px 8px 25px;
margin-left: 7px; margin-left: 7px;
font-weight: bold; font-weight: bold;
font-size: 14px; /* Reduced font size */ font-size: 14px;
} }
#custom-launcher { #custom-launcher {
color: #${palette.base0A}; color: #${palette.base0A};
@ -347,12 +356,12 @@ in
border-radius: 0px 0px 40px 0px; border-radius: 0px 0px 40px 0px;
margin: 0px; margin: 0px;
padding: 0px 35px 0px 15px; padding: 0px 35px 0px 15px;
font-size: 24px; /* Reduced font size */ font-size: 24px;
} }
#custom-playerctl.backward, #custom-playerctl.play, #custom-playerctl.foward { #custom-playerctl.backward, #custom-playerctl.play, #custom-playerctl.foward {
background: #${palette.base00}; background: #${palette.base00};
font-size: 20px; /* Reduced font size */ font-size: 20px;
} }
#custom-playerctl.backward:hover, #custom-playerctl.play:hover, #custom-playerctl.foward:hover{ #custom-playerctl.backward:hover, #custom-playerctl.play:hover, #custom-playerctl.foward:hover{
color: #${palette.base05}; color: #${palette.base05};
@ -378,7 +387,7 @@ in
color: #${palette.base05}; color: #${palette.base05};
padding: 0 20px; padding: 0 20px;
border-radius: 24px 10px 24px 10px; border-radius: 24px 10px 24px 10px;
margin: 4px 0; /* Reduced vertical margin */ margin: 4px 0;
font-weight: bold; font-weight: bold;
} }
#window{ #window{
@ -386,12 +395,26 @@ in
padding-left: 15px; padding-left: 15px;
padding-right: 15px; padding-right: 15px;
border-radius: 16px; border-radius: 16px;
margin-top: 4px; /* Reduced margin */ margin-top: 4px;
margin-bottom: 4px; /* Reduced margin */ margin-bottom: 4px;
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
''; ''
+ (lib.optionalString isLaptop ''
#workspaces {
margin: 4px;
padding: 6px 16px;
border-radius: 24px 10px 24px 10px;
}
'')
+ (lib.optionalString isDesktop ''
#workspaces {
margin: 4px 5px;
padding: 6px 5px;
border-radius: 16px;
}
'');
}; };
}; };
} }

View file

@ -1,5 +1,4 @@
{ {
inputs,
lib, lib,
config, config,
osConfig, osConfig,