mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-08 09:25:59 +01:00
Disable systemctl when built without systemd support (#2066)
/bin/sh: systemctl: not found
This commit is contained in:
parent
8944db49be
commit
63841c8aac
2 changed files with 8 additions and 1 deletions
|
@ -443,7 +443,9 @@ void CCompositor::startCompositor() {
|
||||||
if (m_sWLRSession /* Session-less Hyprland usually means a nest, don't update the env in that case */ && fork() == 0)
|
if (m_sWLRSession /* Session-less Hyprland usually means a nest, don't update the env in that case */ && fork() == 0)
|
||||||
execl(
|
execl(
|
||||||
"/bin/sh", "/bin/sh", "-c",
|
"/bin/sh", "/bin/sh", "-c",
|
||||||
|
#ifdef USES_SYSTEMD
|
||||||
"systemctl --user import-environment DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && hash dbus-update-activation-environment 2>/dev/null && "
|
"systemctl --user import-environment DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && hash dbus-update-activation-environment 2>/dev/null && "
|
||||||
|
#endif
|
||||||
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE",
|
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE",
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
||||||
|
|
|
@ -1090,8 +1090,11 @@ void CConfigManager::handleEnv(const std::string& command, const std::string& va
|
||||||
|
|
||||||
if (command.back() == 'd') {
|
if (command.back() == 'd') {
|
||||||
// dbus
|
// dbus
|
||||||
const auto CMD = "systemctl --user import-environment " + ARGS[0] +
|
const auto CMD =
|
||||||
|
#ifdef USES_SYSTEMD
|
||||||
|
"systemctl --user import-environment " + ARGS[0] +
|
||||||
" && hash dbus-update-activation-environment 2>/dev/null && "
|
" && hash dbus-update-activation-environment 2>/dev/null && "
|
||||||
|
#endif
|
||||||
"dbus-update-activation-environment --systemd " +
|
"dbus-update-activation-environment --systemd " +
|
||||||
ARGS[0];
|
ARGS[0];
|
||||||
handleRawExec("", CMD.c_str());
|
handleRawExec("", CMD.c_str());
|
||||||
|
@ -1719,7 +1722,9 @@ void CConfigManager::dispatchExecOnce() {
|
||||||
if (g_pCompositor->m_sWLRSession)
|
if (g_pCompositor->m_sWLRSession)
|
||||||
handleRawExec(
|
handleRawExec(
|
||||||
"",
|
"",
|
||||||
|
#ifdef USES_SYSTEMD
|
||||||
"systemctl --user import-environment DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && hash dbus-update-activation-environment 2>/dev/null && "
|
"systemctl --user import-environment DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && hash dbus-update-activation-environment 2>/dev/null && "
|
||||||
|
#endif
|
||||||
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE");
|
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE");
|
||||||
|
|
||||||
firstExecDispatched = true;
|
firstExecDispatched = true;
|
||||||
|
|
Loading…
Reference in a new issue