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

Play effect on whole desktop on shutdown #417

Open
JosiahFu opened this issue Jan 26, 2024 · 2 comments
Open

Play effect on whole desktop on shutdown #417

JosiahFu opened this issue Jan 26, 2024 · 2 comments
Labels
contributions welcome Most likely, I will not work on this in the next couple of weeks feature request New feature or request GNOME The bug is specific to GNOME

Comments

@JosiahFu
Copy link

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?

@JosiahFu JosiahFu added the feature request New feature or request label Jan 26, 2024
@Schneegans Schneegans added the contributions welcome Most likely, I will not work on this in the next couple of weeks label Jan 26, 2024
@Schneegans
Copy link
Owner

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!

@JosiahFu
Copy link
Author

JosiahFu commented Jan 26, 2024

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

@Schneegans Schneegans added the GNOME The bug is specific to GNOME label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome Most likely, I will not work on this in the next couple of weeks feature request New feature or request GNOME The bug is specific to GNOME
Projects
None yet
Development

No branches or pull requests

2 participants