diff --git a/bin/omarchy-launch-browser b/bin/omarchy-launch-browser new file mode 100755 index 00000000..5b9f86c9 --- /dev/null +++ b/bin/omarchy-launch-browser @@ -0,0 +1,3 @@ +#!/bin/bash + +exec setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,/usr}/share/applications/$(xdg-settings get default-web-browser) 2>/dev/null | head -1) ${args[@]} $@ diff --git a/bin/omarchy-launch-webapp b/bin/omarchy-launch-webapp new file mode 100755 index 00000000..24f48e9c --- /dev/null +++ b/bin/omarchy-launch-webapp @@ -0,0 +1,10 @@ +#!/bin/bash + +browser=$(xdg-settings get default-web-browser) + +case $browser in +google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi*) ;; +*) browser="chromium.desktop" ;; +esac + +exec setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$1" "${@:2}" diff --git a/bin/omarchy-menu b/bin/omarchy-menu index ca52b819..0571b500 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -34,10 +34,6 @@ edit_in_nvim() { alacritty -e nvim "$1" } -open_web() { - setsid chromium --new-window --app="$1" & -} - install() { present_terminal "echo 'Installing $1...'; yay -Sy --noconfirm $2" } @@ -53,11 +49,11 @@ install_font() { show_learn_menu() { case $(menu "Learn" " Keybindings\n Omarchy\n Hyprland\n󰣇 Arch\n Neovim\n󱆃 Bash") in *Keybindings*) omarchy-menu-keybindings ;; - *Omarchy*) open_web "https://learn.omacom.io/2/the-omarchy-manual" ;; - *Hyprland*) open_web "https://wiki.hypr.land/" ;; - *Arch*) open_web "https://wiki.archlinux.org/title/Main_page" ;; - *Bash*) open_web "https://devhints.io/bash" ;; - *Neovim*) open_web "https://www.lazyvim.org/keymaps" ;; + *Omarchy*) omarchy-launch-webapp "https://learn.omacom.io/2/the-omarchy-manual" ;; + *Hyprland*) omarchy-launch-webapp "https://wiki.hypr.land/" ;; + *Arch*) omarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;; + *Bash*) omarchy-launch-webapp "https://devhints.io/bash" ;; + *Neovim*) omarchy-launch-webapp "https://www.lazyvim.org/keymaps" ;; *) show_main_menu ;; esac } diff --git a/bin/omarchy-webapp-install b/bin/omarchy-webapp-install index b54a881f..a75a3288 100755 --- a/bin/omarchy-webapp-install +++ b/bin/omarchy-webapp-install @@ -32,7 +32,7 @@ cat >"$DESKTOP_FILE" <