From f1797fd30af8823865c74f4ae598c994650e3b6c Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Sun, 24 Mar 2024 19:10:55 +0100 Subject: [PATCH] feat: some more services start only with qtile --- hosts/configuration.nix | 5 +++++ hosts/home.nix | 14 +++++++------- modules/desktop/qtile/home.nix | 4 ++++ modules/desktop/qtile/scripts/xephyr | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 modules/desktop/qtile/scripts/xephyr diff --git a/hosts/configuration.nix b/hosts/configuration.nix index 5b23cd4..bb485cd 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -35,7 +35,12 @@ # zsh is configured at home-manager level afterwards networking.networkmanager.enable = true; + programs.nm-applet.enable = true; + systemd.user.services.nm-applet = lib.mkIf config.programs.nm-applet.enable { + wantedBy = lib.mkForce [ "qtile-services.target" ]; + partOf = lib.mkForce [ "qtile-services.target" ]; + }; programs.command-not-found.enable = false; diff --git a/hosts/home.nix b/hosts/home.nix index 9f892b4..c6cabef 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -178,13 +178,13 @@ gtk = { # Theming enable = true; - theme = { - name = "Graphite-orange-Dark"; - package = pkgs.graphite-gtk-theme.override { - themeVariants = ["orange"]; - colorVariants = ["dark"]; - }; - }; + # theme = { + # name = "Graphite-orange-Dark"; + # package = pkgs.graphite-gtk-theme.override { + # themeVariants = ["orange"]; + # colorVariants = ["dark"]; + # }; + # }; iconTheme = { name = "Tela-circle-dark"; package = pkgs.tela-circle-icon-theme; diff --git a/modules/desktop/qtile/home.nix b/modules/desktop/qtile/home.nix index 45aa65a..29a8857 100644 --- a/modules/desktop/qtile/home.nix +++ b/modules/desktop/qtile/home.nix @@ -8,6 +8,10 @@ in { services.autorandr = { enable = true; }; + systemd.user.services.autorandr = lib.mkIf config.services.autorandr.enable { + Unit.PartOf = lib.mkForce [ "qtile-services.target" ]; + Install.WantedBy = lib.mkForce [ "qtile-services.target" ]; + }; home.packages = with pkgs; [ nur.rutherther.rutherther-mpris-ctl diff --git a/modules/desktop/qtile/scripts/xephyr b/modules/desktop/qtile/scripts/xephyr new file mode 100644 index 0000000..38b5401 --- /dev/null +++ b/modules/desktop/qtile/scripts/xephyr @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +HERE=$(dirname $(readlink -f $0)) +SCREEN_SIZE=${SCREEN_SIZE:-800x600} +XDISPLAY=${XDISPLAY:-:1} +LOG_LEVEL=${LOG_LEVEL:-INFO} +APP=${APP:-$(python -c "from libqtile.utils import guess_terminal; print(guess_terminal())")} + +Xephyr +extension RANDR -screen ${SCREEN_SIZE} ${XDISPLAY} -ac & +XEPHYR_PID=$! +( + sleep 1 + env DISPLAY=${XDISPLAY} QTILE_XEPHYR=1 qtile start -l ${LOG_LEVEL} -c "$HERE"/../config/config.py $@ & + QTILE_PID=$! + env DISPLAY=${XDISPLAY} ${APP} & + wait $QTILE_PID + kill $XEPHYR_PID +) -- 2.48.1