cleanup
This commit is contained in:
parent
304e61574e
commit
7a2f5d5930
24 changed files with 123 additions and 63 deletions
9
.local/bin/chromium
Executable file
9
.local/bin/chromium
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
rmchrom() {
|
||||
rm -rf {"$XDG_CONFIG_HOME","$XDG_CACHE_HOME"}/chromium
|
||||
}
|
||||
|
||||
trap rmchrom EXIT
|
||||
rmchrom
|
||||
/usr/bin/chromium
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
sites=(
|
||||
'https://.login.microsoftonline.com'
|
||||
'https://discord.com'
|
||||
'https://gmoker.com'
|
||||
'https://maby.dev'
|
||||
|
|
|
@ -72,8 +72,8 @@ _tz() {
|
|||
mapfile -t if < <(ip -j route show default | jq -r '.[] | .prefsrc, .dev')
|
||||
if ! [ -s "$f" ] || [ "${if[0]}" != "$(< ip)" ]; then
|
||||
echo "${if[0]}" > ip
|
||||
if j="$(curl -s 'https://ipapi.co/json')"; then
|
||||
jq -r '.timezone, "\(.latitude):\(.longitude)"' <<< "$j" > "$f"
|
||||
if j="$(curl -s 'https://api.ipbase.com/v2/info')"; then
|
||||
jq -r '.[] | .timezone.id, (.location |"\(.latitude):\(.longitude)" )' <<< "$j" > "$f"
|
||||
head -1 "$f"
|
||||
fi
|
||||
else
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
DMENU=/usr/local/bin/dmenu
|
||||
DMENU=dmenu
|
||||
SUDO=pkexec
|
||||
if tty -s; then
|
||||
DMENU=fzf
|
||||
SUDO=sudo
|
||||
fi
|
||||
|
||||
if [ "$EUID" = 0 ]; then
|
||||
SUDO=
|
||||
fi
|
||||
|
||||
d="$(mktemp -d)"
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -rf '$d'" EXIT
|
||||
|
@ -29,6 +33,6 @@ if [ "$1" != off ]; then
|
|||
fi
|
||||
|
||||
(inotifywait -e close_write "$d/1"; "$DMENU" < "$d/1" > "$d/2") &
|
||||
"$SUDO" bash -c "${CMD[*]/%/;}"
|
||||
$SUDO bash -c "${CMD[*]/%/;}"
|
||||
|
||||
touch "$XDG_RUNTIME_DIR/sbar/vpn"
|
||||
touch "${XDG_RUNTIME_DIR:-/run/user/1000}/sbar/vpn"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue