mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
gnome: Add changes missing from branch merge
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
837ed09dc3
commit
acc3fa1bdb
@ -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():
|
||||||
|
|||||||
@ -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')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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'),
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user