diff --git a/README.md b/README.md index b4efeaa..756a322 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ _add_history() { local cmd=$(fc -ln -1) cmd=${cmd//$'\n'/\\n} shist add \ - --timestamp "$(date --utc --iso-8601=seconds)" \ + --timestamp "$(date -u +%Y-%m-%dT%H:%M:%S+00:00)" \ --hostname "$(hostname)" \ --dir "$(pwd)" \ -- "$cmd" @@ -46,10 +46,14 @@ hsup() { shist sync "$histdb_dir" } hs() { local copy_cmd= - case "$XDG_SESSION_TYPE" in - x11) copy_cmd="xsel --clipboard" ;; - wayland) copy_cmd="wl-copy --trim-newline" ;; - *) echo "Session type not detected."; return ;; + case "$(uname -s)" in + Darwin) copy_cmd="pbcopy" ;; + *) + case "$XDG_SESSION_TYPE" in + x11) copy_cmd="xsel --clipboard" ;; + wayland) copy_cmd="wl-copy --trim-newline" ;; + *) echo "Session type not detected."; return ;; + esac ;; esac local entry="$(