Skip to content

Commit

Permalink
feat(zsh): default browser functions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroSuero committed Mar 28, 2024
1 parent 9a90248 commit de0547a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions roles/zsh/files/os/Archlinux/os_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions roles/zsh/files/os/Ubuntu/os_function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit de0547a

Please sign in to comment.