From de0547a6424da58fdd8e4d118f14e58a25468426 Mon Sep 17 00:00:00 2001 From: AlejandroSuero Date: Thu, 28 Mar 2024 19:23:45 +0100 Subject: [PATCH] feat(zsh): default browser functions --- roles/zsh/files/os/Archlinux/os_functions.sh | 6 +++--- roles/zsh/files/os/Ubuntu/os_function.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/roles/zsh/files/os/Archlinux/os_functions.sh b/roles/zsh/files/os/Archlinux/os_functions.sh index 047e973..5f96bdb 100644 --- a/roles/zsh/files/os/Archlinux/os_functions.sh +++ b/roles/zsh/files/os/Archlinux/os_functions.sh @@ -11,12 +11,12 @@ _paste() { } _get_default_browser() { - default_browser=$(xdg-settings get default-web-browser) - tr ".desktop" "" < default_browser + default_browser=$(xdg-settings get default-web-browser | tr ".desktop" "") + echo default_browser } _open_default_browser() { - "$(_get_default_browser)" 2>dev/null + "$(_get_default_browser)" 2> /dev/null } alias c="_copy" diff --git a/roles/zsh/files/os/Ubuntu/os_function.sh b/roles/zsh/files/os/Ubuntu/os_function.sh index d2e12e6..7f8807a 100644 --- a/roles/zsh/files/os/Ubuntu/os_function.sh +++ b/roles/zsh/files/os/Ubuntu/os_function.sh @@ -11,6 +11,15 @@ _paste() { xclip -selection clipboard -o } +_get_default_browser() { + default_browser=$(xdg-settings get default-web-browser | tr ".desktop" "") + echo default_browser +} + +_open_default_browser() { + "$(_get_default_browser)" 2> /dev/null +} + alias c="_copy" alias v="_paste"