Skip to content

Instantly share code, notes, and snippets.

View iul1an's full-sized avatar

Iulian Mandache iul1an

View GitHub Profile
@iul1an
iul1an / choosy
Created March 19, 2023 19:20 — forked from cesarolea/choosy
Open browser based off of certain rules (like choosy for macOS)
#!/bin/bash
URL=$1
DOMAIN=$(echo "$URL" | awk -F[/:] '{print $4}')
## Domain starts with
if [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-start.txt)\)$) ]]; then
chromium-browser "$URL" & disown
elif [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-is.txt)\)$) ]]; then
firefox "$URL" & disown