{"id":2147,"date":"2018-06-09T18:28:24","date_gmt":"2018-06-09T18:28:24","guid":{"rendered":"http:\/\/hauweele.net\/~gawen\/blog\/?p=2147"},"modified":"2018-06-10T23:02:53","modified_gmt":"2018-06-10T23:02:53","slug":"random-wallpapers","status":"publish","type":"post","link":"https:\/\/hauweele.net\/~gawen\/blog\/?p=2147","title":{"rendered":"Random wallpapers"},"content":{"rendered":"<p>If you ever want to randomly change your wallpapers every few minutes, hours or whatever, I just made a script to do just that. You can find it <a href=\"https:\/\/github.com\/gawen947\/scripts\/blob\/master\/lib\/wp-random.sh\">here<\/a>.<\/p>\n<p>This script will at regular interval select a random file within the specified directory and use the specified command to use it as a wallpaper. For example if you want to change your wallpaper every 10 minutes with a picture in <code>~\/Pictures\/wallpapers<\/code>.<\/p>\n<pre>wp-random.sh 600 ~\/Pictures\/wallpapers\/ feh --bg-scale<\/pre>\n<p>Note that we use <i>feh<\/i> here to setup the wallpaper, but you can use any command you like.<\/p>\n<p>You can use SIGUSR1 to redraw the current wallpaper (for example if you just enabled the VGA output and the background needs a redraw), or SIGUSR2 to force the selection of another wallpaper:<\/p>\n<p><code><br \/>\nWP_RANDOM_PID=$(cat \/tmp\/wp-random_$DISPLAY.pid)<\/p>\n<p># Redraw current wallpaper<br \/>\nkill -SIGUSR1 \"$WP_RANDOM_PID\"<\/p>\n<p># Select another wallpaper<br \/>\nkill -SIGUSR2 \"$WP_RANDOM_PID\"<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you ever want to randomly change your wallpapers every few minutes, hours or whatever, I just made a script to do just that. You can find it here. This script will at regular interval select a random file within &hellip; <a href=\"https:\/\/hauweele.net\/~gawen\/blog\/?p=2147\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[330,40,1018,1017],"class_list":["post-2147","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-random","tag-script","tag-select","tag-wallpaper"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2147"}],"version-history":[{"count":0,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2147\/revisions"}],"wp:attachment":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}