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"