feat: fade-in animation, PKGBUILD for system installation
- CSS opacity transition (350ms ease-in) for panel and wallpaper - PKGBUILD for makepkg/pacman installation - .gitignore for makepkg build artifacts
This commit is contained in:
parent
63bd7cfea9
commit
004e3d2855
6
.gitignore
vendored
6
.gitignore
vendored
@ -8,3 +8,9 @@ build/
|
|||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
.pyright/
|
.pyright/
|
||||||
*.egg
|
*.egg
|
||||||
|
|
||||||
|
# makepkg build artifacts
|
||||||
|
pkg/src/
|
||||||
|
pkg/pkg/
|
||||||
|
pkg/*.pkg.tar*
|
||||||
|
pkg/moonset/
|
||||||
|
|||||||
47
pkg/PKGBUILD
Normal file
47
pkg/PKGBUILD
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# ABOUTME: PKGBUILD for Moonset — Wayland session power menu.
|
||||||
|
# ABOUTME: Builds from git source with automatic version detection.
|
||||||
|
|
||||||
|
# Maintainer: Dominik Kressler
|
||||||
|
|
||||||
|
pkgname=moonset-git
|
||||||
|
pkgver=0.1.0.r6.g63bd7cf
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="A Wayland session power menu with GTK4 and Layer Shell"
|
||||||
|
arch=('any')
|
||||||
|
url="https://gitea.moonarch.de/nevaforget/moonset"
|
||||||
|
license=('MIT')
|
||||||
|
depends=(
|
||||||
|
'python'
|
||||||
|
'python-gobject'
|
||||||
|
'gtk4'
|
||||||
|
'gtk4-layer-shell'
|
||||||
|
)
|
||||||
|
makedepends=(
|
||||||
|
'git'
|
||||||
|
'python-build'
|
||||||
|
'python-installer'
|
||||||
|
'python-hatchling'
|
||||||
|
)
|
||||||
|
provides=('moonset')
|
||||||
|
conflicts=('moonset')
|
||||||
|
source=("git+${url}.git")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
pkgver() {
|
||||||
|
cd "$srcdir/moonset"
|
||||||
|
git describe --long --tags | sed 's/^v//;s/-/.r/;s/-/./'
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$srcdir/moonset"
|
||||||
|
rm -rf dist/
|
||||||
|
python -m build --wheel --no-isolation
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$srcdir/moonset"
|
||||||
|
python -m installer --destdir="$pkgdir" dist/*.whl
|
||||||
|
|
||||||
|
# Example config
|
||||||
|
install -Dm644 config/moonset.toml "$pkgdir/etc/moonset/moonset.toml.example"
|
||||||
|
}
|
||||||
@ -107,6 +107,12 @@ class WallpaperWindow(Gtk.ApplicationWindow):
|
|||||||
background.set_vexpand(True)
|
background.set_vexpand(True)
|
||||||
self.set_child(background)
|
self.set_child(background)
|
||||||
|
|
||||||
|
self.connect("map", self._on_map)
|
||||||
|
|
||||||
|
def _on_map(self, widget: Gtk.Widget) -> None:
|
||||||
|
"""Trigger fade-in once the window is visible."""
|
||||||
|
GLib.idle_add(lambda: self.add_css_class("visible") or GLib.SOURCE_REMOVE)
|
||||||
|
|
||||||
|
|
||||||
class PanelWindow(Gtk.ApplicationWindow):
|
class PanelWindow(Gtk.ApplicationWindow):
|
||||||
"""Fullscreen power menu window for the primary monitor."""
|
"""Fullscreen power menu window for the primary monitor."""
|
||||||
@ -242,10 +248,14 @@ class PanelWindow(Gtk.ApplicationWindow):
|
|||||||
self.add_controller(controller)
|
self.add_controller(controller)
|
||||||
|
|
||||||
def _on_map(self, widget: Gtk.Widget) -> None:
|
def _on_map(self, widget: Gtk.Widget) -> None:
|
||||||
"""Grab focus on the first action button once the window is visible."""
|
"""Trigger fade-in and grab focus once the window is visible."""
|
||||||
# Delay focus grab — layer shell keyboard interactivity may not
|
GLib.idle_add(self._fade_in)
|
||||||
# be ready at map time
|
|
||||||
|
def _fade_in(self) -> bool:
|
||||||
|
"""Add visible class to trigger CSS opacity transition, then grab focus."""
|
||||||
|
self.add_css_class("visible")
|
||||||
GLib.idle_add(self._grab_initial_focus)
|
GLib.idle_add(self._grab_initial_focus)
|
||||||
|
return GLib.SOURCE_REMOVE
|
||||||
|
|
||||||
def _grab_initial_focus(self) -> bool:
|
def _grab_initial_focus(self) -> bool:
|
||||||
"""Set focus on the first action button."""
|
"""Set focus on the first action button."""
|
||||||
|
|||||||
@ -6,11 +6,23 @@ window.panel {
|
|||||||
background-color: @theme_bg_color;
|
background-color: @theme_bg_color;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 350ms ease-in;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.panel.visible {
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wallpaper-only window for secondary monitors */
|
/* Wallpaper-only window for secondary monitors */
|
||||||
window.wallpaper {
|
window.wallpaper {
|
||||||
background-color: @theme_bg_color;
|
background-color: @theme_bg_color;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 350ms ease-in;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.wallpaper.visible {
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Round avatar image */
|
/* Round avatar image */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user