Schneegans / Burn-My-Windows

🔥 Disintegrate your windows with style.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Play effect on whole desktop on shutdown

JosiahFu opened this issue · comments

The Idea

I'm not sure if this is really difficult or out of scope, but it would be cool if when you shut down (from the GNOME menu at least, hooking into systemd would be harder), a specified animation displays on the whole desktop. For example, selecting the default fire effect then shutting down would cause your entire screen including the panel and wallpaper to burn away.

This would probably require another setting for an image or solid color background.

The Alternatives

I guess one could hack together a script to screenshot the desktop, display a fullscreen image, then close it with that effect?

Hey there! This is a pretty neat idea. I'll definitely look into this at some point. These days however, I am pretty busy with Kando. So it may take some time. If somebody else wants to look into this, feel free to drop a note here and I would happily provide some pointers to the source code!

Made Generated a quick proof-of-concept script using the aforementioned screenshot hack. (although it flashes the screen and shows the default window zoom animation)

Code
import time
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib
from PIL import Image
import pyscreenshot as ImageGrab


# Take a screenshot of the desktop
screenshot = ImageGrab.grab()
screenshot.save("screenshot.png")

class BlackWindow(Gtk.Window):
    def __init__(self):
        super().__init__()
        self.fullscreen()
        self.connect('destroy', Gtk.main_quit)

class ScreenshotWindow(Gtk.Window):
    def __init__(self, screenshot_path):
        super().__init__()
        self.fullscreen()
        image = Gtk.Image.new_from_file('screenshot.png')
        self.add(image)
        GLib.timeout_add(1000, self.on_timeout, None)

    def on_timeout(self, *args):
        self.destroy()

# Open a fullscreen window that is solid black
win = BlackWindow()
win.show_all()

# Display the screenshot on top of this window
screenshot_win = ScreenshotWindow("screenshot.png")
screenshot_win.show_all()

Gtk.main()

# Wait for 1 second then close the screenshot window
# Gtk.main_quit()
Screencast.from.2024-01-26.12-32-27.webm.mov