Po Lu writes: > Thierry Volpiatto writes: > >> Po Lu writes: >> >>> Thierry Volpiatto writes: >>> >>>> Here the command fails if you specify the workspace, it works only with >>>> "worspace0". >>> >>> But that's because you only have workspace 1 displayed, right? >> >> No, if emacs is on workspace0 and I use: >> "/backdrop/screen0/monitoreDP/workspace0/last-image" >> wallpaper is modified as expected. >> >> Then if emacs is on workspace2 and I use: >> "/backdrop/screen0/monitoreDP/workspace2/last-image" >> Command exit with 0 status but wallpaper is not modified, but if I use: >> "/backdrop/screen0/monitoreDP/workspace0/last-image" again (always from >> workspace2), wallpaper is modified as expected. >> >> I can verify this with this command which monitor the desktop change: >> >> xfconf-query -c xfce4-desktop -m >> >> => Commencer à surveiller le canal « xfce4-desktop » : >> >> then I go to workspace4, modify wallpaper with mouse and the usual xfce >> interface for this, go back in workspace1 an look at output: >> I have now: >> >> Commencer à surveiller le canal « xfce4-desktop » : >> >> définir: /backdrop/screen0/monitoreDP/workspace0/last-image >> >> unfortunately this command is interactive :-( > > But here is how Thunar, the XFCE file manager, sets the backdrop: > > image_path_prop = g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d/last-image", screen_nr, monitor_name, workspace); > image_style_prop = g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d/image-style", screen_nr, monitor_name, workspace); > > where `workspace' is: > > GdkWindow *root; > gulong bytes_after_ret = 0; > gulong nitems_ret = 0; > guint *prop_ret = NULL; > Atom _NET_CURRENT_DESKTOP; > Atom _WIN_WORKSPACE; > Atom type_ret = None; > gint format_ret; > gint ws_num = 0; My command starts working with workspace specified when I use an async process (start-process) instead of call-process, so with wallpaper-set it should work as expected. However the functions to extract infos about screen, monitor and workspace are working only when (display-graphic-p) is non nil. -- Thierry