gnome: Add changes missing from branch merge

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2025-01-12 20:46:22 -08:00
parent 837ed09dc3
commit acc3fa1bdb
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
4 changed files with 11 additions and 12 deletions

View File

@ -36,15 +36,9 @@ def systemd_get_default() -> str:
return process.stdout.decode().strip() return process.stdout.decode().strip()
def systemd_set_default(target: str, isolate: bool = True): def systemd_set_default(target: str):
"""Set the default target that systemd will boot into. """Set the default target that systemd will boot into."""
If 'isolate' is True, then immediate switch the current system target to
newly set target resulting in starting/stopping of services.
"""
subprocess.run(['systemctl', 'set-default', target], check=True) subprocess.run(['systemctl', 'set-default', target], check=True)
if isolate:
subprocess.run(['systemctl', 'isolate', target], check=True)
def service_daemon_reload(): def service_daemon_reload():

View File

@ -1,6 +1,7 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""FreedomBox app to configure GNOME desktop.""" """FreedomBox app to configure GNOME desktop."""
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from plinth import action_utils from plinth import action_utils
@ -23,8 +24,12 @@ _description = [
'You may install further graphical applications using the software ' 'You may install further graphical applications using the software '
'center provided within.'), box_name=_(cfg.box_name)), 'center provided within.'), box_name=_(cfg.box_name)),
_('This app is not suitable for low-end hardware. It requires at least ' _('This app is not suitable for low-end hardware. It requires at least '
'4GiB for RAM, 4GiB or disk space and a GPU capable of basic 3D ' '4GiB of RAM, 4GiB of disk space and a GPU capable of basic 3D '
'acceleration.'), 'acceleration.'),
format_lazy(
_('After installing, enabling, disabling, or uninstalling the app, '
'you will need to <a href="{power_url}">restart</a> the machine for '
'changes to take effect.'), power_url=reverse_lazy('power:restart')),
] ]

View File

@ -3,7 +3,7 @@
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
backup = {} backup: dict = {}
tags = [ tags = [
_('Desktop'), _('Desktop'),

View File

@ -9,12 +9,12 @@ from plinth.daemon import Daemon, RelatedDaemon
@privileged @privileged
def systemd_set_default(target: str, isolate: bool = True): def systemd_set_default(target: str):
"""Set the default target that systemd will boot into.""" """Set the default target that systemd will boot into."""
if target not in ['graphical.target', 'multi-user.target']: if target not in ['graphical.target', 'multi-user.target']:
raise ValueError('Invalid target') raise ValueError('Invalid target')
action_utils.systemd_set_default(target, isolate) action_utils.systemd_set_default(target)
@privileged @privileged