From 2c0699c54462d6503aaae6a223c7369c13f5c096 Mon Sep 17 00:00:00 2001
From: Chris Cochrun <chris@cochrun.xyz>
Date: Thu, 12 Jan 2023 09:49:44 -0600
Subject: [PATCH] updates to desktop stuff

---
 modules/desktop.nix          | 4 ++--
 pkgs/desktop-packages.nix    | 3 ++-
 system/syl/configuration.nix | 2 +-
 user/home.nix                | 1 -
 user/modules/hyprland.nix    | 9 +++++----
 wofi/config                  | 5 ++++-
 wofi/style.css               | 1 +
 ydotool/default.nix          | 6 +++---
 8 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/modules/desktop.nix b/modules/desktop.nix
index 774233f..e5961ba 100644
--- a/modules/desktop.nix
+++ b/modules/desktop.nix
@@ -78,7 +78,7 @@ with lib;
         user = "chris";
       };
       default_session = {
-        command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time -r --window-padding 2 --cmd 'dbus-run-session startplasma-wayland'";
+        command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time -r --window-padding 2 --cmd /home/chris/bin/hyprland -s /etc/greetd/environments";
         user = "greeter";
       };
       plasma_session = {
@@ -94,9 +94,9 @@ with lib;
 
   environment.etc."greetd/environments".text = ''
     /home/chris/bin/hyprland
+    dbus-run-session startplasma-wayland
     fish
     bash
-    dbus-run-session startplasma-wayland
 '';
 
   programs.hyprland = {
diff --git a/pkgs/desktop-packages.nix b/pkgs/desktop-packages.nix
index 0d14054..2cffef9 100644
--- a/pkgs/desktop-packages.nix
+++ b/pkgs/desktop-packages.nix
@@ -51,6 +51,7 @@ with lib;
     wlrctl
     hyprpaper
     swaylock-fancy
+    swayidle
     aha
     glxinfo
     vulkan-tools
@@ -118,7 +119,7 @@ with lib;
     python3
     airshipper
     # hyprland
-    (import /home/chris/.dotfiles/ydotool { inherit lib stdenv util-linux cmake scdoc fetchFromGitHub; })
+    (callPackage ../ydotool {  })
     # (libsForQt5.callPackage /home/chris/dev/LightlyShaders {}) # LightlyShaders
     # (libsForQt5.callPackage /home/chris/dev/church-presenter {}) # librepresenter
     nix-index
diff --git a/system/syl/configuration.nix b/system/syl/configuration.nix
index 3d58f0e..53f50fe 100644
--- a/system/syl/configuration.nix
+++ b/system/syl/configuration.nix
@@ -4,7 +4,7 @@
   imports =
     [
       ./hardware-configuration.nix
-      /etc/nixos/cachix.nix
+      ../../cachix/default.nix
       ../../pkgs/base-packages.nix
       ../../pkgs/desktop-packages.nix
       ../../modules/base.nix
diff --git a/user/home.nix b/user/home.nix
index ff11218..2eacd37 100644
--- a/user/home.nix
+++ b/user/home.nix
@@ -257,7 +257,6 @@
   services.espanso = {
     enable = true;
     settings = {
-      
       toggle_key = "RIGHT_CTRL";
       matches = [
         { # dates
diff --git a/user/modules/hyprland.nix b/user/modules/hyprland.nix
index 2f18ff8..a3adba4 100644
--- a/user/modules/hyprland.nix
+++ b/user/modules/hyprland.nix
@@ -109,12 +109,12 @@
     windowrule=float,dolphin
     ${if builtins.readFile "/etc/hostname" == "syl\n" then "# this is a kaladin space" else "windowrule=workspace 1,mpv"}
     windowrule=float,mpv
-    ${if builtins.readFile "/etc/hostname" == "syl\n" then "windowrule=size 90% 76%,mpv" else "windowrule=size 85% 85%,mpv"}
+    windowrule=size ${if builtins.readFile "/etc/hostname" == "syl\n" then "90% 76%" else "85% 85%"},mpv
     windowrule=center,mpv
     windowrule=pin,mpv
     windowrule=float,pulsemixer
-    windowrule=workspace 1,firefox
-    windowrule=workspace 2,emacs
+    windowrule=workspace ${if builtins.readFile "/etc/hostname" == "syl\n" then "2" else "1"},firefox
+    windowrule=workspace ${if builtins.readFile "/etc/hostname" == "syl\n" then "1" else "2"},emacs
     windowrule=float,btop
     windowrule=size 70% 70%,btop
     windowrule=center,btop
@@ -210,6 +210,7 @@
     exec-once = dbus-update-activation-environment --systemd --all
     exec-once = jellyfin-mpv-shim
     exec-once = hyprctl setcursor phinger-cursors-light
-    '';
+    exec-once = swayidle -w timeout 600 "swaylock-fancy -t Password: -f 'VictorMono Nerd Font' -F" timeout 1200 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep "swaylock-fancy -t Password: -f 'VictorMono Nerd Font' -F" 
+  '';
   };
 }
diff --git a/wofi/config b/wofi/config
index 24e7663..3440790 100644
--- a/wofi/config
+++ b/wofi/config
@@ -5,5 +5,8 @@ parse_action=true
 allow_images=true
 dynamic_lines=true
 term=alacritty
+normal_window=true
+no_actions=true
 key_forward=Control_L-j
-key_backward=Control_L-k
\ No newline at end of file
+key_backward=Control_L-k
+key_expand=Tab
\ No newline at end of file
diff --git a/wofi/style.css b/wofi/style.css
index e3dd83a..8752525 100644
--- a/wofi/style.css
+++ b/wofi/style.css
@@ -19,6 +19,7 @@
 window {
     margin: 100px;
     background-color: @base00;
+    /* border-radius: 20px; */
 }
 
 #input {
diff --git a/ydotool/default.nix b/ydotool/default.nix
index 50fb78d..319a924 100644
--- a/ydotool/default.nix
+++ b/ydotool/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "ydotool";
-  version = "1.0.2";
+  version = "1.0.3";
 
   src = fetchFromGitHub {
     owner = "ReimuNotMoe";
     repo = "ydotool";
-    rev = "1d5d227e3a6dc9b70147960e99f17695d9f6804e";
-    sha256 = "sha256-maXXGCqB8dkGO8956hsKSwM4HQdYn6z1jBFENQ9sKcA=";
+    rev = "v${version}";
+    sha256 = "sha256-RcPHQFXD3YgfF11OFpcnSowPlEjxy2c2RWhGYr30GhI=";
   };
 
   strictDeps = true;