1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

chore: don't use systemd to start swaync and waybar to get restart support

This commit is contained in:
oddlama 2024-06-20 17:46:19 +02:00
parent a0e50ce0e9
commit c5a4bfa5f2
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
3 changed files with 33 additions and 2 deletions

View file

@ -117,6 +117,13 @@ in {
}; };
decoration.rounding = 4; decoration.rounding = 4;
exec-once = [
"${pkgs.waybar}/bin/waybar"
"${pkgs.swaynotificationcenter}/bin/swaync"
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user restart xdg-desktop-portal.service"
];
input = { input = {
kb_layout = "de"; kb_layout = "de";

View file

@ -86,4 +86,7 @@
) )
+ (builtins.readFile ./swaync-style.css); + (builtins.readFile ./swaync-style.css);
}; };
# Started via hyprland to ensure it restarts properly with hyprland
systemd.user.services.swaync.Install.WantedBy = lib.mkForce [];
} }

View file

@ -5,7 +5,8 @@
}: { }: {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; # Started via hyprland to ensure it restarts properly with hyprland
systemd.enable = false;
style = builtins.readFile ./waybar-style.css; style = builtins.readFile ./waybar-style.css;
settings.main = { settings.main = {
layer = "top"; layer = "top";
@ -17,6 +18,7 @@
"tray" "tray"
"hyprland/submap" "hyprland/submap"
"privacy" "privacy"
"custom/whisper_overlay"
]; ];
modules-center = [ modules-center = [
"hyprland/window" "hyprland/window"
@ -88,6 +90,25 @@
escape = true; escape = true;
}; };
"custom/whisper_overlay" = {
tooltip = true;
format = "{icon}";
format-icons = {
disconnected = "<span foreground='gray'></span>";
connected = "<span foreground='#4ab0fa'></span>";
connected-active = "<span foreground='red'></span>";
};
return-type = "json";
exec = "${lib.getExe pkgs.whisper-overlay} waybar-status --address localhost:43007";
on-click-right = lib.getExe (pkgs.writeShellApplication {
name = "toggle-realtime-stt-server";
runtimeInputs = [];
text = ''
'';
});
escape = true;
};
privacy = { privacy = {
icon-spacing = 4; icon-spacing = 4;
icon-size = 18; icon-size = 18;
@ -115,7 +136,7 @@
format = "<tt>{icon} {volume}%</tt>"; format = "<tt>{icon} {volume}%</tt>";
format-muted = "<tt> {volume}%</tt>"; format-muted = "<tt> {volume}%</tt>";
format-icons = ["" ""]; format-icons = ["" ""];
on-click = "hyprctl dispatch exec \"[float;pin;move 80% 50%;size 20% 50%;noborder]\" ${lib.getExe pkgs.pwvucontrol}"; on-click = "${pkgs.hyprland}/bin/hyprctl dispatch exec \"[float;pin;move 80% 50%;size 20% 50%;noborder]\" ${lib.getExe pkgs.pwvucontrol}";
on-click-middle = "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%"; on-click-middle = "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%";
on-click-right = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; on-click-right = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
}; };