refactor(hyprland): wrap waybar to add hyprctl
parent
888b3246a7
commit
254af322b5
|
@ -58,7 +58,16 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
# use package with hyprland support for switching workspaces
|
# use package with hyprland support for switching workspaces
|
||||||
package = pkgs.waybar-hyprland;
|
package = pkgs.symlinkJoin {
|
||||||
|
name = "waybar-hyprland";
|
||||||
|
paths = [ pkgs.waybar-hyprland ];
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/waybar \
|
||||||
|
--prefix PATH ":" "${hyprland}/bin"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
# start using systemd service
|
# start using systemd service
|
||||||
systemd = {
|
systemd = {
|
||||||
|
|
|
@ -22,12 +22,4 @@ final: prev: {
|
||||||
--add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland"
|
--add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
waybar-hyprland = prev.waybar.overrideAttrs (old: {
|
|
||||||
pname = "${old.pname}-hyprland";
|
|
||||||
postPatch = old.postPatch or "" + ''
|
|
||||||
sed -i 's,zext_workspace_handle_v1_activate(workspace_handle_);,const std::string command = "${final.hyprland}/bin/hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());,g' src/modules/wlr/workspace_manager.cpp
|
|
||||||
'';
|
|
||||||
mesonFlags = old.mesonFlags or [ ] ++ [ "-Dexperimental=true" ];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue