From 5cc5a5f5630b5696fcfc8492d5e55f67bb0e48b7 Mon Sep 17 00:00:00 2001 From: Emily Frost Date: Mon, 24 Oct 2022 19:37:05 -0500 Subject: [PATCH] Fixed a pid-checking bug in get-ssh-agent and added journal. --- functions/get-ssh-agent | 2 +- functions/journal | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 functions/journal diff --git a/functions/get-ssh-agent b/functions/get-ssh-agent index c8e6353..189515d 100755 --- a/functions/get-ssh-agent +++ b/functions/get-ssh-agent @@ -24,7 +24,7 @@ function _start_new_ssh_agent () { if [[ -e "$ssh_agent_env_file" ]]; then # determine if the pid in the env file is still alive - if [[ "$(source "$ssh_agent_env_file"; ps -ef | grep "$SSH_AGENT_PID")" ]]; then + if [[ -n "$(source "$ssh_agent_env_file"; ps -p "$SSH_AGENT_PID")" ]]; then source "$ssh_agent_env_file" echo "Existing ssh-agent environment configured with pid ${SSH_AGENT_PID}." else diff --git a/functions/journal b/functions/journal new file mode 100644 index 0000000..1777cd0 --- /dev/null +++ b/functions/journal @@ -0,0 +1,6 @@ +## journal +# A simple function to automatically select the correct journal file. + +journal_file="$(xdg-user-dir DOCUMENTS)/journal/$(date +%F).md" + +"$EDITOR" "$journal_file"