- download the backgrounds (e.g. https://files.rb.gd/mojave_dynamic.zip, from https://www.reddit.com/r/MacOS/comments/8oz5h5/all_16_full_resolution_macos_mojave_dynamic/)
- put the scripts in the folder of the background images
- configure your cronjob, e.g.:
0 * * * * /home/user/path_to_your_wallpaperfolder/change_wallpaper.sh
Created
September 28, 2018 12:44
-
-
Save pstaender/a5abb7d8cb6c5283b17479e044bfc57d to your computer and use it in GitHub Desktop.
Change wallpaper in Linux Mint (cinnamon) according to daytime with MacOS Mojave wallpapers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wallpaper=`ruby get_wallpaper_url.rb` | |
# https://stackoverflow.com/questions/10374520/gsettings-with-cron#19666729 | |
PID=$(pgrep -fo cinnamon-session) | |
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) | |
gsettings set org.cinnamon.desktop.background picture-uri "file://${wallpaper}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
hour_offest = 5 | |
hour = Time.new.hour - hour_offset | |
hour = 24 + hour if hour < 0 | |
wallpaper_number = hour.to_f / 1.5 | |
picture = "#{__dir__}/mojave_dynamic_#{wallpaper_number.ceil}.jpeg" | |
puts picture |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment