jeffshee / hidamari

Video wallpaper for Linux. Written in Python. 🐍
https://flathub.org/apps/details/io.github.jeffshee.Hidamari
GNU General Public License v3.0
1.01k stars 31 forks source link

Different videos per monitor #46

Open OneSons opened 2 years ago

OneSons commented 2 years ago

Sorry if this has already been discussed, but I didn't see a submitted issue for this. I'd love to be able to use different video wallpapers per monitor.

If it matters, I'm running Manjaro Gnome 21.2.4.

Thanks!

keteague commented 1 year ago

+1 on this request

JunioHorniche commented 5 months ago

+1 on this request

xaprier commented 3 months ago

I tried to do it by myself as light knowledge of Python. I created an interface Monitor to keep wallpapers with peering monitor.

Kept wallpapers in config as list like:

"data_source":[ "/home/xaprier/Videos/Hidamari/ghost.mp4", "/home/xaprier/Videos/Hidamari/ghost2.mp4" ],

Created ui like this:

    def on_local_video_apply(self, *_):
        selected = self.icon_view.get_selected_items()
        if len(selected) != 0:
            menu = Gtk.Menu()
            items = []
            for i in range(len(self.monitors.get_monitors())):
                item = Gtk.MenuItem(label=f"Set As {i}")
                item.connect("activate", self.on_set_as, i)
                menu.append(item)
                items.append(item)

            # show menu
            menu.show_all()
            menu.popup(None, None, None, None, 0, Gtk.get_current_event_time())

    def on_set_as(self, widget, index):
        video_path = self.video_paths[index]
        logger.info(f"[GUI] Local Video Set To {video_path} for {index}")
        self.config[CONFIG_KEY_MODE] = MODE_VIDEO
        paths = self.config[CONFIG_KEY_DATA_SOURCE] if not None else []
        if len(paths) < index:
            raise Exception("Index cannot be greater than path size")
            return
        paths[index] = video_path
        self.config[CONFIG_KEY_DATA_SOURCE] = paths
        self.monitors.get_monitor_by_index(index).set_wallpaper(video_path)
        if self.server is not None:
            self.server.video(self.video_paths)

But i cannot reach more after server.(the code i sent will throw waiting string for video) I Overlooked for 1 hour but I cannot understand how this application set video as wallpaper.