diff --git a/nohup.out b/nohup.out deleted file mode 100644 index cf235df..0000000 --- a/nohup.out +++ /dev/null @@ -1,80 +0,0 @@ -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Refusing to render service to dead parents. -Gtk-Message: 14:21:06.968: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:21:06.968: Failed to load module "window-decorations-gtk-module" -Gtk-Message: 14:21:14.239: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:21:14.240: Failed to load module "window-decorations-gtk-module" -Gtk-Message: 14:21:14.318: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:21:14.318: Failed to load module "window-decorations-gtk-module" -Gtk-Message: 14:21:49.400: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:21:49.401: Failed to load module "window-decorations-gtk-module" -Gtk-Message: 14:21:49.463: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:21:49.463: Failed to load module "window-decorations-gtk-module" -javaldx: Could not find a Java Runtime Environment! -Warning: failed to read path from javaldx -Gtk-Message: 14:22:25.948: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:22:25.949: Failed to load module "window-decorations-gtk-module" -Gtk-Message: 14:22:41.171: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:22:41.171: Failed to load module "window-decorations-gtk-module" -Gtk-Message: 14:22:41.236: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:22:41.237: Failed to load module "window-decorations-gtk-module" -Gtk-Message: 14:22:50.959: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:22:50.959: Failed to load module "window-decorations-gtk-module" -Gtk-Message: 14:22:51.022: Failed to load module "colorreload-gtk-module" -Gtk-Message: 14:22:51.023: Failed to load module "window-decorations-gtk-module" -xhost: bad hostname "superadmin" -X Error of failed request: BadValue (integer parameter out of range for operation) - Major opcode of failed request: 109 (X_ChangeHosts) - Value in failed request: 0xa - Serial number of failed request: 7 - Current serial number in output stream: 9 -localuser: being added to access control list -xhost: bad hostname "superadmin" -X Error of failed request: BadValue (integer parameter out of range for operation) - Major opcode of failed request: 109 (X_ChangeHosts) - Value in failed request: 0xa - Serial number of failed request: 7 - Current serial number in output stream: 9 -localuser: being added to access control list -xhost: bad hostname "superadmin" -X Error of failed request: BadValue (integer parameter out of range for operation) - Major opcode of failed request: 109 (X_ChangeHosts) - Value in failed request: 0xa - Serial number of failed request: 7 - Current serial number in output stream: 9 -localuser: being added to access control list -xhost: bad hostname "superadmin" -X Error of failed request: BadValue (integer parameter out of range for operation) - Major opcode of failed request: 109 (X_ChangeHosts) - Value in failed request: 0xa - Serial number of failed request: 7 - Current serial number in output stream: 9 -localuser: being added to access control list -xhost: bad hostname "superadmin" -X Error of failed request: BadValue (integer parameter out of range for operation) - Major opcode of failed request: 109 (X_ChangeHosts) - Value in failed request: 0xa - Serial number of failed request: 7 - Current serial number in output stream: 9 -localuser: being added to access control list diff --git a/source/main.cc b/source/main.cc index 7a27f08..0995b90 100644 --- a/source/main.cc +++ b/source/main.cc @@ -57,6 +57,7 @@ int main(int argc, char** argv) return 0; } else { + MainWindow* wnd = nullptr; builder->get_widget_derived("window", wnd); auto r = app->run(*wnd); diff --git a/source/ublexec.cc b/source/ublexec.cc index c0ffc58..10eb8dc 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -136,6 +136,7 @@ void MainWindow::template_apps_obj(Gtk::IconView *icon, Glib::RefPtr cssProvider = Gtk::CssProvider::create(); cssProvider->load_from_path(path_css); Glib::RefPtr styleContext = Gtk::StyleContext::create(); @@ -145,6 +146,7 @@ void MainWindow::add_CSS(){ Glib::RefPtr context_lbl_head = lblInfoHead->get_style_context(); context_box->add_class("cssboxColor1"); context_lbl_head->add_class("textHead"); + } void MainWindow::localization(){ @@ -303,12 +305,24 @@ void MainWindow::settings(){ this->pars_dir_bin(); this->pars_users(); this->activ_or_block_execute_epriority(); + this->changed_user(); cmbUser->set_active(0); cmbUser->set_sensitive(false); lblInfoUserName->set_sensitive(false); rbPkexec->set_sensitive(false); rbSu->set_sensitive(false); rbSudo->set_sensitive(false); + + //Gtk::Widget *standartHead; + //Gtk::Widget *plugBox; + //Gtk::Window *window; + //Gtk::Widget *btnSave; + //builder->get_widget("standartHead",standartHead); + //builder->get_widget("plugBox",plugBox); + //builder->get_widget("window",window); + //builder->get_widget("btnSave",btnSave); + //ubl_get_standard_ui(standartHead,plugBox,btnSave,window,"ublexec.svg",gettext("Running applications as a user with a\nspecified priority"),gettext("ublexec"),0,0); + } void MainWindow::close_entry_app(){ this->icon_clear(); @@ -427,21 +441,17 @@ void MainWindow::start_cmd(){ //chbTerminal->set_active(true); } if (rbPkexec->get_active()){ - //string user_execute = cmbUser->get_active_text(); if ((chbAnotherUser->get_active()) && (cmbUser->get_active_text().length()==0)) { - str_variants_root = "xhost SI:localuser:${USER}; pkexec --user ${USER} env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; - //this->tmp_desktop(user_cmd); + str_variants_root = " pkexec --user ${USER} env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; } else if (chbAnotherUser->get_active()){ - str_variants_root = "xhost SI:localuser: "+ cmbUser->get_active_text() +"; pkexec --user " + cmbUser->get_active_text() + " env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; + str_variants_root = " pkexec --user " + cmbUser->get_active_text() + " env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; } else{ - str_variants_root = "xhost SI:localuser:${USER}; pkexec --user ${USER} env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; - //this->tmp_desktop(user_cmd); - //user_cmd = "/tmp/" + user_cmd + ".desktop"; + str_variants_root = " pkexec --user ${USER} env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; } } else if (rbSu->get_active()){ @@ -471,9 +481,6 @@ void MainWindow::start_cmd(){ str_nice_cmd = "nice -n " + to_string(spinPriority->get_value_as_int()) + " "; } - //========================================= - - //========================================= if (user_cmd.length()==0 && name_app.length()==0 && path_file.length()==0){ messageError->show(); return; @@ -487,12 +494,10 @@ void MainWindow::start_cmd(){ } string cmd = ""; if (path_file!=""){ - cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + " xdg-open '" + path_file + "' "; - //cmd = format_cmd(str_cmd_terminal,str_variants_root,str_nice_cmd,path_file, cmd); + cmd = str_nice_cmd + " nohup " + str_cmd_terminal + str_variants_root + " xdg-open '" + path_file + "' "; } else if (name_app!=""){ - cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + name_app; - //cmd = format_cmd(str_cmd_terminal,str_variants_root,str_nice_cmd,path_file, cmd); + cmd = str_nice_cmd + " nohup " + str_cmd_terminal + str_variants_root + name_app; } else{ user_cmd = this->str_remove(user_cmd, str_cmd_terminal); @@ -500,16 +505,24 @@ void MainWindow::start_cmd(){ user_cmd = this->str_remove(user_cmd, str_nice_cmd); string str_del = "xterm -e"; user_cmd = this->str_remove(user_cmd, str_del); + str_del = "nohup"; + user_cmd = this->str_remove(user_cmd, str_del); str_del = "pkexec --user superadmin env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY"; user_cmd = this->str_remove(user_cmd, str_del); - string amp = " &"; - user_cmd = this->str_remove(user_cmd, amp); - cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + user_cmd; + str_del = " &"; + user_cmd = this->str_remove(user_cmd, str_del); + for (int index=-20; index<20; index++){ + str_del = to_string(index); + user_cmd = this->str_remove(user_cmd, str_del); + } + str_del = cmbUser->get_active_text(); + user_cmd = this->str_remove(user_cmd, str_del); + + cmd = str_nice_cmd + " nohup " + str_cmd_terminal + str_variants_root + user_cmd ; } + txtCmd->set_text(cmd); - cmd = "nohup " + cmd + " > /dev/null 2>&1"; - //cmd = "bash -c \" " + cmd + " \" &"; - //system(cmd.c_str()); + cmd += " > /dev/null 2>&1"; std::thread t(&me_thread, cmd); t.detach(); path_file_name = ""; diff --git a/ublexec.desktop b/ublexec.desktop index afa9126..ef0cc9d 100644 --- a/ublexec.desktop +++ b/ublexec.desktop @@ -10,4 +10,5 @@ Type=Application Exec=ublexec Icon=ublexec Terminal=false -Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; \ No newline at end of file +X-XfcePluggable=true +Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;X-UBL-SettingsManager;X-UBL-SystemSettings; \ No newline at end of file diff --git a/ublexec.glade b/ublexec.glade index f2edcde..6ecef10 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -470,14 +470,124 @@ 6 gtk-media-play + + False + Внимание! + dialog + + + False + vertical + 2 + + + False + True + end + + + + + + ОК + True + True + True + + + True + True + 1 + + + + + False + False + 0 + + + + + True + False + 10 + 10 + 15 + Select an executable file or program + + + True + True + 2 + + + + + False - Выполнить + UBConfig - ubexec True False vertical + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 69 + ublexec + + + False + True + 0 + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Running applications as a user with a +specified priority + + + + + + + + True + True + 1 + + + + + False + True + 0 + + True @@ -488,61 +598,6 @@ True False vertical - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - 69 - ublexec - - - False - True - 0 - - - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - Running applications as a user with a -specified priority - - - - - - - - True - True - 1 - - - - - False - True - 0 - - True @@ -616,6 +671,8 @@ specified priority True True end + 5 + 5 5 5 6 @@ -1025,7 +1082,7 @@ specified priority 5 6 6 - Priority: + Priority True 0 @@ -1224,61 +1281,6 @@ specified priority False True - 0 - - - - - - - False - Внимание! - dialog - - - False - vertical - 2 - - - False - True - end - - - - - - ОК - True - True - True - - - True - True - 1 - - - - - False - False - 0 - - - - - True - False - 10 - 10 - 15 - Select an executable file or program - - - True - True 2