summary refs log tree commit diff
path: root/host/Rory-desktop/optional/gui/wayland.nix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-06-12 18:46:14 +0200
committerRory& <root@rory.gay>2024-07-04 14:45:02 +0200
commitdf79ef9b9cfc0230935864b820b4cfaf30afafff (patch)
tree5526609fbee0aca7610ba24c0e931586e29b4984 /host/Rory-desktop/optional/gui/wayland.nix
parentAdd portable config, some updates (diff)
downloadRory-Open-Architecture-df79ef9b9cfc0230935864b820b4cfaf30afafff.tar.xz
Desktop changes
Diffstat (limited to 'host/Rory-desktop/optional/gui/wayland.nix')
-rw-r--r--host/Rory-desktop/optional/gui/wayland.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/host/Rory-desktop/optional/gui/wayland.nix b/host/Rory-desktop/optional/gui/wayland.nix
new file mode 100644
index 0000000..e0394d3
--- /dev/null
+++ b/host/Rory-desktop/optional/gui/wayland.nix
@@ -0,0 +1,39 @@
+{ config, pkgs, lib, ... }:
+
+{
+  programs.sway = {
+    enable = true;
+
+    wrapperFeatures.gtk = true;
+    extraSessionCommands = ''
+      # -- Wayland fixes
+      # SDL:
+      export SDL_VIDEODRIVER=wayland
+      # QT (needs qt5.qtwayland in systemPackages):
+      export QT_QPA_PLATFORM=wayland-egl
+      export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
+      # Fix for some Java AWT applications (e.g. Android Studio),
+      # use this if they aren't displayed properly:
+      export _JAVA_AWT_WM_NONREPARENTING=1
+      (
+        sleep 5
+        ${pkgs.swaybg}/bin/swaybg -i ${../../../../modules/users/Rory/wallpaper.webp}
+        #$ {pkgs.swayidle}/bin/swayidle -w timeout 300 'swaylock -f -i ${../../../../modules/users/Rory/wallpaper.webp}' 'swaymsg "output * dpms off"'
+        #$ {pkgs.swaylock}/bin/swaylock -f -i ${../../../../modules/users/Rory/wallpaper.webp}
+        ${pkgs.waybar}/bin/waybar
+      ) &
+    '';
+
+    extraPackages = with pkgs; [
+      swaybg
+      #swayidle
+      #swaylock
+      waybar
+      wl-clipboard
+      grim
+      slurp
+    ];
+  };
+
+}
+