- Install xdotool
- Modify
launch_browser.sh
to use the right browser for the right workspace - Change the path to
launch_browser.sh
inlaunch-browser.desktop
- Copy
launch-browser.desktop
into~/.local/share/applications/
- Set this script as the default browser:
xdg-settings set default-web-browser launch-browser.desktop
Created
January 24, 2019 17:25
-
-
Save simonbru/721c11287f28a46d0c30ebed4c8fb562 to your computer and use it in GitHub Desktop.
Set a different default browser for every workspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Application | |
Name=Custom browser launcher | |
Exec=/absolute/path/to/launch_browser.sh %u | |
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CURRENT_WORKSPACE="$(xdotool get_desktop)" | |
case "$CURRENT_WORKSPACE" in | |
[0-1]) | |
# Workspaces 0 and 1 | |
browser=firefox | |
;; | |
*) | |
# Every other workspace | |
browser=chromium | |
;; | |
esac | |
exec "$browser" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment