wallpaper tools update

master
Daniel Napora 2024-09-10 06:55:24 +02:00
parent cfc69a2728
commit 96cf3eb18d
4 changed files with 19 additions and 12 deletions

View File

@ -17,7 +17,7 @@ yad --title="About Mabox" --window-icon=mbcc \
--pversion="$(lsb_release -rs) <i>${OSCODE}</i>" \ --pversion="$(lsb_release -rs) <i>${OSCODE}</i>" \
--image=mbcc \ --image=mbcc \
--comments="${COMMENT}" \ --comments="${COMMENT}" \
--copyright="Copyright 2016-2023, Daniel Napora <danieln@maboxlinux.org>" \ --copyright="Copyright 2016-2024, Daniel Napora <danieln@maboxlinux.org>" \
--license=GPL3 \ --license=GPL3 \
--website="https://maboxlinux.org" \ --website="https://maboxlinux.org" \
--website-label=maboxlinux.org \ --website-label=maboxlinux.org \

View File

@ -41,7 +41,7 @@ checkwplist() {
# If list does not exist or is empty # If list does not exist or is empty
if [[ ! -f $WALLPAPERS_LIST || $(wc -l <$WALLPAPERS_LIST) -lt 1 ]]; then if [[ ! -f $WALLPAPERS_LIST || $(wc -l <$WALLPAPERS_LIST) -lt 1 ]]; then
# Prepare list with wallpapers (only PNG and JPG) # Prepare list with wallpapers (only PNG and JPG)
ls -1 "$wallpaper_dir"/*{.jpg,.png} > "$WALLPAPERS_LIST" ls -1 "$wallpaper_dir"/*{.jpg,.png,.avif} > "$WALLPAPERS_LIST"
fi fi
} }
@ -59,11 +59,11 @@ choose() {
case $LANG in case $LANG in
pl*) pl*)
TITLE="Wybierz tapetę" TITLE="Wybierz tapetę"
TEXT="\nUżyj <b>strzałek</b> lub <b>kółka myszy</b> by nawigować.\n<b>Enter</b> by ustawić tapetę.\n<b>Esc</b> by wyjść." TEXT="\n<b>Strzałki</b> / <b>kółko myszy</b> poprzednia/następna.\n<b>Enter</b> by ustawić tapetę.\n<b>Esc</b> by wyjść."
;; ;;
*) *)
TITLE="Select Wallpaper" TITLE="Select Wallpaper"
TEXT="\nUse <b>Arrows</b> or <b>mousewheel</b> to navigate.\n<b>Enter</b> to set wallpaper.\n<b>Esc</b> to quit." TEXT="\n<b>Arrows</b> / <b>mousewheel</b> prev/next.\n<b>Enter</b> to set wallpaper.\n<b>Esc</b> to quit."
;; ;;
esac esac
@ -71,12 +71,12 @@ esac
SCREENSIZE=$(wmctrl -d |grep "*" | awk -F' ' '{print $4}') SCREENSIZE=$(wmctrl -d |grep "*" | awk -F' ' '{print $4}')
W="${SCREENSIZE%x*}" W="${SCREENSIZE%x*}"
H="${SCREENSIZE#*x}" H="${SCREENSIZE#*x}"
FW=$((W/4)) FW=$((W/2))
FH=$((H/4)) FH=$((H/2))
X="40" X="40"
Y=$((H-FH-40)) Y=$((H-FH-40))
notify-send.sh -u normal -i emblem-photos "$TITLE" "$TEXT" notify-send.sh -t 12000 -i ~/.config/mabox/wpicon.png "$TITLE" "$TEXT"
feh -B "#4D4D4D" -N -x --scale-down -E ${FH} -y ${FW} -^ "Enter=select, Arrows=next,prev" -g ${FW}x${FH}+${X}+${Y} ${wallpaper_dir} -A "${command} '%f'" feh -B "#4D4D4D" -N -x --scale-down -E ${FH} -y ${FW} -^ "Enter=select, Arrows=next/prev Esc=quit" -g ${FW}x${FH}+${X}+${Y} ${wallpaper_dir} -A "${command} '%f'"
} }
slideshow() { slideshow() {
@ -96,6 +96,11 @@ do
done done
done done
} }
changedir(){
wdir=${1/$HOME/\~}
#notify-send.sh "dirrrrrrr" "$wdir"
sd "wallpaper_dir=.*$" "wallpaper_dir=${wdir}" ${CONFIG_FILE}
}
usage() { usage() {
grep "^#:" $0 | while read DOC; do printf '%s\n' "${DOC###:}"; done grep "^#:" $0 | while read DOC; do printf '%s\n' "${DOC###:}"; done
@ -106,7 +111,8 @@ case "$1" in
-o|one) one;; -o|one) one;;
-c|choose) choose;; -c|choose) choose;;
-h|--help) usage;; -h|--help) usage;;
*) slideshow;; -s) slideshow;;
-d|changedir) changedir "$2";;
esac esac
exit 0 exit 0

View File

@ -14,9 +14,9 @@ case $LANG in
;; ;;
esac esac
mbwallpaper & mbwallpaper -s &
mbwallpaper_pid=$! mbwallpaper_pid=$!
notify-send.sh -i emblem-photos "$TITLE" "$TEXT" notify-send.sh -i emblem-photos "$TITLE" "$TEXT"
yad --notification --image emblem-photos --text "$CLICK" yad --notification --image emblem-photos --text "$CLICK"
kill $mbwallpaper_pid kill -9 $mbwallpaper_pid
wait $mbwallpaper_pid #wait $mbwallpaper_pid

View File

@ -35,4 +35,5 @@ else
xrdb "$HOME/.Xresources" xrdb "$HOME/.Xresources"
fi fi
reload-gtk