diff --git a/source/ublexec.cc b/source/ublexec.cc index a54e101..6f681cb 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -113,7 +113,6 @@ void MainWindow::template_apps_obj(Gtk::IconView *icon, Glib::RefPtrset_sort_column(m_Columns.m_col_description, Gtk::SORT_ASCENDING); icon->set_model(gtk_list_app); icon->set_text_column(m_Columns.m_col_description); - //icon->set_pixbuf_column(m_Columns.m_col_pixbuf); } void MainWindow::add_CSS(){ @@ -437,11 +436,18 @@ void MainWindow::start_cmd(){ } else if (rbSu->get_active()){ chbTerminal->set_active(true); - str_variants_root="su -l " + cmbUser->get_active_text(); - if (cbxExecuteEpriority->get_active()){ - str_variants_root += " nice -n " + to_string(spinPriority->get_value_as_int()); + string str_user = cmbUser->get_active_text(); + if (str_user!="root"){ + str_variants_root = "su -l " + cmbUser->get_active_text(); + } + else{ + str_variants_root = "su "; } + str_variants_root += + " -c \" DISPLAY=$DISPLAY "; + if (cbxExecuteEpriority->get_active()){ + str_variants_root += "nice -n " + to_string(spinPriority->get_value_as_int()) + " "; + } } else if (rbSudo->get_active()){ chbTerminal->set_active(true); @@ -486,7 +492,7 @@ void MainWindow::start_cmd(){ user_cmd = vec_user_cmd[vec_len-1]; if (flag_xdg==false){ cmd = "nohup " + str_nice_cmd + str_cmd_terminal + str_variants_root + user_cmd; - if (str_variants_root.find("su -l") != string::npos){ + if (cmd.find("-e su ") != string::npos){ cmd += "\""; } } diff --git a/ublexec.glade b/ublexec.glade index 298e5e8..ddd1e1f 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -2,6 +2,11 @@ + + True + True + 6 + False О Программе @@ -528,6 +533,7 @@ 1 queue horizontal + 120 1