add a simple launcher for brave

This commit is contained in:
stupidcomputer 2024-11-18 19:01:28 -06:00
parent 8860a7a4d9
commit dd5307d47b
2 changed files with 20 additions and 1 deletions

View File

@ -15,6 +15,10 @@ super + d
ctrl + b; d ctrl + b; d
tmenu_run tmenu_run
# launch brave with profile selection
super + b
brave-launcher
# kill sxhkd with USR1 and restart bspwm # kill sxhkd with USR1 and restart bspwm
super + r super + r
pkill -USR1 -x sxhkd; \ pkill -USR1 -x sxhkd; \
@ -94,7 +98,7 @@ shift + Insert
special_ins special_ins
# phone specific -- send the escape key since we can't use it # phone specific -- send the escape key since we can't use it
super + b; [ ctrl + b; [
xdotool key Escape xdotool key Escape
# mouse keybindings on the keypad # mouse keybindings on the keypad

15
builds/utils/brave-launcher Executable file
View File

@ -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