How to set different image for wallpaper on each monitor with antiX

Forum Forums General Software How to set different image for wallpaper on each monitor with antiX

Tagged: 

  • This topic has 18 replies, 6 voices, and was last updated Mar 22-2:42 am by Brian Masinick.
Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #55768
    Member
    seaken64

      antiX uses a script to set the wallpaper when you sign in to a new session based on a user choice made with the Control Centre Choose Wallpaper tool. This works fine for a single monitor. But I have two monitors and I can’t figure out how to change these scripts to allow me to use my own setting for the wallpaper.

      If I use a command line and enter a valid “feh –bg-fill” string with two image paths it will create a new .fehbg file. If I restart the session I see the proper images come on both monitors for only a second. Then the background changes to the previous single image stretched over both monitors. I look at the ~/.fehbg file and it is written to whatever my last setting was using the Choose Wallpaper tool. My last command line edit is gone.

      How do I change the settings in antiX to use my own ~/.fehbg settings instead of the Choose Wallpaper tool?

      I have reviewed the following files but I cannot figure it out:
      /usr/local/bin/wallpaper.py
      /usr/local/bin/desktop-session-wallpaper
      ~/.desktop-session/wallpaper.conf
      ~/.desktop-session/wallpaper-list.conf
      ~/.desktop-session/startup
      ~/.desktop-session/log

      Can I disable the wallpaper.py script? Will that enable me to write and keep my own .fehbg file? I think that file is integral to the antiX desktop session files so I don’t want to damage that. Either I need to disable that script (or desktop-session-wallpaper?) or I need to be able to modify it to handle more than one monitor/screen.

      Thank you,
      seaken64

      #55787
      Moderator
      BobC
        Helpful
        Up
        0
        ::

        Have a look in desktop-session. That’s where it gets called.

        #55788
        Member
        ex_Koo
          Helpful
          Up
          0
          ::

          This may help you..

          https://wiki.archlinux.org/index.php/Feh

          Set the wallpaper
          feh can be used to set the desktop wallpaper, for example for window managers without this feature such as Openbox, Fluxbox, and xmonad.
          
          The following command is an example of how to set the initial background:
          
          $ feh --bg-scale /path/to/image.file
          Other scaling options include:
          
          --bg-tile FILE
          --bg-center FILE
          --bg-max FILE
          --bg-fill FILE
          To restore the background on the next session, add the following to your startup file (e.g. ~/.xinitrc, ~/.config/openbox/autostart, etc.):
          
          ~/.fehbg &
          To change the background image, edit the file ~/.fehbg which gets created after running the command feh --bg-scale /path/to/image.file mentioned above.
          
          One can explicitly disable the creation of the ~/.fehbg, by passing the --no-fehbg flag as well.
          
          To setup different wallpapers for different monitors one should pass as many file paths as many monitors are available. For example, for a dual monitor setup it would be:
          
          $ feh --bg-center path/to/file/for/first/monitor path/to/file/for/second/monitor
          #55789
          Moderator
          BobC
            Helpful
            Up
            0
            ::

            I was noticing that if its configured in wallpaper.conf for type=COLOR that it will run xsetroot for the color given in the COLOR= statement and exit, I think.

            I also noticed that it looks to be setting the wallpaper for the display its on, but I know from my multiscreen setup it appears spread out on both, but not sure why. wmctrl could be used to change active displays.

            #55876
            Member
            seaken64
              Helpful
              Up
              0
              ::

              Thank you koo. Yes, I am trying to follow that guide. I have been able to enter the feh commands and it works. But only for a second. Then the wallpaper is changed, presumably by the antiX script.

              I am asking if I can stop the script from running so that I can control the feh commands myself.

              Thank you BobC. I have searched all thru the desktop-session folder. I cannot find a file named “desktop-session”. Uh, wait a minute. I found this file

              /usr/local/bin/desktop-session

              Is it safe to edit this file? If it gets damaged I can just restore it from init3 console? I’m assuming that is the case. And will antiX automatically update that file and I will lose my changes? Or is this file mine to modify, as the user?

              I’m thinking I can comment out the line to execute desktop-session-wallpaper.

              I’ll give it a whirl and see what I can learn. Thanks for the lead.

              seaken64

              #55878
              Member
              ex_Koo
                Helpful
                Up
                0
                ::

                @seaken64

                I only use one monitor the way I see it is you need to find the name/names of your first & second monitor.
                ARandR in antiX GUI

                xrandr from prompt. CLI

                Something like.

                feh –bg-center ~/photos/antiX.jpg/LVDS1 ~/photos/antiX.jpg/DP2

                In my case LVDS1 laptop screen & DP2 is my 2k monitor

                • This reply was modified 2 years, 1 month ago by ex_Koo.
                • This reply was modified 2 years, 1 month ago by ex_Koo.
                #55881
                Moderator
                Brian Masinick
                  Helpful
                  Up
                  0
                  ::

                  Copy /usr/local/bin/desktop-session to a safe place, maybe in a directory that you manage.

                  If you mess it up, copy back the original rather than starting over

                  If you are nervous about it make copies and put one on external media.

                  I encourage you to experiment even if it messes up. You can learn from the experience. Moreover if you have a copy of antiX on media you can mess up multiple times and recover using the media, either to copy files back or to reinstall.

                  Taking risks, making mistakes is a valuable way to learn and also improve installation and testing skills.

                  • This reply was modified 2 years, 1 month ago by Brian Masinick.

                  --
                  Brian Masinick

                  #55883
                  Member
                  seaken64
                    Helpful
                    Up
                    0
                    ::

                    I copied the /usr/local/bin/desktop-session file and then edited it to comment out the command to run the desktop-session-wallpaper script.

                    #Set wallpaper
                    #sleep $STARTUP_DELAY;
                    #echo_cmd desktop-session-wallpaper &

                    Then I added the command to run fehbg to my IceWM startup file

                    ~/.fehbg &

                    Then I rebooted. I got the same results. The two different wallpapers show on the two monitors for about one second. Then the single wallpaper that I had previously takes over both monitors.

                    I did open the ~/.fehbg file and took a look. Both backgound files paths are on the line. Previously this .fehbg file had been changed to the single path. I thought that was what was causing the single image to fill both monitors. But I think now that the wallpaper image file is being restored from somewhere else. I think ~/.fehbg is running first and then whatever is running next is replacing the wallpaper command.

                    So, I still haven’t found out where the wallpaper is being set by antiX. Still searching.

                    seaken64

                    #55884
                    Member
                    seaken64
                      Helpful
                      Up
                      0
                      ::

                      Thank you Brian. yes, I have already started to experiment. I don’t know yet what I am doing but at least I have started the process. I can’t figure out what scripts are running that affect the wallpaper. I thought it was the desktop-session-wallpaper script but I’m not sure. Maybe I did not stop it from running by editing /usr/local/bin/desktop-session. I don’t really know what command to disable and I just guessed it was the one I found.

                      Maybe Dave would like to update his script to add scripting for multiple monitors? But I think if I could figure out how to stop any automatic wallpaper settings from running I could manage the wallpapers myself.

                      Thanks for the encouragement.

                      I found a folder named /usr/share/doc and hoped there would be some clues in there that would guide me toward learning the order of scripts at startup. But so far I have come up empty. The ~/.deskstop-session/log file gives me some clues but I still am not following the roadmap for the scripts in antiX.

                      Is there some documentation that shows the basic roadmap of the scripts that run at startup?

                      seaken64

                      #55887
                      Anonymous
                        Helpful
                        Up
                        0
                        ::

                        feh --bg-fill path/to/wapplaperimage --bg-fill path/to/anotherimage

                        and

                        sudo sed -i -e 's/echo_cmd desktop-session-wallp/#echo_cmd desktop-session-wallp/' \
                         /usr/local/bin/desktop-session

                        or
                        if you prefer, manually edit the file (outcomment line #237) /usr/local/bin/desktop-session

                        (note: this edit is subject to being overwritten during future updates to desktop-session-antix package )

                        haven’t found out where the wallpaper is being set by antiX

                        explanation of a search strategy:

                        grep -inr wallpaper /usr/local
                        ^–> okay, we learn that “desktop-session-wallpaper” does the deed, but what invokes desktop-session-wallpaper?

                        grep -inr desktop-session-wallpaper /usr/local
                        ^–> only invoked from by these two: “wallpaper.py” the bgsetter utility, and “/usr/local/bin/desktop-session:@Line237”

                        #55928
                        Moderator
                        Brian Masinick
                          Helpful
                          Up
                          0
                          ::

                          One thing I can suggest (and this may have changed over the years) is that the original X specification had part of the syntax including a monitor number. The default monitor number, I believe, is 0, the next monitor is 1, and they are accessed by a : followed by the number.

                          If you peruse the current X docs, whether the original idea is there or it’s been superceded, there ought to be something. Maybe start looking at X, X11, and whatever else happens to be around, either in our pages or somewhere on the Internet; if you can’t find it and I can spare a few minutes, I’ll look; I’ve not used multiple monitors much, but I HAVE seen them in action and I may be able to find something if you strike out.

                          --
                          Brian Masinick

                          #55940
                          Moderator
                          Brian Masinick
                            Helpful
                            Up
                            0
                            ::

                            https://linux.die.net/man/7/x

                            There is a number for each display screen.

                            Read this man (7) X page.

                            Look for the screen number.

                            • This reply was modified 2 years, 1 month ago by Brian Masinick. Reason: Screen number
                            • This reply was modified 2 years, 1 month ago by Brian Masinick.

                            --
                            Brian Masinick

                            #55965
                            Forum Admin
                            Dave
                              Helpful
                              Up
                              0
                              ::

                              I will add an option to desktop-session.conf to disable the wallpaper; but don’t hold your breath.
                              As skidoo said, commenting out the desktop-session-wallpaper call in desktop-session will disable the wallpaper from setting.

                              What session are you using? If you are using space/rox it may be overriding your feh settings.
                              To make a multiple monitor setup I would need to know how to set multiple wallpapers using feh, rox desktop, and spacefm (if possible or not). Preferably from the command line / altering the config file (ie: not though the gui utils).

                              Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

                              #55968
                              Member
                              seaken64
                                Helpful
                                Up
                                0
                                ::

                                I will add an option to desktop-session.conf to disable the wallpaper; but don’t hold your breath.
                                As skidoo said, commenting out the desktop-session-wallpaper call in desktop-session will disable the wallpaper from setting.

                                What session are you using? If you are using space/rox it may be overriding your feh settings.
                                To make a multiple monitor setup I would need to know how to set multiple wallpapers using feh, rox desktop, and spacefm (if possible or not). Preferably from the command line / altering the config file (ie: not though the gui utils).

                                Thank you everyone. I’ll be spending some time with this this coming weekend. You’ve given me good tips and I have some clues to work with.

                                But I think I did already do the commenting out of the desktop-session-wallpaper call and I didn’t see any change in my results. I have more work to do.

                                Dave, thank you for offering to make a change to your tool. It works great for a single monitor. But if we could easily turn it off and use our own settings it may help those of us who want to use multiple monitors each with it’s own wallpaper. I won’t hold my breathe. I’m quite satisfied to have your input along with everyone else who has given me clues. I will keep at it and I think I will eventually understand how it all works and be able to get the results I need.

                                I am using space-icewm on 64-bit antiX-17.4.

                                seaken64

                                #55997
                                Forum Admin
                                Dave
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Using space-icewm, you will need to change to icewm only to keep your feh settings. Unless there is a way to do multiple monitor settings in spacefm. Then you will need to setup spacefm for the multiple monitors and feh with the same images and scale. feh needs to be included with spacefm only if running conky; otherwise conky will show a different background because of the pseudo transparency implementation.

                                  Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

                                Viewing 15 posts - 1 through 15 (of 19 total)
                                • You must be logged in to reply to this topic.