diff --git a/users/modules/cli/scripts/launcher.nix b/users/modules/cli/scripts/launcher.nix new file mode 100644 index 0000000..56a566f --- /dev/null +++ b/users/modules/cli/scripts/launcher.nix @@ -0,0 +1,23 @@ +{pkgs, ...}: +pkgs.writeShellScriptBin "app-launcher" '' + LOG_FILE="$HOME/.local/share/app-launcher.log" + + logger() { + local level="$1" + local message="$2" + local timestamp + timestamp=$(date +"%Y-%m-%d %H:%M:%S") + printf "[%s] [%-7s] %s\n" "$timestamp" "''${level^^}" "$message" >> "$LOG_FILE" + } + + CAELESTIA_ACTIVE=$(systemctl --user is-active caelestia.service) + logger debug "Caelestia activity: $CAELESTIA_ACTIVE" + + if systemctl --user is-active caelestia.service | grep 'active' &> /dev/null ; then + logger info "Using Caelestia app launcher" + caelestia shell drawers toggle launcher || \ + logger error "failed to launch Caelestia app launcher" + exit 0 + fi + rofi -show drun +'' diff --git a/users/modules/desktop/caelestia.nix b/users/modules/desktop/caelestia.nix index 57bac52..a0b6df1 100644 --- a/users/modules/desktop/caelestia.nix +++ b/users/modules/desktop/caelestia.nix @@ -13,9 +13,7 @@ in { systemd = { enable = true; target = "graphical-session.target"; - environment = [ - "QT3_QPA_PLATFORMTHEME=gtk3" - ]; + environment = ["QT3_QPA_PLATFORMTHEME=gtk3"]; }; settings = { paths.wallpaperDir = "~/Pictures/Wallpapers/nord"; diff --git a/users/phundrak/wlr-which-key/default.nix b/users/phundrak/wlr-which-key/default.nix index 91019fc..49e3111 100644 --- a/users/phundrak/wlr-which-key/default.nix +++ b/users/phundrak/wlr-which-key/default.nix @@ -26,8 +26,9 @@ focus-urgent = import ./focus-urgent.nix {inherit pkgs;}; fullscreen = import ./fullscreen.nix {inherit pkgs;}; logout = import ./logout.nix {inherit pkgs;}; - ytplay = import ../../modules/cli/scripts/ytplay.nix {inherit pkgs;}; + app-launcher = import ../../modules/cli/scripts/launcher.nix {inherit pkgs;}; plock = import ../../modules/cli/scripts/plock.nix {inherit pkgs;}; + ytplay = import ../../modules/cli/scripts/ytplay.nix {inherit pkgs;}; in [ { @@ -96,7 +97,7 @@ { key = "r"; desc = "App Menu"; - cmd = "rofi -show drun"; + cmd = "${app-launcher}/bin/app-launcher"; } { key = "s";