Use the icon
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
# Iridium OS Installer
|
<div align="center">
|
||||||
|
<img src="data/icons/org.iridium.Installer.svg" alt="Iridium OS Installer Icon" width="128" height="128">
|
||||||
|
|
||||||
|
# Iridium OS Installer
|
||||||
|
</div>
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> For now this is only a mockup and not actually functional.
|
> For now this is only a mockup and not actually functional.
|
||||||
|
|||||||
9
data/org.iridium.Installer.desktop
Normal file
9
data/org.iridium.Installer.desktop
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=Iridium Installer
|
||||||
|
Comment=Install Iridium OS on your computer
|
||||||
|
Exec=iridium-installer
|
||||||
|
Icon=org.iridium.Installer
|
||||||
|
Type=Application
|
||||||
|
Categories=System;Settings;
|
||||||
|
StartupNotify=true
|
||||||
|
Terminal=false
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
gi.require_version("Gtk", "4.0")
|
gi.require_version("Gtk", "4.0")
|
||||||
gi.require_version("Adw", "1")
|
gi.require_version("Adw", "1")
|
||||||
from gi.repository import Adw, Gtk
|
from gi.repository import Adw, Gdk, Gtk
|
||||||
|
|
||||||
|
|
||||||
class WelcomePage(Adw.Bin):
|
class WelcomePage(Adw.Bin):
|
||||||
@@ -12,13 +14,30 @@ class WelcomePage(Adw.Bin):
|
|||||||
page = Adw.StatusPage()
|
page = Adw.StatusPage()
|
||||||
page.set_title("Welcome to Iridium OS")
|
page.set_title("Welcome to Iridium OS")
|
||||||
page.set_description("The installation will begin shortly")
|
page.set_description("The installation will begin shortly")
|
||||||
page.set_icon_name("system-software-install-symbolic")
|
|
||||||
|
# Load custom icon
|
||||||
|
icon_path = os.path.join(
|
||||||
|
os.path.dirname(__file__),
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"data",
|
||||||
|
"icons",
|
||||||
|
"org.iridium.Installer.svg",
|
||||||
|
)
|
||||||
|
if os.path.exists(icon_path):
|
||||||
|
try:
|
||||||
|
paintable = Gdk.Texture.new_from_filename(icon_path)
|
||||||
|
page.set_paintable(paintable)
|
||||||
|
except Exception:
|
||||||
|
page.set_icon_name("system-software-install-symbolic")
|
||||||
|
else:
|
||||||
|
page.set_icon_name("system-software-install-symbolic")
|
||||||
|
|
||||||
# Content Box
|
# Content Box
|
||||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||||
box.set_spacing(12)
|
box.set_spacing(12)
|
||||||
box.set_halign(Gtk.Align.CENTER)
|
box.set_halign(Gtk.Align.CENTER)
|
||||||
box.set_valign(Gtk.Align.CENTER)
|
|
||||||
|
|
||||||
lbl = Gtk.Label(label="Select your language:")
|
lbl = Gtk.Label(label="Select your language:")
|
||||||
lbl.add_css_class("heading")
|
lbl.add_css_class("heading")
|
||||||
@@ -29,7 +48,6 @@ class WelcomePage(Adw.Bin):
|
|||||||
"English",
|
"English",
|
||||||
]
|
]
|
||||||
dropdown = Gtk.DropDown.new_from_strings(languages)
|
dropdown = Gtk.DropDown.new_from_strings(languages)
|
||||||
dropdown.set_margin_bottom(20)
|
|
||||||
box.append(dropdown)
|
box.append(dropdown)
|
||||||
|
|
||||||
page.set_child(box)
|
page.set_child(box)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class InstallerWindow(Adw.ApplicationWindow):
|
|||||||
|
|
||||||
self.set_default_size(900, 650)
|
self.set_default_size(900, 650)
|
||||||
self.set_title("Iridium Installer" + (" (MOCK MODE)" if mock_mode else ""))
|
self.set_title("Iridium Installer" + (" (MOCK MODE)" if mock_mode else ""))
|
||||||
|
self.set_icon_name("org.iridium.Installer")
|
||||||
|
|
||||||
self.toolbar_view = Adw.ToolbarView()
|
self.toolbar_view = Adw.ToolbarView()
|
||||||
self.set_content(self.toolbar_view)
|
self.set_content(self.toolbar_view)
|
||||||
|
|||||||
28
run.sh
28
run.sh
@@ -1,4 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Install icons to ~/.local/share/icons if not already installed
|
||||||
|
ICON_DIR="$HOME/.local/share/icons/hicolor/128x128/apps"
|
||||||
|
SYMBOLIC_DIR="$HOME/.local/share/icons/hicolor/symbolic/apps"
|
||||||
|
|
||||||
|
mkdir -p "$ICON_DIR"
|
||||||
|
mkdir -p "$SYMBOLIC_DIR"
|
||||||
|
|
||||||
|
# Get script directory
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
|
# Copy main icon if not exists or if source is newer
|
||||||
|
if [ ! -f "$ICON_DIR/org.iridium.Installer.svg" ] || [ "${SCRIPT_DIR}/data/icons/org.iridium.Installer.svg" -nt "$ICON_DIR/org.iridium.Installer.svg" ]; then
|
||||||
|
cp "${SCRIPT_DIR}/data/icons/org.iridium.Installer.svg" "$ICON_DIR/"
|
||||||
|
echo "Installed 128x128 icon"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy symbolic icon if not exists or if source is newer
|
||||||
|
if [ ! -f "$SYMBOLIC_DIR/org.iridium.Installer-symbolic.svg" ] || [ "${SCRIPT_DIR}/data/icons/org.iridium.Installer-symbolic.svg" -nt "$SYMBOLIC_DIR/org.iridium.Installer-symbolic.svg" ]; then
|
||||||
|
cp "${SCRIPT_DIR}/data/icons/org.iridium.Installer-symbolic.svg" "$SYMBOLIC_DIR/org.iridium.Installer-symbolic.svg"
|
||||||
|
echo "Installed symbolic icon"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Update icon cache if gtk-update-icon-cache exists
|
||||||
|
if command -v gtk-update-icon-cache &> /dev/null; then
|
||||||
|
gtk-update-icon-cache -f -t "$HOME/.local/share/icons/hicolor" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
export GSETTINGS_SCHEMA_DIR=.
|
export GSETTINGS_SCHEMA_DIR=.
|
||||||
|
|
||||||
python3 -m iridium_installer.main "$@"
|
python3 -m iridium_installer.main "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user