feat(hyprland): waybar settings etc

This commit is contained in:
winston 2024-04-23 06:34:22 +02:00
parent 3bed58be25
commit ecd11fdc98
Signed by: winston
GPG key ID: 3786770EDBC2B481
4 changed files with 136 additions and 4 deletions

View file

@ -17,6 +17,7 @@
./rice.nix
./sway.nix
./vscode.nix
./waybar.nix
./wezterm.nix
./zsh.nix
];

View file

@ -13,7 +13,7 @@ in {
(pkgs.discord.override {withOpenASAR = true;})
])
++ (lib.optionals isLinux [
pkgs.vesktop
(pkgs.vesktop.override {withSystemVencord = false;})
]);
home.activation.discordSettings = let
json = pkgs.writeTextFile {

View file

@ -9,14 +9,14 @@
home = {
packages = with pkgs; [
blueberry
grimblast
hyprpicker
kooha
libnotify
pavucontrol
swaybg
swayosd
wl-clipboard
swaybg
hyprpicker
grimblast
];
};
@ -81,6 +81,7 @@
"${mod}, space, exec, rofi -show drun"
"${modMove}, space, exec, 1password --quick-access"
"${hyper}, p, exec, grimblast --notify --freeze copy area"
"${modMove}, p, exec, hyprpicker -a"
"${modFocus}, h, movefocus, l"
"${modFocus}, j, movefocus, d"
@ -134,8 +135,11 @@
];
exec-once = [
"${pkgs.xorg.xprop}/bin/xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2"
"${config.programs.waybar.package}/bin/waybar -b hyprland"
];
plugin.hy3.autotile.enable = true;
};
plugins = [pkgs.hyprlandPlugins.hy3];
};
};
}

127
home/apps/waybar.nix Normal file
View file

@ -0,0 +1,127 @@
{
config,
lib,
pkgs,
...
}: let
commonSettings = {
layer = "top";
position = "top";
height = 32;
spacing = 2;
margin = "2";
modules-center = ["hyprland/window"];
modules-right = ["tray" "idle_inhibitor" "pulseaudio" "clock"];
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "󰒲";
};
};
tray.spacing = 10;
pulseaudio = {
format = "{icon} {volume}%";
format-icons.default = ["" "" ""];
on-click = "pavucontrol";
};
};
in {
config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux) {
programs.waybar = {
enable = true;
settings = {
hyprland =
commonSettings
// {
modules-left = ["hyprland/workspaces"];
"hyprland/workspaces" = {
format = "{icon}";
on-click = "activate";
format-icons = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
"7" = "";
"8" = "";
"9" = "";
"10" = "";
};
persistent-workspaces."*" = 10;
};
};
};
style = ''
@define-color red #f38ba8;
@define-color pink #f5c2e7;
@define-color crust #11111c;
@define-color base #1e1e2e;
@define-color text #cdd6f4;
@define-color surface0 #313244;
@define-color surface2 #585b70;
* {
font-family: Symbols Nerd Font, IBM Plex Sans;
font-size: 16px;
color: @text;
}
window#waybar {
background-color: @base;
border: 2px solid @crust;
border-radius: 5px;
}
#workspaces button:first-child {
padding: 0 5px;
border-radius: 5px 0 0 5px;
border-left: 2px solid @crust;
}
#workspaces button.active:first-child {
padding: 0 5px;
box-shadow: unset;
border-radius: 5px 0 0 5px;
border-left: 2px solid @pink;
border-top: 2px solid @pink;
border-bottom: 2px solid @pink;
}
#workspaces button {
padding: 0 5px;
border-radius: 0;
border-top: 2px solid @crust;
border-bottom: 2px solid @crust;
}
#workspaces button:hover {
background: @surface2;
}
#workspaces button.active {
color: @pink;
background: @surface0;
border-top: 2px solid @pink;
border-bottom: 2px solid @pink;
}
#workspaces button.urgent {
background-color: @red;
}
#clock, #network, #pulseaudio, #tray, #idle_inhibitor {
padding: 0 10px;
}
'';
};
};
}