From a33954c59fe9d8fe889fab077b6612cc029ac3fc Mon Sep 17 00:00:00 2001 From: davidpkj Date: Wed, 24 Jul 2024 16:37:37 +0200 Subject: Mega Update: FW16 Space Rice - Add symlinks to dotfiles in config dir (links to links) - Switch from neofetch to fastfetch - Add htop - Add dynamic colors (polybar, xmonad, qutebrowser) - Update color management (pywal & friends, alacritty, xorg) - Minor updates to other files (quality of life) --- scripts/.local/bin/personal/hdqwallsdownload | 34 ----------------------- scripts/.local/bin/personal/hdqwd | 40 ++++++++++++++++++++++++++++ scripts/.local/bin/personal/rica | 13 ++++----- scripts/.local/bin/personal/syshealth | 21 ++++----------- scripts/.local/bin/personal/wally | 8 ++++-- 5 files changed, 58 insertions(+), 58 deletions(-) delete mode 100755 scripts/.local/bin/personal/hdqwallsdownload create mode 100755 scripts/.local/bin/personal/hdqwd (limited to 'scripts/.local/bin') diff --git a/scripts/.local/bin/personal/hdqwallsdownload b/scripts/.local/bin/personal/hdqwallsdownload deleted file mode 100755 index 6a203af..0000000 --- a/scripts/.local/bin/personal/hdqwallsdownload +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# A utility to download all images from a specific website give the exact url - -# https://hdqwalls.com/2880x1800/anime-girl-wallpapers/page/2 -# https://hdqwalls.com/search?q=Genshin+Impact&page=2 - -FILE="/tmp/wallpaperhtml" - -download() { - curl -s "$1" > "$FILE" - - IMAGES=$(cat "$FILE" | pup img.thumbnail | grep -o '"http[^"]\+"' | sed 's/\/wallpapers\/thumb/\/download/g' | sed 's/.jpg"$/-2560x1600.jpg/g' | sed 's/"//g') - COUNTER=0 - - for IMG in $IMAGES; do - let COUNTER++ - NAME="$(basename $IMG)" - - echo "[ Download ] ($COUNTER) $NAME" - curl -s "$IMG" > "$NAME" - sleep 2 - done - - echo -e "\nFinished!" -} - -if [[ -z "$1" ]]; then - echo "[ Error ] Please provide a URL" - exit 1 -fi - -download "$1" - diff --git a/scripts/.local/bin/personal/hdqwd b/scripts/.local/bin/personal/hdqwd new file mode 100755 index 0000000..0d7f709 --- /dev/null +++ b/scripts/.local/bin/personal/hdqwd @@ -0,0 +1,40 @@ +#!/bin/bash + +# A utility to download all images from a specific website give the exact url + +# https://hdqwalls.com/2880x1800/anime-girl-wallpapers/page/2 +# https://hdqwalls.com/search?q=Genshin+Impact&page=2 + +FILE="/tmp/wallpaperhtml" + +download() { + curl -s "$1" > "$FILE" + + IMAGES=$(cat "$FILE" | pup img.thumbnail | grep -o '"http[^"]\+"' | sed 's/\/wallpapers\/thumb/\/download/g' | sed 's/.jpg"$/-2560x1600.jpg/g' | sed 's/"//g') + COUNTER=0 + + for IMG in $IMAGES; do + let COUNTER++ + NAME="$(basename $IMG)" + + echo "[ Download ] ($COUNTER) $NAME" + curl -s "$IMG" > "$NAME" + sleep 2 + done + + echo -e "\nFinished!" +} + +if [[ -z "$1" ]]; then + echo "[ Error ] Please provide a URL" + exit 1 +fi + +if [[ "$1" = "s" ]]; then + IMAGE=$(curl -s "$2" | pup img.d_img_holder | grep -o '"http[^"]\+"' | sed 's/\/wallpapers\/bthumb/\/download/g' | sed 's/.jpg"$/-2560x1600.jpg/g' | sed 's/"//g') + NAME="$(date +"%s")" + curl -s "$IMAGE" > "$NAME.jpg" +else + download "$1" +fi + diff --git a/scripts/.local/bin/personal/rica b/scripts/.local/bin/personal/rica index fe9a2ff..81c0575 100755 --- a/scripts/.local/bin/personal/rica +++ b/scripts/.local/bin/personal/rica @@ -6,13 +6,14 @@ cache="$HOME/.cache/wal" config="$HOME/.config" -relevant=("dunst/dunstrc" "zathura/zathurarc" "flameshot/flameshot.ini") - xrdb -merge "$HOME/.cache/wal/colors.Xresources" xrdb -merge "$HOME/.Xresources" -for file in ${relevant[@]}; do - cp "$cache/$(basename $file)" "$config/$file" -done +# relevant=("dunst/dunstrc" "zathura/zathurarc" "flameshot/flameshot.ini") +# relevant=() +# for file in ${relevant[@]}; do + # cp "$cache/$(basename $file)" "$config/$file" +# done -killall dunst +pkill dunst; dunst & +pkill polybar; polybar & diff --git a/scripts/.local/bin/personal/syshealth b/scripts/.local/bin/personal/syshealth index 5c7ebe5..6320056 100755 --- a/scripts/.local/bin/personal/syshealth +++ b/scripts/.local/bin/personal/syshealth @@ -5,8 +5,10 @@ export XDG_RUNTIME_DIR="/run/user/$(id -u)" export DISPLAY=":0" +NOTIFIER="/usr/bin/notify-send -u critical " +# NOTIFIER="/usr/local/bin/herbe " + acpi_report="$(acpi | grep -v unavailable | head -n 1)" -sensors_report="$(sensors | grep "Package id 0:")" # Battery charge check local_percent="$(echo $acpi_report | awk '{print $4}')" @@ -15,25 +17,12 @@ local_time="$(echo $acpi_report | awk '{print $5}')" battery_message=("Warning:" "Battery VOLTAGE critical") temperature_message=("Warning:" "Core TEMPERATURE critical") + $NOTIFIER "${battery_message[0]} ${battery_message[1]}" & if ((${local_percent::-2} <= 15)); then if [[ "${local_state::-1}" == "Discharging" ]]; then - /usr/bin/notify-send -u critical " ${battery_message[0]} ${battery_message[1]}" & - # espeak "${battery_message[0]}${battery_message[1]}" - fi -elif ((${local_percent::-2} >= 90)); then - if [[ "${local_state::-1}" == "Charging" ]]; then - /usr/bin/notify-send -u critical " ${battery_message[0]} ${battery_message[1]}" & + $NOTIFIER " ${battery_message[0]} ${battery_message[1]}" & # espeak "${battery_message[0]}${battery_message[1]}" fi fi -# Core temperature check -local_temp="$(echo $sensors_report | awk '{print $4}' | sed 's/+//g')" -local_temp_high="$(echo $sensors_report | awk '{print $7}' | sed 's/+//g')" - -if ((${local_temp::-4} >= 90)); then - /usr/bin/notify-send -u critical " ${temperature_message[0]} ${temperature_message[1]}" & - # espeak "${temperature_message[0]}${temperature_message[1]}" -fi - diff --git a/scripts/.local/bin/personal/wally b/scripts/.local/bin/personal/wally index b733873..9b13bcc 100755 --- a/scripts/.local/bin/personal/wally +++ b/scripts/.local/bin/personal/wally @@ -43,8 +43,12 @@ setTheme() { if [[ $1 == *.json ]]; then wal --theme "$1" - rica - xdotool key Super_L+r + + walppr="$(cat "$1" | jq .wallpaper | sed 's/"//g')" + cp "$walppr" "$cachedWallpaperFile" + + rica "$1" + xdotool key Super_L+Shift_L+r exit 0 fi -- cgit v1.2.3