public
Last active

Use DBus calls to set the current user's wallpaper

  • Download Gist
set-wallpaper.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh
#
# Usage: set-wallpaper.sh <filename>
 
path=`dbus-send --system --print-reply=literally \
--dest=org.freedesktop.Accounts --type=method_call \
/org/freedesktop/Accounts \
org.freedesktop.Accounts.FindUserByName string:"$USER"`
 
dbus-send --system --print-reply \
--dest=org.freedesktop.Accounts \
--type=method_call $path \
org.freedesktop.Accounts.User.SetBackgroundFile \
string:"$1"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.