Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on i3wm. #1

Open
ajax711 opened this issue Aug 1, 2020 · 18 comments
Open

Not working on i3wm. #1

ajax711 opened this issue Aug 1, 2020 · 18 comments

Comments

@ajax711
Copy link

ajax711 commented Aug 1, 2020

executing ./paperview train 5 just seems to refresh my monitor and doesn't change the wallpaper. Clip here
. Its a Thinkpad T450 with an integrated intel GPU if that helps.

@glouw
Copy link
Owner

glouw commented Aug 1, 2020

Make sure to add a slash to the end of train, like train/

@Amulek1416
Copy link

I'm having the same issue. I'm using the train/ syntax, but even after disabling feh it still does nothing.

I'm running an i7 8700K with GTX960 and Intel graphics disabled.

@glouw
Copy link
Owner

glouw commented Aug 1, 2020

Alas it seems to be hit or miss. As its hardware / platform dependent it may be tricky to debug. Luck so far has been with Arch Linux and I3 / DWM window managers. I am curious if this setup is only applicable to Arch Linux

@Amulek1416
Copy link

That's what I'm running. Arch linux with i3-gaps.

I am also using a liteDM for a display manager. Could this be the issue?

@glouw
Copy link
Owner

glouw commented Aug 1, 2020

LiteDM most likely is the cause. I know desktop managers tend to overwrite the root X11 window. Worth a shot, maybe, but possible try it in a virtual machine first

@Amulek1416
Copy link

Amulek1416 commented Aug 1, 2020

It was actually picom that was the issue. After disabling it, it worked really well! Now all that's left is finding the cause of that issue...

EDIT: From just some poking around, when running picom after running paperview, paperview disappears. It will reappear when picom is then killed. Not sure if this helps, but I'll see if there is a picom setting that needs to be changed to get this working with picom.

@glouw
Copy link
Owner

glouw commented Aug 1, 2020

From the reddit comments, many people were mentioning they were having no luck with picom. I'm glad you were you able to confirm. My best guess is that picom writes to the X11 root window after paperview does. The X11 root window is free real estate, after all. Why not draw to it if nothing else is? :P

@glouw
Copy link
Owner

glouw commented Aug 1, 2020

Anywho, the latest push has some new bitmaps. Here's a video of it: https://www.youtube.com/watch?v=6ZTiA885bWM.

If you're interested in generating your own desktop images, pick a pretty gif from here: https://imgur.com/gallery/F9DAH, and save it to your machine. You can convert the gif into an array of bitmaps with imagemagick's convert tool:

convert -coalesce your.gif out.bmp

Just pop the bitmaps into a folder, and it will compatible with paperview.

@Amulek1416
Copy link

Amulek1416 commented Aug 1, 2020

Is there a way to convert parts of a video into an array of bitmaps? I think it'd be really cool to take clips of views from the ISS and play them through. Or possibly the videos on Apple TV's screen savers.

EDIT: What do you mean "draw to it if nothing else"?

@glouw
Copy link
Owner

glouw commented Aug 1, 2020

There are gif editors online that can probably shorten gifs. Any standard video editor on linux can do the same I imagine. Converting with imagemagick is just the final step. The less BMP wrangling the better.

Ha, I mean, if nothing is drawing to the wallpaper, and you're able to draw to the wallpaper as a picom developer, why not do so? Its a gateway for some special effects. Its just a shame, because it leaves secondary hackers in the blue.

@Amulek1416
Copy link

Oh, I'm not a Picom developer. I just use it since it makes my desktop look amazing! I was just messing around with the config file by doing things like turning shadows on/off to see if there was a setting causing the issue. No luck though...

Thanks for the help! I really like this simple easy-to-use background. I'm currently trying to see if I can add a feature to set the program to rotate through different scenes when the user enters a third argument to set the amount of time between transitions. Would this be something you'd be interested in?

@yankcrime
Copy link

It's probably related to something along these lines: chjj/compton#162

Only those wallpaper setters providing the property _XROOTPMAP_ID or _XSETROOT_ID are supported.

@AlecsFerra
Copy link

AlecsFerra commented Aug 1, 2020

It's probably related to something along these lines: chjj/compton#162

Only those wallpaper setters providing the property _XROOTPMAP_ID or _XSETROOT_ID are supported.

So fo fix the problem we need to set the background in the same way it does hsetroot or just use it as a dependency
https://github.com/himdel/hsetroot

@glouw
Copy link
Owner

glouw commented Aug 1, 2020

Oh, I'm not a Picom developer. I just use it since it makes my desktop look amazing! I was just messing around with the config file by doing things like turning shadows on/off to see if there was a setting causing the issue. No luck though...

Thanks for the help! I really like this simple easy-to-use background. I'm currently trying to see if I can add a feature to set the program to rotate through different scenes when the user enters a third argument to set the amount of time between transitions. Would this be something you'd be interested in?

Possibly, but likely not at this time. I prefer extreme simplicity over feature richness (even the code doesnt even handle a single error!) but I'll try out your fork for sure

@AlecsFerra
Copy link

AlecsFerra commented Aug 2, 2020

So to fix this issue we need to find a way to make SDL render directly on the pixmap of the root window

Snippet to obtain the pixmap:

int screen = DefaultScreen(self.x11d);
Pixmap pixmap = XCreatePixmap(self.x11d,
                                RootWindow(self.x11d, screen),
                                DisplayWidth(self.x11d, screen),
                                DisplayHeight(self.x11d, screen),
                                DefaultDepth(self.x11d, screen));

And the after every render we need to reset the propertyies (XROOTPMAP_ID, _XSETROOT_ID)

It's probably related to something along these lines: chjj/compton#162

Only those wallpaper setters providing the property _XROOTPMAP_ID or _XSETROOT_ID are supported.

And this code will do the work:

int set_root_atoms(const Video *video) {
    int scr = DefaultScreen(video->x11d);
    Atom xroot = XInternAtom(video->x11d, "_XROOTPMAP_ID", True);
    Atom eroot = XInternAtom(video->x11d, "ESETROOT_PMAP_ID", True);

    // Clean old wallpaper
    if (xroot != None && eroot != None) {
        Atom type;
        int format;
        unsigned long length, after;
        unsigned char *data_xroot;
        XGetWindowProperty(video->x11d, RootWindow(video->x11d, scr), xroot, 0L, 1L,
                           False, AnyPropertyType, &type, &format, &length, &after,
                           &data_xroot);
        if (type == XA_PIXMAP) {
            unsigned char *data_eroot;
            XGetWindowProperty(video->x11d, RootWindow(video->x11d, scr), eroot, 0L, 1L,
                               False, AnyPropertyType, &type, &format, &length,
                               &after, &data_eroot);
            if (data_xroot && data_eroot && type == XA_PIXMAP &&
                *((Pixmap *) data_xroot) == *((Pixmap *) data_eroot)) {
                XKillClient(video->x11d, *((Pixmap *) data_xroot));
            }
        }
    }

    xroot = XInternAtom(video->x11d, "_XROOTPMAP_ID", False);
    eroot = XInternAtom(video->x11d, "ESETROOT_PMAP_ID", False);

    XChangeProperty(video->x11d, RootWindow(video->x11d, scr), xroot, XA_PIXMAP, 32,
                    PropModeReplace, (unsigned char *) &video->pixmap, 1);
    XChangeProperty(video->x11d, RootWindow(video->x11d, scr), eroot, XA_PIXMAP, 32,
                    PropModeReplace, (unsigned char *) &video->pixmap, 1);
    return 0;
}

(I've added a pixmap field in the struct video)

I've tested and it seems to work but i couldn't figure out how to render on the pixmap directly from SDL

@AlecsFerra
Copy link

AlecsFerra commented Aug 2, 2020

I have a proof of concept that works with picom and it should support multi monitor 🎉🎉 but I used another library for the rendering since i don't know SLD if anyone is willing to help porting it to SDL I'm here

Source:
https://gist.github.com/AlecsFerra/ef1cc008990319f3b676eb2d8aa89903

@glouw
Copy link
Owner

glouw commented Aug 2, 2020

Amazing work. I can link to this in my README?

@abhijit-23blaze
Copy link

I'm having the same issue. I'm using the train/ syntax, but even after disabling feh it still does nothing.

I'm running an i7 8700K with GTX960 and Intel graphics disabled.

try restarting it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants