From dd5307d47b8587f446039b9b00b969d87a909d91 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Mon, 18 Nov 2024 19:01:28 -0600 Subject: [PATCH] add a simple launcher for brave --- .config/sxhkd/sxhkdrc | 6 +++++- builds/utils/brave-launcher | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 builds/utils/brave-launcher diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index ba122a4..c04cc8c 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -15,6 +15,10 @@ super + d ctrl + b; d tmenu_run +# launch brave with profile selection +super + b + brave-launcher + # kill sxhkd with USR1 and restart bspwm super + r pkill -USR1 -x sxhkd; \ @@ -94,7 +98,7 @@ shift + Insert special_ins # phone specific -- send the escape key since we can't use it -super + b; [ +ctrl + b; [ xdotool key Escape # mouse keybindings on the keypad diff --git a/builds/utils/brave-launcher b/builds/utils/brave-launcher new file mode 100755 index 0000000..f1793cf --- /dev/null +++ b/builds/utils/brave-launcher @@ -0,0 +1,15 @@ +#!/bin/sh + +profiles=$(ls ~/.config/BraveSoftware/Brave-Browser/ | grep Profile) +choices="" + +IFS=" +" +for profile in $profiles; do + name_of_profile=$(cat ~/.config/BraveSoftware/Brave-Browser/$profile/Preferences | jq .profile.name -r) + choices=$(printf "%s:%s|%s" "$name_of_profile" "$profile" "$choices") +done + +choice=$(echo $choices | sed 's/|/\n/g' | tmenu) +profile_name=$(echo $choice | awk -F':' '{print $2}') +brave --profile-directory="$profile_name" & disown