From ca62db64baa2b9a8cffcd57155ae7744f4301065 Mon Sep 17 00:00:00 2001 From: zachir Date: Tue, 15 Jul 2025 21:04:55 -0500 Subject: Add brave-profiles script --- brave-profiles | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 brave-profiles (limited to 'brave-profiles') diff --git a/brave-profiles b/brave-profiles new file mode 100644 index 0000000..31f805a --- /dev/null +++ b/brave-profiles @@ -0,0 +1,78 @@ +#!/bin/bash +## +#***************************************************************** +# brave-profiles - equk.co.uk +#***************************************************************** +# +# This script was created to simplify and standardize brave configuration +# across profiles. +# +## +# equk 2018 - equk.co.uk +## +# License: MIT (LICENSE file should be included with script) + +## variables + +profile_name=${0##*/} +profile_folder="$HOME/.brave_profiles/$profile_name" +brave_bin="/usr/bin/brave" +brave_flags="--ssl-version-min=tls1 --enable-smooth-scrolling --enable-tab-audio-muting" + +# color / colour +blue="\033[1;34m" +green="\033[1;32m" +red="\033[1;31m" +bold="\033[1;37m" +reset="\033[0m" + +# CLI feedback +cl_error="[$red ERROR $reset]" +gplus="[$green+$reset]" +bplus="[$blue+$reset]" + +# Check if running within X Window Session +if [ "x$DISPLAY" = "x" ]; then + echo "must be run within the X Window System." >&2 + echo "Exiting." >&2 + exit 1 +fi + +# Check for root ( quit if root :x ) +if [ $(whoami) = "root" ]; then + echo -e "$cl_error do not run this script as root" + exit 1 +fi + +# Check if user namespaces is enabled (for sandbox) +# Note: this is to enforce user namespaces for sandbox +if [[ ! (-r /proc/sys/kernel/unprivileged_userns_clone && $( Date: Tue, 15 Jul 2025 21:06:01 -0500 Subject: Make brave-profiles executable --- brave-profiles | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 brave-profiles (limited to 'brave-profiles') diff --git a/brave-profiles b/brave-profiles old mode 100644 new mode 100755 -- cgit v1.2.3 From 45b2f55aea9200ce7570b39a68de8287fdd72d94 Mon Sep 17 00:00:00 2001 From: zachir Date: Tue, 15 Jul 2025 21:15:37 -0500 Subject: Make brave-profiles XDG compliant; add URL and profile support --- brave-profiles | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'brave-profiles') diff --git a/brave-profiles b/brave-profiles index 31f805a..a034266 100755 --- a/brave-profiles +++ b/brave-profiles @@ -11,11 +11,12 @@ # equk 2018 - equk.co.uk ## # License: MIT (LICENSE file should be included with script) +# Tweaked by Zach Smith ## variables -profile_name=${0##*/} -profile_folder="$HOME/.brave_profiles/$profile_name" +profile_name=$1 +profile_folder="$HOME/.local/share/brave_profiles/$profile_name" brave_bin="/usr/bin/brave" brave_flags="--ssl-version-min=tls1 --enable-smooth-scrolling --enable-tab-audio-muting" @@ -74,5 +75,5 @@ if [[ -r $profile_folder/Default/Preferences ]]; then fi # Execute brave -exec $brave_bin "$@" --user-data-dir=$profile_folder $brave_flags +exec $brave_bin $2 --user-data-dir=$profile_folder $brave_flags -- cgit v1.2.3