FUCK DBUS

This commit is contained in:
chayleaf 2024-08-15 07:14:30 +07:00
parent 5b7e3df230
commit 7bb8eebf70
Signed by: chayleaf
GPG key ID: 78171AD46227E68E
3 changed files with 34 additions and 22 deletions

View file

@ -103,6 +103,9 @@ commonConfig = {
inherit modifier; inherit modifier;
startup = [ startup = [
{ command = toString (pkgs.writeShellScript "init-wm" '' { command = toString (pkgs.writeShellScript "init-wm" ''
${lib.getBin pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE || true
/run/current-system/sw/bin/systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE || true
/run/current-system/sw/bin/systemctl --user start xdg-desktop-portal-gtk.service || true
${lib.optionalString config.phone.enable '' ${lib.optionalString config.phone.enable ''
${pkgs.procps}/bin/pkill -x wvkbd-mobintl ${pkgs.procps}/bin/pkill -x wvkbd-mobintl
${pkgs.wvkbd}/bin/wvkbd-mobintl --hidden -l full,special,cyrillic,emoji& ${pkgs.wvkbd}/bin/wvkbd-mobintl --hidden -l full,special,cyrillic,emoji&
@ -285,7 +288,15 @@ in
config = commonConfig // { config = commonConfig // {
bars = [ bars = [
{ {
command = "${config.programs.waybar.package}/bin/waybar"; command = toString (pkgs.writeShellScript "run-waybar" ''
${lib.getBin pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE || true
/run/current-system/sw/bin/systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE || true
/run/current-system/sw/bin/systemctl --user start xdg-desktop-portal-gtk.service || true
while true; do
${config.programs.waybar.package}/bin/waybar > ~/var/waybar.log 2>&1
sleep 5 || true
done
'');
mode = "dock"; mode = "dock";
position = "top"; position = "top";
hiddenState = "hide"; hiddenState = "hide";
@ -390,7 +401,7 @@ in
startup = [ startup = [
{ {
always = true; always = true;
command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP"; command = "${lib.getBin pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; /run/current-system/sw/bin/systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; /run/current-system/sw/bin/systemctl --user reset-failed && /run/current-system/sw/bin/systemctl --user start sway-session.target && ${pkgs.sway}/bin/swaymsg -mt subscribe '[]' || true && /run/current-system/sw/bin/systemctl --user stop sway-session.target";
} }
{ {
command = "${pkgs.wl-clipboard}/bin/wl-paste -t text --watch ${pkgs.clipman}/bin/clipman store --no-persist"; command = "${pkgs.wl-clipboard}/bin/wl-paste -t text --watch ${pkgs.clipman}/bin/clipman store --no-persist";
@ -487,7 +498,7 @@ in
home.packages = lib.mkIf config.wayland.windowManager.sway.enable (with pkgs; [ home.packages = lib.mkIf config.wayland.windowManager.sway.enable (with pkgs; [
wl-clipboard wl-clipboard
xdg-desktop-portal xdg-desktop-portal
xdg-desktop-portal-wlr # xdg-desktop-portal-wlr
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
]); ]);
programs.rofi = { programs.rofi = {

View file

@ -21,7 +21,25 @@
});*/ });*/
settings = let settings = let
layer = if config.phone.enable then "overlay" else "top"; layer = if config.phone.enable then "overlay" else "top";
in lib.toList { in lib.optionals config.phone.enable [
{
inherit layer;
position = "top";
ipc = true;
height = 40;
clock = {
interval = 5;
format = "{:%Y-%m-%d %H:%M:%S}";
};
cpu = {
# format = "{usage}% ";
format = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}";
format-icons = ["" "" "" "" "" "" "" ""];
};
modules-left = [ "cpu" ];
modules-right = [ "clock" ];
}
] ++ lib.toList {
inherit layer; inherit layer;
position = "top"; position = "top";
ipc = true; ipc = true;
@ -152,23 +170,6 @@
min-length = 2; min-length = 2;
}; };
} ++ lib.optionals config.phone.enable [ } ++ lib.optionals config.phone.enable [
{
inherit layer;
position = "top";
ipc = true;
height = 40;
clock = {
interval = 5;
format = "{:%Y-%m-%d %H:%M:%S}";
};
cpu = {
# format = "{usage}% ";
format = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}";
format-icons = ["" "" "" "" "" "" "" ""];
};
modules-left = [ "cpu" ];
modules-right = [ "clock" ];
}
{ {
inherit layer; inherit layer;
position = "bottom"; position = "bottom";

View file

@ -62,7 +62,7 @@
programs.sway.enable = true; programs.sway.enable = true;
xdg.portal = { xdg.portal = {
enable = true; enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ]; extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
}; };
# services.xserver.desktopManager.phosh = { # services.xserver.desktopManager.phosh = {
# enable = true; # enable = true;