Skip to content

Commit

Permalink
firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
juliekoubova committed Jan 19, 2025
1 parent d0d1619 commit 381a9b6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions .chezmoidata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cza = "chezmoi apply"
cze = "chezmoi edit"
czu = "chezmoi update"
ff = "firefox"
lg = "lazygit"

[gitaliases]
ca = "commit --amend --no-edit"
Expand Down
22 changes: 22 additions & 0 deletions dot_local/exact_bin/executable_firefox
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

has() {
command -v "$1" >/dev/null
}

has_flatpak() {
has flatpak || return 1
flatpak info "$1" >/dev/null 2>&1
}

_ref=org.mozilla.firefox
if has_flatpak $_ref; then
_cmd="flatpak run $_ref"
elif has firefox; then
_cmd='firefox'
else
echo firefox not found, try \`flatpak install $_ref\` >&2
exit 1
fi

exec nohup $_cmd "$@" >/dev/null 2>&1 &
3 changes: 1 addition & 2 deletions dot_shrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if uname -r | grep -q microsoft; then
fi

has() {
command -v $1 > /dev/null
command -v "$1" >/dev/null
}

source_if_has() {
Expand Down Expand Up @@ -241,4 +241,3 @@ gco() {
alias gres='git_reset'
alias ghard='git_reset --hard'
alias gsoft='git_reset --soft'
alias lg=lazygit

0 comments on commit 381a9b6

Please sign in to comment.