mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-06 04:20:23 +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}"
|
||||
|
||||
@@ -5,6 +5,7 @@ $browser = omarchy-launch-browser
|
||||
bindd = SUPER, return, Terminal, exec, $terminal --working-directory="$(omarchy-cmd-terminal-cwd)"
|
||||
bindd = SUPER, F, File manager, exec, uwsm app -- nautilus --new-window
|
||||
bindd = SUPER, B, Browser, exec, $browser
|
||||
bindd = SUPER SHIFT, B, Browser (private), exec, $browser --private
|
||||
bindd = SUPER, M, Music, exec, uwsm app -- spotify
|
||||
bindd = SUPER, N, Neovim, exec, $terminal -e nvim
|
||||
bindd = SUPER, T, Activity, exec, $terminal -e btop
|
||||
|
||||
6
migrations/1757866485.sh
Normal file
6
migrations/1757866485.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
echo "Add SUPER + SHIFT + B to start browser in private mode"
|
||||
|
||||
if [[ -f ~/.config/hypr/bindings.conf ]] && grep -q "SUPER, B, Browser, exec" ~/.config/hypr/bindings.conf; then
|
||||
sed -i '/^bindd = SUPER, B, Browser, exec, \$browser$/a\
|
||||
bindd = SUPER SHIFT, B, Browser (private), exec, $browser --private' ~/.config/hypr/bindings.conf
|
||||
fi
|
||||
Reference in New Issue
Block a user