mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Add private browser key binding (#1324)
* Add private browser key binding * Include other Firefox-based browsers * Simplify implementation * Add migration to add the hotkey --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
exec setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$(xdg-settings get default-web-browser) 2>/dev/null | head -1) ${args[@]} $@
|
||||
default_browser=$(xdg-settings get default-web-browser)
|
||||
browser_exec=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$default_browser 2>/dev/null | head -1)
|
||||
|
||||
if [[ $browser_exec =~ (firefox|zen|librewolf) ]]; then
|
||||
private_flag="--private-window"
|
||||
else
|
||||
private_flag="--incognito"
|
||||
fi
|
||||
|
||||
exec setsid uwsm app -- "$browser_exec" "${@/--private/$private_flag}"
|
||||
|
||||
Reference in New Issue
Block a user