From 0ea8b9ed2cb736a262bbd23eb6ea7677ffff8426 Mon Sep 17 00:00:00 2001 From: Kabbone Date: Sun, 9 Oct 2022 10:35:54 +0200 Subject: [PATCH] fix the hm zsh initshell --- modules/desktop/hyprland/default.nix | 2 +- modules/shell/tmux.nix | 1 + modules/shell/zsh.nix | 13 ++++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix index 0fc5eb5..9186362 100644 --- a/modules/desktop/hyprland/default.nix +++ b/modules/desktop/hyprland/default.nix @@ -27,7 +27,7 @@ environment = { loginShellInit = '' - if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then + if [ -z $DISPLAY ] && [ $UID != 0 ] && [ "$(tty)" = "/dev/tty1" ]; then exec Hyprland fi ''; # Will automatically open sway when logged into tty1 diff --git a/modules/shell/tmux.nix b/modules/shell/tmux.nix index 0b3edfc..40b79c7 100644 --- a/modules/shell/tmux.nix +++ b/modules/shell/tmux.nix @@ -15,6 +15,7 @@ clock24 = true; shortcut = "h"; baseIndex = 1; + shell = "\${pkgs.zsh}/bin/zsh"; plugins = [ pkgs.tmuxPlugins.dracula ]; extraConfig = '' set -g @dracula-plugins "cpu-usage ram-usage network-bandwidth time" diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix index bc5b284..cababfb 100644 --- a/modules/shell/zsh.nix +++ b/modules/shell/zsh.nix @@ -18,12 +18,15 @@ plugins = [ "git" ]; custom = "$HOME/.config/zsh_nix/custom"; }; -# shellInit = '' -# export GPG_TTY="$(tty)" -# gpg-connect-agent /bye -# export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" -# ''; initExtra = '' # Zsh theme + if [[ $DISPLAY ]]; then + [[ $- != *i* ]] && return + tmux attach + fi + export GPG_TTY=$(tty) + gpg-connect-agent updatestartuptty /bye >/dev/null + unset SSH_AGENT_PID + export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" # Spaceship source ${pkgs.spaceship-prompt}/share/zsh/site-functions/prompt_spaceship_setup autoload -U promptinit; promptinit