feat(waybar): Added apps to left bar
This commit is contained in:
1 parent
4e1aebf265
commit
bbcf7c1f44
1 file changed
+35
-14
@@ -30,6 +30,22 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pinnedApps = [
|
||||||
|
{ id = "browser"; icon = ""; command = "vivaldi"; }
|
||||||
|
{ id = "terminal"; icon = ""; command = "ghostty"; }
|
||||||
|
{ id = "telegram"; icon = ""; command = "ayugram-desktop"; }
|
||||||
|
{ id = "notes"; icon = ""; command = "obsidian"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
pinnedModules = lib.listToAttrs (map (a: lib.nameValuePair "custom/pin-${a.id}" {
|
||||||
|
format = a.icon;
|
||||||
|
on-click = a.command;
|
||||||
|
tooltip = false;
|
||||||
|
}) pinnedApps);
|
||||||
|
|
||||||
|
pinnedCss = lib.concatMapStringsSep "," (a: "#custom-pin-${a.id}") pinnedApps;
|
||||||
|
pinnedCssHover = lib.concatMapStringsSep "," (a: "#custom-pin-${a.id}:hover") pinnedApps;
|
||||||
|
|
||||||
leftbarJson = {
|
leftbarJson = {
|
||||||
collapsed = pkgs.writeText "leftbar-collapsed.json" (builtins.toJSON {
|
collapsed = pkgs.writeText "leftbar-collapsed.json" (builtins.toJSON {
|
||||||
layer = "top";
|
layer = "top";
|
||||||
@@ -45,14 +61,14 @@
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
expanded = pkgs.writeText "leftbar-expanded.json" (builtins.toJSON {
|
expanded = pkgs.writeText "leftbar-expanded.json" (builtins.toJSON ({
|
||||||
layer = "top";
|
layer = "top";
|
||||||
exclusive = false;
|
exclusive = false;
|
||||||
position = "left";
|
position = "left";
|
||||||
width = leftWidth;
|
width = leftWidth;
|
||||||
spacing = 0;
|
spacing = 0;
|
||||||
modules-left = [ "custom/network-speed" "disk" ];
|
modules-left = [ "custom/network-speed" ];
|
||||||
modules-center = [ ];
|
modules-center = map (a: "custom/pin-${a.id}") pinnedApps;
|
||||||
modules-right = [ "custom/restart" "custom/power" ];
|
modules-right = [ "custom/restart" "custom/power" ];
|
||||||
"custom/power" = {
|
"custom/power" = {
|
||||||
format = "";
|
format = "";
|
||||||
@@ -70,13 +86,7 @@
|
|||||||
rotate = 90;
|
rotate = 90;
|
||||||
tooltip = false;
|
tooltip = false;
|
||||||
};
|
};
|
||||||
disk = {
|
} // pinnedModules));
|
||||||
interval = 30;
|
|
||||||
rotate = 90;
|
|
||||||
format = "{percentage_free}%";
|
|
||||||
paths = [ "/" ];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
leftbarCss = {
|
leftbarCss = {
|
||||||
@@ -98,8 +108,7 @@
|
|||||||
|
|
||||||
#custom-power,
|
#custom-power,
|
||||||
#custom-restart,
|
#custom-restart,
|
||||||
#custom-network-speed,
|
#custom-network-speed {
|
||||||
#disk {
|
|
||||||
background: ${c.base00};
|
background: ${c.base00};
|
||||||
color: ${c.base05};
|
color: ${c.base05};
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
@@ -109,11 +118,23 @@
|
|||||||
|
|
||||||
#custom-power:hover,
|
#custom-power:hover,
|
||||||
#custom-restart:hover,
|
#custom-restart:hover,
|
||||||
#custom-network-speed:hover,
|
#custom-network-speed:hover {
|
||||||
#disk:hover {
|
|
||||||
background: ${c.base0B};
|
background: ${c.base0B};
|
||||||
color: ${c.base00};
|
color: ${c.base00};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
${pinnedCss} {
|
||||||
|
background: ${c.base00};
|
||||||
|
color: ${c.base04};
|
||||||
|
border-radius: 6px;
|
||||||
|
min-height: 34px;
|
||||||
|
margin: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
${pinnedCssHover} {
|
||||||
|
background: ${c.base01};
|
||||||
|
color: ${c.base0B};
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user