📜 ⬆️ ⬇️

himawari8 wallpaper for linux

I recently read about the script on PowerShell, which put pictures from the satellite wallpaper on the desktop. Googling, did not find implementation under linux - which is lower.



Possible problems


On a trifle: the server does not always load images directly completely new, so there is a chance to stumble upon emptiness. Therefore, in the script I get the pictures of the last day: nowday=$(date +%d -d -1day)

UPD: fixed, the problem was in the unconfigured time zone.
')
The server loads a new pak of photos every ten minutes and requires rounding up to tens. therefore

nowtime=$(date +%H%M | sed -r 's/.$//')
nowtime=$nowtime"000"


Special problems here in one place: in the installation of wallpaper on your desktop.

For xfce4


General syntax


xfconf-query -c xfce4-desktop -p %desktoppath% -s %image%

Getting parameters


You open /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml

Suppose there is something like:

 <channel name="xfce4-desktop" version="1.0"> <property name="backdrop" type="empty"> <property name="screen0" type="empty"> <property name="monitorVGA-0" type="empty"> <property name="workspace0" type="empty"> <property name="color-style" type="int" value="2"/> <property name="image-style" type="int" value="5"/> <property name="last-image" type="string" value="/home/user/pictures/my_standart_wallpaper.png"/> </property> </property> </property> </property> </channel> 

So, instead of %desktoppath% you must specify /backdrop/screen0/monitorVGA-0/workspace0/last-image

Well, %image% is the full path to the new image file.

Other X-systems


?

Code


Bash code
Thanks for the Self_Perfection and SleepingLion fixes .

github
 # This script get images from himawari8 sputnik, combine it with imagemagick and set result as wallpaper. Works with xfce, gnome, i3 # ./earthwallpaper <resolution> # <resolution> can be 4, 8, 16 or 20 : bigger number - better resolution. Default is 4 # Deps: imagemagick wget # github: https://github.com/snowinmars/scripts/blob/master/earth_wallpaper.sh # e-mail: marcor@yandex.ru #!/bin/bash delay=900 # seconds while true do echo $DESKTOP_SESSION width=550 numblocks=${1:-4} xsystem=${2:-xfce4} level=$numblocks'd' #Level can be 4d, 8d, 16d, 20d timestamp=$(date -d -4hours +%Y/%m/%d/%H%M | sed -r 's/.$/000/') # delay is for timezone username=$(getent passwd $UID | sed -e 's/\:.*//') workdir="/home/"$username"/.earthwallpaper" if [ ! -d $workdir ]; then mkdir -p $workdir fi cd $workdir site="http://himawari8-dl.nict.go.jp/himawari8/img/D531106" url="$site/$level/$width/$timestamp" for (( i=0; i<=$numblocks-1; ++i)) do for (( j=0; j<=$numblocks-1; ++j)) do sourceurl="$url"$(printf '_%d_%d.png' "$i" "$j") #sourceurl="$url$dash$i$dash$j.png" #desturl="$url$dash" desturl="piece_"$numblocks"_"$(printf '%02d_%02d.png' "$i" "$j") echo Downloading $sourceurl to $desturl wget $sourceurl -O $workdir/$desturl done convert -append piece_$numblocks*_*.png img_$numblocks"_"$(printf '%02d' "$i").png rm piece_$numblocks*_*.png done convert +append img_$numblocks"_"*.png "out_"$numblocks".png" rm img_$numblocks"_"*.png # if it isn't working - write me on e-mail case $DESKTOP_SESSION in "xfce") xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorVGA-0/workspace0/last-image -s $workdir/out_$numblocks.png ;; "gnome") gconftool-2 -t str -s /desktop/gnome/background/picture_filename $workdir/out_$numblocks.png ;; "i3") feh --bg-scale ~/Pictures/image.jpg # set echo "exec feh --bg-scale ~/Pictures/image.jpg" >> ~/.config/i3/config # set for autoload ;; *) echo Unknown graphical system, can\'t set wallpaper. You can do it manually from $workdir ;; esac echo Done, waiting $delay seconds sleep $delay done 


The similar


I didn’t get in touch with the authors, but I think they weren’t just loading it into open access.

Source: https://habr.com/ru/post/276845/


All Articles