feat: cleanup aliases, arkenfox
This commit is contained in:
parent
308bdf15f7
commit
23d1e06c20
21 changed files with 2830 additions and 237 deletions
|
|
@ -21,7 +21,7 @@ elif [[ "$q" == *://* ]]; then
|
|||
fi
|
||||
exec xdg-open "$url"
|
||||
fi
|
||||
if [[ "$q" == *.* ]] && [[ "$q" != *' '* ]]; then
|
||||
if [[ "$q" =~ ^[^[:space:]]+(\.[^[:space:]]+)+$ ]]; then
|
||||
exec $BROWSER "$q"
|
||||
fi
|
||||
exec $BROWSER "https://searx.gmoker.com/search?q=$(jq -Rr '@uri' <<< "$q")"
|
||||
|
|
|
|||
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 "$@"
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
ISO="$1"
|
||||
DISK="$HOME/${ISO%.*}.qcow2"
|
||||
MAXMEM="$(free -g | awk '/Mem:/{print $2 - 2 * $3}')G"
|
||||
MAXMEM="$(free -g | awk '/^Mem:/{print $6 / 2}')G"
|
||||
OVMF_CODE=/usr/share/edk2/x64/OVMF_CODE.4m.fd
|
||||
OVMF_VARS=/tmp/OVMF_VARS.4m.fd
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ set -x
|
|||
if [ -f "$OVMF_VARS" ]; then
|
||||
cp -f /usr/share/edk2/x64/OVMF_VARS.4m.fd "$OVMF_VARS"
|
||||
fi
|
||||
if [ -f "$DISK" ]; then
|
||||
if ! [ -f "$DISK" ]; then
|
||||
qemu-img create -f qcow2 "$DISK" 20G
|
||||
fi
|
||||
qemu-system-x86_64 \
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ function update_vol() {
|
|||
if [ "$CUR" -lt 0 ]; then
|
||||
CUR=0
|
||||
elif [ "$CUR" -gt 300 ]; then
|
||||
CUR=150
|
||||
CUR=300
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue