wallpaper tools update
This commit is contained in:
parent
cfc69a2728
commit
96cf3eb18d
@ -17,7 +17,7 @@ yad --title="About Mabox" --window-icon=mbcc \
|
||||
--pversion="$(lsb_release -rs) <i>${OSCODE}</i>" \
|
||||
--image=mbcc \
|
||||
--comments="${COMMENT}" \
|
||||
--copyright="Copyright 2016-2023, Daniel Napora <danieln@maboxlinux.org>" \
|
||||
--copyright="Copyright 2016-2024, Daniel Napora <danieln@maboxlinux.org>" \
|
||||
--license=GPL3 \
|
||||
--website="https://maboxlinux.org" \
|
||||
--website-label=maboxlinux.org \
|
||||
|
@ -41,7 +41,7 @@ checkwplist() {
|
||||
# If list does not exist or is empty
|
||||
if [[ ! -f $WALLPAPERS_LIST || $(wc -l <$WALLPAPERS_LIST) -lt 1 ]]; then
|
||||
# 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
|
||||
}
|
||||
|
||||
@ -59,11 +59,11 @@ choose() {
|
||||
case $LANG in
|
||||
pl*)
|
||||
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"
|
||||
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
|
||||
|
||||
@ -71,12 +71,12 @@ esac
|
||||
SCREENSIZE=$(wmctrl -d |grep "*" | awk -F' ' '{print $4}')
|
||||
W="${SCREENSIZE%x*}"
|
||||
H="${SCREENSIZE#*x}"
|
||||
FW=$((W/4))
|
||||
FH=$((H/4))
|
||||
FW=$((W/2))
|
||||
FH=$((H/2))
|
||||
X="40"
|
||||
Y=$((H-FH-40))
|
||||
notify-send.sh -u normal -i emblem-photos "$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'"
|
||||
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 Esc=quit" -g ${FW}x${FH}+${X}+${Y} ${wallpaper_dir} -A "${command} '%f'"
|
||||
}
|
||||
|
||||
slideshow() {
|
||||
@ -96,6 +96,11 @@ do
|
||||
done
|
||||
done
|
||||
}
|
||||
changedir(){
|
||||
wdir=${1/$HOME/\~}
|
||||
#notify-send.sh "dirrrrrrr" "$wdir"
|
||||
sd "wallpaper_dir=.*$" "wallpaper_dir=${wdir}" ${CONFIG_FILE}
|
||||
}
|
||||
|
||||
usage() {
|
||||
grep "^#:" $0 | while read DOC; do printf '%s\n' "${DOC###:}"; done
|
||||
@ -106,7 +111,8 @@ case "$1" in
|
||||
-o|one) one;;
|
||||
-c|choose) choose;;
|
||||
-h|--help) usage;;
|
||||
*) slideshow;;
|
||||
-s) slideshow;;
|
||||
-d|changedir) changedir "$2";;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@ -14,9 +14,9 @@ case $LANG in
|
||||
;;
|
||||
esac
|
||||
|
||||
mbwallpaper &
|
||||
mbwallpaper -s &
|
||||
mbwallpaper_pid=$!
|
||||
notify-send.sh -i emblem-photos "$TITLE" "$TEXT"
|
||||
yad --notification --image emblem-photos --text "$CLICK"
|
||||
kill $mbwallpaper_pid
|
||||
wait $mbwallpaper_pid
|
||||
kill -9 $mbwallpaper_pid
|
||||
#wait $mbwallpaper_pid
|
||||
|
@ -35,4 +35,5 @@ else
|
||||
xrdb "$HOME/.Xresources"
|
||||
fi
|
||||
|
||||
reload-gtk
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user