From 7b2297050700a38250d760e399d458a2731333ed Mon Sep 17 00:00:00 2001 From: Swarsel Date: Sun, 11 Aug 2024 01:19:43 +0200 Subject: [PATCH] fix: make syncthingtray wait for tray --- .gitignore | 1 + SwarselSystems.org | 90 +++++++++++++++-------------- profiles/common/home/packages.nix | 1 - profiles/common/home/sway.nix | 2 +- profiles/common/home/symlink.nix | 4 ++ profiles/common/nixos/packages.nix | 1 + profiles/common/nixos/syncthing.nix | 8 +-- programs/swayidle/config | 4 ++ 8 files changed, 62 insertions(+), 49 deletions(-) create mode 100644 programs/swayidle/config diff --git a/.gitignore b/.gitignore index addac83..d862dfa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ secrets/keys/pubring.kbx secrets/keys/private-keys-v1.d/ result +*.~undo-tree~ diff --git a/SwarselSystems.org b/SwarselSystems.org index 9896f27..89e52f9 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -5527,6 +5527,7 @@ Mostly used to install some compilers and lsp's that I want to have available wh # pinentry dbus swaylock-effects + syncthingtray-minimal # secure boot sbctl @@ -5666,22 +5667,22 @@ Do not touch this. folders = { "Default Folder" = { path = "/home/swarsel/Sync"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "default"; }; "Obsidian" = { path = "/home/swarsel/Nextcloud/Obsidian"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "yjvni-9eaa7"; }; "Org" = { path = "/home/swarsel/Nextcloud/Org"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "a7xnl-zjj3d"; }; "Vpn" = { path = "/home/swarsel/Vpn"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "hgp9s-fyq3p"; }; }; @@ -6603,7 +6604,6 @@ This holds packages that I can use as provided, or with small modifications (as # gnome.gnome-clocks # wlogout # jdiskreport - syncthingtray # monitor #keychain @@ -6880,45 +6880,45 @@ Some programs lack a dmenu launcher - I define them myself here. TODO: Non-NixOS machines (=sp3) should not use these by default, but instead the programs prefixed with "nixGL". I need to figure out how to automate this process, as it is not feasible to write desktop entries for all programs installed on that machine. #+begin_src nix :tangle profiles/common/home/desktop.nix - _: - { - xdg.desktopEntries = { + _: + { + xdg.desktopEntries = { + + cura = { + name = "Ultimaker Cura"; + genericName = "Cura"; + exec = "cura"; + terminal = false; + categories = [ "Application" ]; + }; + + anki = { + name = "Anki Flashcards"; + genericName = "Anki"; + exec = "anki"; + terminal = false; + categories = [ "Application" ]; + }; + + element = { + name = "Element Matrix Client"; + genericName = "Element"; + exec = "element-desktop -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; + terminal = false; + categories = [ "Application" ]; + }; + + emacsclient-newframe = { + name = "Emacs (Client, New Frame)"; + genericName = "Emacs (Client, New Frame)"; + exec = "emacsclient -r %u"; + icon = "emacs"; + terminal = false; + categories = [ "Development" "TextEditor" ]; + }; - cura = { - name = "Ultimaker Cura"; - genericName = "Cura"; - exec = "cura"; - terminal = false; - categories = [ "Application" ]; }; - - anki = { - name = "Anki Flashcards"; - genericName = "Anki"; - exec = "anki"; - terminal = false; - categories = [ "Application" ]; - }; - - element = { - name = "Element Matrix Client"; - genericName = "Element"; - exec = "element-desktop -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; - terminal = false; - categories = [ "Application" ]; - }; - - emacsclient-newframe = { - name = "Emacs (Client, New Frame)"; - genericName = "Emacs (Client, New Frame)"; - exec = "emacsclient -r %u"; - icon = "emacs"; - terminal = false; - categories = [ "Development" "TextEditor" ]; - }; - - }; - } + } #+end_src **** Linking dotfiles @@ -6951,6 +6951,10 @@ As for the `home.sessionVariables`, it should be noted that environment variable source = ../../../programs/git/.gitmessage; target = ".gitmessage"; }; + "swayidle/config" = { + source = ../../../programs/swayidle/config; + target = ".config/swayidle/config"; + }; }; #+end_src @@ -8342,7 +8346,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se } exec systemctl --user import-environment - + exec swayidle -w ${swayfxSettings} diff --git a/profiles/common/home/packages.nix b/profiles/common/home/packages.nix index 44e2f9c..a78023e 100644 --- a/profiles/common/home/packages.nix +++ b/profiles/common/home/packages.nix @@ -120,7 +120,6 @@ # gnome.gnome-clocks # wlogout # jdiskreport - syncthingtray # monitor #keychain diff --git a/profiles/common/home/sway.nix b/profiles/common/home/sway.nix index 869fab5..cd3cf63 100644 --- a/profiles/common/home/sway.nix +++ b/profiles/common/home/sway.nix @@ -273,7 +273,7 @@ in } exec systemctl --user import-environment - + exec swayidle -w ${swayfxSettings} diff --git a/profiles/common/home/symlink.nix b/profiles/common/home/symlink.nix index ad9c084..3b5b30b 100644 --- a/profiles/common/home/symlink.nix +++ b/profiles/common/home/symlink.nix @@ -18,6 +18,10 @@ _: source = ../../../programs/git/.gitmessage; target = ".gitmessage"; }; + "swayidle/config" = { + source = ../../../programs/swayidle/config; + target = ".config/swayidle/config"; + }; }; xdg.configFile = { diff --git a/profiles/common/nixos/packages.nix b/profiles/common/nixos/packages.nix index e9298e9..6583780 100644 --- a/profiles/common/nixos/packages.nix +++ b/profiles/common/nixos/packages.nix @@ -21,6 +21,7 @@ # pinentry dbus swaylock-effects + syncthingtray-minimal # secure boot sbctl diff --git a/profiles/common/nixos/syncthing.nix b/profiles/common/nixos/syncthing.nix index 228c489..0c57c7e 100644 --- a/profiles/common/nixos/syncthing.nix +++ b/profiles/common/nixos/syncthing.nix @@ -21,22 +21,22 @@ _: folders = { "Default Folder" = { path = "/home/swarsel/Sync"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "default"; }; "Obsidian" = { path = "/home/swarsel/Nextcloud/Obsidian"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "yjvni-9eaa7"; }; "Org" = { path = "/home/swarsel/Nextcloud/Org"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "a7xnl-zjj3d"; }; "Vpn" = { path = "/home/swarsel/Vpn"; - devices = [ "sync (@oracle) magicant" ]; + devices = [ "sync (@oracle)" "magicant" ]; id = "hgp9s-fyq3p"; }; }; diff --git a/programs/swayidle/config b/programs/swayidle/config new file mode 100644 index 0000000..0d4c878 --- /dev/null +++ b/programs/swayidle/config @@ -0,0 +1,4 @@ +timeout 300 'swaylock -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize ' +timeout 600 'swaymsg "output * power off"' +after-resume 'swaymsg "output * power on"' +before-sleep 'swaylock -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2 --daemonize -'