feat: cleanup aliases, arkenfox
This commit is contained in:
parent
308bdf15f7
commit
23d1e06c20
21 changed files with 2830 additions and 237 deletions
39
.local/bin/firefox
Executable file
39
.local/bin/firefox
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
sites=(
|
||||
'https://discord.com'
|
||||
'https://gmoker.com'
|
||||
'https://linkedin.com'
|
||||
'https://login.microsoftonline.com'
|
||||
'https://maby.dev'
|
||||
'https://web.whatsapp.com'
|
||||
)
|
||||
|
||||
function update() {
|
||||
local start='^/\*---- USER PREFERENCES ----\*/$'
|
||||
local end='^/\*---- END USER PREFERENCES ----\*/$'
|
||||
local af userpref
|
||||
|
||||
af="$(curl -L 'https://github.com/arkenfox/user.js/raw/refs/heads/master/user.js')"
|
||||
while read -r p; do
|
||||
userpref="$(sed -n "\@$start@,\@$end@p" "$ff/$p/user.js")"
|
||||
printf '%s\n\n%s\n' "$af" "$userpref" > "$ff/$p/user.js"
|
||||
done < <(awk -F= '/^Path=/{print $2}' "$ff/profiles.ini")
|
||||
}
|
||||
|
||||
ff="$HOME/.var/app/org.mozilla.firefox/.mozilla/firefox"
|
||||
|
||||
if [ "$1" == update ]; then
|
||||
update
|
||||
exit
|
||||
fi
|
||||
|
||||
profile="$ff/$(sed -n '/^\[Install/,/^Default=/s/.*=//p' "$ff/profiles.ini")"
|
||||
if ! fuser -s "$profile"; then
|
||||
for i in "${!sites[@]}"; do
|
||||
sq+="INSERT INTO moz_perms VALUES($i,'${sites[$i]}','cookie',1,0,0,0);"
|
||||
done
|
||||
sqlite3 "$profile/permissions.sqlite" <<< "DELETE FROM moz_perms; $sq"
|
||||
sqlite3 "$profile/places.sqlite" <<< "DELETE FROM moz_bookmarks;"
|
||||
fi
|
||||
org.mozilla.firefox "$@"
|
Loading…
Add table
Add a link
Reference in a new issue