From c48f53507b741a5094e306285e70af0113a8850e Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Wed, 22 Mar 2023 11:47:04 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B4=D0=B5=D0=B9=D1=81=D1=82=D0=B2=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ublexec.cc | 5 +++++ ublexec.glade | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/ublexec.cc b/source/ublexec.cc index 1119cf6..8f4138b 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -313,6 +313,11 @@ bool MainWindow::focus_in_txt_cmd(GdkEventFocus* event) { void MainWindow::synopsis_show() { string cmd = "xdg-open " + string(gettext("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name + " &"; + if (geteuid() == 0) { + string response_user = getlogin(); + cmd = "su -l " + response_user + " -c \" DISPLAY=$DISPLAY " + cmd + " \""; + } + cout << cmd << endl; index_error = system(cmd.c_str()); } diff --git a/ublexec.glade b/ublexec.glade index b52d4cd..0690756 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -1000,7 +1000,7 @@ True False - Synopsis + Help