Skip to content

Instantly share code, notes, and snippets.

View Tuxliri's full-sized avatar
🏠
Working from home

Davide Iafrate Tuxliri

🏠
Working from home
View GitHub Profile
@Tuxliri
Tuxliri / choosy
Last active January 6, 2023 17:12 — 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
microsoft-edge "$URL" & disown
elif [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-is.txt)\)$) ]]; then
microsoft-edge "$URL" & disown