Port the AGS widgets into the shell as plugins
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
dynamic_theme_dir="$HOME/.config/blob/themes/blob-dynamic"
|
||||
|
||||
if [ ! -f "$dynamic_theme_dir/colors.toml" ]; then
|
||||
echo "No dynamic theme yet. Pick a wallpaper first: blob-bg-menu" >&2
|
||||
echo "No dynamic theme yet. Pick a wallpaper first: blob-wallpaper-set --menu" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ case "${1:-toggle}" in
|
||||
select_mode all
|
||||
;;
|
||||
set)
|
||||
[ -n "$2" ] || { echo "Usage: blob-toggle-tablet-follow set <monitor|follow|all>" >&2; exit 1; }
|
||||
[ -n "$2" ] || { echo "Usage: blob-toggle-tablet set <monitor|follow|all>" >&2; exit 1; }
|
||||
select_mode "$2"
|
||||
;;
|
||||
status|--status)
|
||||
@@ -141,7 +141,7 @@ case "${1:-toggle}" in
|
||||
[ "$(selected_mode)" = "all" ] || start_daemon
|
||||
;;
|
||||
*)
|
||||
echo "Usage: blob-toggle-tablet-follow [toggle|on|off|set <monitor|follow|all>|status|monitors|autostart]" >&2
|
||||
echo "Usage: blob-toggle-tablet [toggle|on|off|set <monitor|follow|all>|status|monitors|autostart]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
+1
-14
@@ -19,21 +19,8 @@ mkdir -p "$THEME_DIR/backgrounds"
|
||||
echo "PATH=$PATH"
|
||||
} >> "$HOME/.cache/blob-wallpaper.log"
|
||||
|
||||
# Rows for blob-menu-select, as "<label><TAB><path>". The menu returns the
|
||||
# label and the subtext, so the full path comes back as a stable key.
|
||||
list_wallpaper_rows() {
|
||||
find "$WALLPAPER_DIR" -maxdepth 1 -type f \
|
||||
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.webp' \) \
|
||||
2>/dev/null | sort | while read -r background; do
|
||||
name=$(basename "$background")
|
||||
label=$(echo "${name%.*}" | sed -E 's/^[0-9]+//; s/^[-_]//; s/[-_]/ /g; s/(^| )([a-z])/\1\u\2/g')
|
||||
printf '%s\t%s\n' "$label" "$background"
|
||||
done
|
||||
}
|
||||
|
||||
if [ -z "$1" ] || [ "$1" = "--menu" ]; then
|
||||
selection=$(list_wallpaper_rows | blob-menu-select "Select Wallpaper" -- --width 800) || exit 0
|
||||
IMAGE_PATH=$(printf '%s' "$selection" | cut -f2)
|
||||
IMAGE_PATH=$(blob-menu-images --show-labels --filterable "$WALLPAPER_DIR") || exit 0
|
||||
if [ -z "$IMAGE_PATH" ] || [ ! -f "$IMAGE_PATH" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# blob:summary=Print a one-line weather summary for the quick settings card
|
||||
# blob:hidden=true
|
||||
|
||||
LOCATION="Great+Falls,VA"
|
||||
|
||||
icon=$(blob-weather-icon 2>/dev/null)
|
||||
weather=$(curl -fsS --max-time 4 "https://wttr.in/${LOCATION}?format=%l|%t|%w" 2>/dev/null | tr -d '\n')
|
||||
|
||||
if [[ -z $weather ]]; then
|
||||
echo "Weather unavailable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IFS='|' read -r place temperature wind <<< "$weather"
|
||||
place=${place%%,*}
|
||||
temperature=${temperature#+}
|
||||
|
||||
echo "$icon $place · Temp $temperature · Wind $wind"
|
||||
Reference in New Issue
Block a user