From 521474848df1abda5aee0b1d7dfc48d91914fb38 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 5 May 2024 15:56:05 -0500 Subject: [PATCH] refactor(zsh): replace 'o' alias with function --- .../dots/.config/zsh/config/profile/profile/aliases.zsh | 7 +------ .../dots/.config/zsh/config/profile/profile/functions.zsh | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/users/price/dots/.config/zsh/config/profile/profile/aliases.zsh b/users/price/dots/.config/zsh/config/profile/profile/aliases.zsh index dfc58547..2627df83 100644 --- a/users/price/dots/.config/zsh/config/profile/profile/aliases.zsh +++ b/users/price/dots/.config/zsh/config/profile/profile/aliases.zsh @@ -67,11 +67,6 @@ alias p="wl-paste" fi - if ! command -v open >/dev/null 2>&1 && command -v xdg-open >/dev/null 2>&1; then - alias open="xdg-open" - alias o="xdg-open" - fi - if command -v systemctl >/dev/null 2>&1; then alias sysu="systemctl --user" alias sys="systemctl" @@ -108,4 +103,4 @@ if ! alias img >/dev/null 2>&1 && command -v swappy >/dev/null 2>&1; then alias img="swappy -f -" fi -} +} \ No newline at end of file diff --git a/users/price/dots/.config/zsh/config/profile/profile/functions.zsh b/users/price/dots/.config/zsh/config/profile/profile/functions.zsh index 28b1ce5d..eeed9a72 100644 --- a/users/price/dots/.config/zsh/config/profile/profile/functions.zsh +++ b/users/price/dots/.config/zsh/config/profile/profile/functions.zsh @@ -191,3 +191,9 @@ e() { eval "${EDITOR} ${@}" fi } + +# Open file with default program and detach +o() { + local in="${@}" + xdg-open "${@}" & disown +} \ No newline at end of file