mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Compare commits
1 Commits
a6be7daab2
...
664a093bb1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
664a093bb1 |
@ -15,7 +15,7 @@ fi
|
|||||||
case "$url" in
|
case "$url" in
|
||||||
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
|
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
|
||||||
setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;;
|
setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;;
|
||||||
*png|*jpg|*jpe|*jpeg|*gif|*webp)
|
*png|*jpg|*jpe|*jpeg|*gif)
|
||||||
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
||||||
*pdf|*cbz|*cbr)
|
*pdf|*cbz|*cbr)
|
||||||
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
||||||
|
|||||||
@ -13,18 +13,11 @@ bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
|
|||||||
dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
|
dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
|
||||||
zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
|
zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
|
||||||
|
|
||||||
# Give -s as parameter to make notifications silent.
|
|
||||||
while getopts "s" o; do case "${o}" in
|
|
||||||
s) silent='1' ;;
|
|
||||||
esac done
|
|
||||||
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
|
|
||||||
trueloc="$(readlink -f "$1")" &&
|
trueloc="$(readlink -f "$1")" &&
|
||||||
case "$(file --mime-type -b "$trueloc")" in
|
case "$(file --mime-type -b "$trueloc")" in
|
||||||
image/* ) ln -sf "$trueloc" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Changing wallpaper..." ;;
|
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
|
||||||
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
|
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
|
||||||
*) [ -z "$silent" ] && notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# If pywal is installed, use it.
|
# If pywal is installed, use it.
|
||||||
|
|||||||
@ -7,7 +7,7 @@ url="${WTTRURL:-wttr.in}"
|
|||||||
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
|
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
|
||||||
|
|
||||||
# Get a weather report from 'wttr.in' and save it locally.
|
# Get a weather report from 'wttr.in' and save it locally.
|
||||||
getforecast() { curl -sf "$url/$LOCATION" --output "$weatherreport"; }
|
getforecast() { curl -sf "$url/$LOCATION" > "$weatherreport"; }
|
||||||
|
|
||||||
# Forecast should be updated only once a day.
|
# Forecast should be updated only once a day.
|
||||||
checkforecast() {
|
checkforecast() {
|
||||||
|
|||||||
@ -17,17 +17,10 @@ case $BLOCK_BUTTON in
|
|||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Wifi
|
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
|
||||||
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
|
|
||||||
wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
||||||
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
|
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
|
||||||
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="📡 " || wifiicon="❌ "
|
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="📡 " || wifiicon="❌ "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ethernet
|
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"
|
||||||
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐 " || ethericon="❎ "
|
|
||||||
|
|
||||||
# TUN
|
|
||||||
[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon="🔒 "
|
|
||||||
|
|
||||||
printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon"
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ ipfile="$XDG_RUNTIME_DIR/iplocate"
|
|||||||
addr=$(cat "$ipfile" 2>/dev/null) && addr=$(geoiplookup "$addr" 2>/dev/null) && rm "$ipfile" ||
|
addr=$(cat "$ipfile" 2>/dev/null) && addr=$(geoiplookup "$addr" 2>/dev/null) && rm "$ipfile" ||
|
||||||
{ [ -z "$(pgrep 'sb-iplocate' | tail -n +3)" ] &&
|
{ [ -z "$(pgrep 'sb-iplocate' | tail -n +3)" ] &&
|
||||||
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
||||||
curl -sf ifconfig.me --output "$ipfile"; do sleep 60; done &&
|
curl -sf ifconfig.me > "$ipfile"; do sleep 60; done &&
|
||||||
pkill -RTMIN+"${1:-27}" "${STATUSBAR:-dwmblocks}" ) &
|
pkill -RTMIN+"${1:-27}" "${STATUSBAR:-dwmblocks}" ) &
|
||||||
echo; exit; }
|
echo; exit; }
|
||||||
name="${addr##*, }"
|
name="${addr##*, }"
|
||||||
|
|||||||
@ -7,7 +7,7 @@ moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
|
|||||||
[ -s "$moonfile" ] && [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
[ -s "$moonfile" ] && [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
||||||
{ [ -z "$(pgrep 'sb-moonphase' | tail -n +3)" ] &&
|
{ [ -z "$(pgrep 'sb-moonphase' | tail -n +3)" ] &&
|
||||||
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
||||||
curl -sf "wttr.in/?format=%m" --output "$moonfile"; do sleep 60; done &&
|
curl -sf "wttr.in/?format=%m" > "$moonfile"; do sleep 60; done &&
|
||||||
pkill -RTMIN+"${1:-17}" "${STATUSBAR:-dwmblocks}" ) &
|
pkill -RTMIN+"${1:-17}" "${STATUSBAR:-dwmblocks}" ) &
|
||||||
echo; exit; }
|
echo; exit; }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user