diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3716db2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +ublexec.glade~ +test.cpp +.vscode +ublexec \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..69aebbf --- /dev/null +++ b/Makefile @@ -0,0 +1,136 @@ +#!/usr/bin/make -f +#!/usr/bin/make -f + +#SHELL := /bin/bash +MAKEFILE_FILEPATH := $(abspath $(lastword $(MAKEFILE_LIST))) +MAKEFILE_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_FILEPATH)))) +MAKEFILE_PATH := $(dir $(MAKEFILE_FILEPATH)) + +CMAKE_COMMAND = cmake +#CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source +#CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile +CMAKE_SOURCE_DIR = ./source +CMAKE_BUILD_DIR = ./compile +DEPENDS = cmake +#PKGNAME = $(MAKEFILE_DIR) +PKGNAME = ublexec + +default_target: all +all: init build + +init: + @echo "Initialize ..."; \ + echo "-- Build path: ${CMAKE_BUILD_DIR}" + +depend: + @echo "Check depends ..."; \ + if [ ! -f /bin/${DEPENDS} ]; then \ + echo "-- Depend '${DEPENDS}' not fount !"; \ + exit 1; \ + fi; \ + echo "Check depends: OK" +# $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 + +debug: + @echo "Debug ..." + if [ ! -d ${CMAKE_BUILD_DIR} ]; then \ + $(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="/usr"; \ + fi; \ + echo "Debug: OK" + +prepare: + @echo "Prepare ..."; \ + if [ ! -d ${CMAKE_BUILD_DIR} ]; then \ + $(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr"; \ + fi; \ + echo "Prepare: OK" + +check: + @echo "Check ..."; \ + if [ -f ${CMAKE_BUILD_DIR}/${PKGNAME} ]; then \ + echo "Check: OK"; \ + else \ + echo "Check: ${CMAKE_BUILD_DIR}/${PKGNAME} not fount !"; \ + exit 1; \ + fi + +build: depend prepare + @echo "Build ..."; \ + make --directory=${CMAKE_BUILD_DIR}; \ + echo "Build: OK" + +uninstall: + @echo "Uninstall ..." + @for FILE_PO in $(wildcard *.po); do \ + LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \ + FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \ + PATH_FILE_MO="/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ + $(RM) "/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ + done +# @for SIZE in 16x16 32x32 48x48 scalable; do \ + $(RM) "/usr/share/icons/hicolor/$${SIZE}/apps/${PKGNAME}.svg"; \ + $(RM) "/usr/share/icons/hicolor/$${SIZE}/apps/${PKGNAME}.png"; \ + done +# @for FILE_SVG in $(wildcard *.svg); do \ + for SIZE in 16x16 32x32 48x48 scalable; do \ + $(RM) "/usr/share/icons/hicolor/$${SIZE}/status/$${FILE_SVG%.*}".{svg,png,jpg}; \ + done; \ + done + @$(RM) "/usr/bin/${PKGNAME}" + @$(RM) "/usr/share/applications/${PKGNAME}.desktop" + @$(RM) "/usr/share/polkit-1/actions/ru.ublinux.pkexec.${PKGNAME}.exec.policy" + @$(RM) -rd "/usr/share/${PKGNAME}" + @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null + @update-desktop-database --quiet 2>/dev/null + @touch /usr/share/applications + @echo "Uninstall: OK" + +install: check uninstall + @echo "Install ..." + @for FILE_PO in $(wildcard *.po); do \ + LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \ + install -dm755 /usr/share/locale/$${LANG}/LC_MESSAGES; \ + FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \ + PATH_FILE_MO="/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ + echo $${FILE_PO}; \ + msgfmt "$${FILE_PO}" -v -f -o "$${PATH_FILE_MO}"; \ + done + @for SIZE in 16 32 48; do \ + install -dm755 /usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps; \ + rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data ${PKGNAME}.svg -o "/usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/${PKGNAME}.svg"; \ + done + @install -dm755 /usr/share/icons/hicolor/scalable/apps + @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ${PKGNAME}.svg + @install -Dm755 -t /usr/bin/ ${CMAKE_BUILD_DIR}/${PKGNAME} + @install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop + @install -Dm644 -t /usr/share/polkit-1/actions/ org.ublinux.pkexec.${PKGNAME}.exec.policy + @install -dm755 /usr/share/${PKGNAME}/{ui,css,images} + @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade + @install -Dm644 -t /usr/share/${PKGNAME}/css/ style.css + @install -Dm644 -t /usr/share/${PKGNAME}/images/ bg_top.png + @install -Dm644 -t /usr/share/${PKGNAME}/images/ ${PKGNAME}.svg +# @install -Dm644 -t /usr/share/${PKGNAME}/images/ ${PKGNAME}.png + @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ + @update-desktop-database --quiet 2>/dev/null + @touch /usr/share/applications + @echo "Install: OK" + +clean: + @echo "Clean ..." + @$(RM) -rd ${CMAKE_BUILD_DIR} + @if [ -d ${CMAKE_BUILD_DIR} ]; then \ + echo "Clean: error, compile directory exist ${CMAKE_BUILD_DIR}"; \ + else \ + echo "Clean: OK"; \ + fi + +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... init" + @echo "... debug" + @echo "... prepare" + @echo "... compile" + @echo "... install" + @echo "... uninstall" + @echo "... clean" \ No newline at end of file diff --git a/README.md b/README.md index 141ec06..eacfcda 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,28 @@ # ublexec +# Выполнить +# Build +In order to build ublexec you will need: + +- CMake +- C compiler +- GTK+ 3 & dependencies + +Once you have all the necessary dependencies, you can use: +```sh +$ make +``` + +# Installation +After a successful build, just use: +```sh +$ sudo make install clean +``` + +# Uninstallation +After a successful build, just use: +```sh +$ sudo make uninstall +``` + +![alt text](screenshot/screenshot.png) diff --git a/bg_top.png b/bg_top.png new file mode 100644 index 0000000..8eb67cb Binary files /dev/null and b/bg_top.png differ diff --git a/org.ublinux.pkexec.ublexec.exec.policy b/org.ublinux.pkexec.ublexec.exec.policy new file mode 100644 index 0000000..3664113 --- /dev/null +++ b/org.ublinux.pkexec.ublexec.exec.policy @@ -0,0 +1,24 @@ + + + + + UBLinux + https://ublinux.ru + + + Run "ublexec" as root + Запус "Выполнить" с правами root + Authentication is required to run ublexec + Требуется авторизация для запуска "Выполнить" с правами root + + auth_admin + auth_admin + auth_admin + + /usr/bin/ublexec + true + + + diff --git a/screenshot/screenshot.png b/screenshot/screenshot.png new file mode 100644 index 0000000..1b575f2 Binary files /dev/null and b/screenshot/screenshot.png differ diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt new file mode 100644 index 0000000..d9ace9b --- /dev/null +++ b/source/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.7) +project(ublexec) + +find_package(PkgConfig REQUIRED) + +pkg_check_modules(GTK REQUIRED gtkmm-3.0) +include_directories(${GTK_INCLUDE_DIRS}) +link_directories(${GTK_LIBRARY_DIRS}) +add_definitions(${GTK_CFLAGS_OTHER}) + +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wmissing-declarations -fdiagnostics-color=always") + +set(SOURCE_FILES + main.cc + ublexec.cc + ublexec.h) + +set(LIBRARIES + ${GTK_LIBRARIES} + pthread) + +add_executable(ublexec ${SOURCE_FILES}) +target_link_libraries(ublexec ${LIBRARIES}) +install(TARGETS ublexec DESTINATION bin) diff --git a/source/main.cc b/source/main.cc new file mode 100644 index 0000000..9c08001 --- /dev/null +++ b/source/main.cc @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ublexec.h" + + + + + +int main(int argc, char** argv) +{ + + string str_cmd_argv = ""; + for (int i=1; irun(plug); + return 0; + } + else { + MainWindow* wnd = nullptr; + builder->get_widget_derived("window", wnd); + auto r = app->run(*wnd); + delete wnd; + return r; + } + +} diff --git a/source/ublexec.cc b/source/ublexec.cc new file mode 100644 index 0000000..4bc505a --- /dev/null +++ b/source/ublexec.cc @@ -0,0 +1,538 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ublexec.h" +using namespace std; + +string path_app= "/usr/bin/"; +string path_glade= "/usr/share/ublexec/ui/ublexec.glade"; +string path_css = "/usr/share/ublexec/css/style.css"; +//string path_app = "/home/superadmin/Документы/Проект/ubconfig_new/ubcall/"; +string app_name = "ublexec"; +CmdArgParser::CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help) +: Glib::OptionGroup{p_name, p_description, p_help} { + Glib::OptionEntry socketIDArg; + socketIDArg.set_long_name("socket-id"); + socketIDArg.set_short_name('s'); + socketIDArg.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); + socketIDArg.set_description("Settings manager socket"); + add_entry(socketIDArg, m_socketID); +} +::Window CmdArgParser::GetSocketID() const{ + return m_socketID; +} +MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder) + : Gtk::ApplicationWindow(obj), builder{builder} { + this->settings(); + } +MainWindow::MainWindow(Glib::RefPtr const& builder) { + this->builder = builder; + this->settings(); +} +void MainWindow::get_builder(){ + builder->get_widget("btnFilemaneg", btnFilemaneg); + builder->get_widget("btnListApp", btnListApp); + builder->get_widget("btnStart", btnStart); + builder->get_widget("chbTerminal", chbTerminal); + builder->get_widget("chbAnotherUser", chbAnotherUser); + builder->get_widget("cbxExecuteEpriority", cbxExecuteEpriority); + builder->get_widget("cmbUser", cmbUser); + builder->get_widget("spinPriority", spinPriority); + builder->get_widget("scalePriority", scalePriority); + builder->get_widget("rbPkexec", rbPkexec); + builder->get_widget("rbSu", rbSu); + builder->get_widget("rbSudo", rbSudo); + builder->get_widget("txtCmd", txtCmd); + builder->get_widget("wndChooseFileWallpaper", wndChooseFileWallpaper); + builder->get_widget("btnFilemangerExit", btnFilemangerExit); + builder->get_widget("btnFilemangerOk", btnFilemangerOk); + builder->get_widget("lblTimeEpriorityLow", lblTimeEpriorityLow); + builder->get_widget("lblTime4EpriorityHigh", lblTime4EpriorityHigh); + //builder->get_widget("lblUserName", lblUserName); + builder->get_widget("messageError", messageError); + builder->get_widget("lblMessageError", lblMessageError); + builder->get_widget("btnMessageErrorOk", btnMessageErrorOk); + builder->get_widget("btnMessageErrorOk", btnMessageErrorOk); + builder->get_widget("btnMessageErrorOk", btnMessageErrorOk); + builder->get_widget("dialogStartMenu", dialogStartMenu); + builder->get_widget("btnStartMenuOK", btnStartMenuOK); + builder->get_widget("btnStartMenuExit", btnStartMenuExit); + builder->get_widget("boxlistProgramm", boxlistProgramm); + builder->get_widget("lblInfoHead", lblInfoHead); + builder->get_widget("lblinfoCmd", lblinfoCmd); + builder->get_widget("lblInfoTime", lblInfoTime); + builder->get_widget("labInfoExecutTerm", labInfoExecutTerm); + builder->get_widget("lblInfoUser", lblInfoUser); + builder->get_widget("lblInfoUserOther", lblInfoUserOther); + builder->get_widget("lblInfoUserName", lblInfoUserName); + builder->get_widget("lblInfoNooPriority", lblInfoNooPriority); + builder->get_widget("lblInfoExec", lblInfoExec); + builder->get_widget("lblInfoPriority", lblInfoPriority); + builder->get_widget("lblInfoPriority", lblInfoEnterProg); + builder->get_widget("boxColor", boxColor); + builder->get_widget("lblGraphics", lblGraphics); + builder->get_widget("lblTools", lblTools); + builder->get_widget("lblInternet", lblInternet); + builder->get_widget("lblMultimedia", lblMultimedia); + builder->get_widget("lblSettings", lblSettings); + builder->get_widget("lblEducation", lblEducation); + builder->get_widget("lblOffice", lblOffice); + builder->get_widget("lblOther", lblOther); + builder->get_widget("lblDevelopment", lblDevelopment); + builder->get_widget("iconGraphics", iconGraphics); + + builder->get_widget("lblSystem", lblSystem); + + + + list_Graphics = Gtk::ListStore::create( m_Columns ); + list_Graphics->set_sort_column( m_Columns.m_col_description, Gtk::SORT_ASCENDING ); + + iconGraphics->set_model(list_Graphics); + iconGraphics->set_markup_column(m_Columns.m_col_description); + iconGraphics->set_pixbuf_column(m_Columns.m_col_pixbuf); + + + +} + +void MainWindow::add_CSS(){ + Glib::RefPtr cssProvider = Gtk::CssProvider::create(); + cssProvider->load_from_path(path_css); + Glib::RefPtr styleContext = Gtk::StyleContext::create(); + Glib::RefPtr screen = Gdk::Screen::get_default();//get default screen + styleContext->add_provider_for_screen(screen, cssProvider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);//add provider for screen in all application + Glib::RefPtr context_box = boxColor->get_style_context(); + Glib::RefPtr context_lbl_head = lblInfoHead->get_style_context(); + context_box->add_class("cssboxColor1"); + context_lbl_head->add_class("textHead"); +} + +void MainWindow::localization(){ + this->set_title(gettext("ublexec")); + btnStart->set_label(gettext("Run")); + wndChooseFileWallpaper->set_title(gettext("Please select File")); + dialogStartMenu->set_title(gettext("Warning!")); + lblInfoHead->set_text(gettext("Running applications as a user with a\n specified priority")); + lblinfoCmd->set_text(gettext("Command Line")); + lblInfoTime->set_text(gettext("Team:")); + labInfoExecutTerm->set_text(gettext("Run in the terminal emulator")); + lblInfoUser->set_text(gettext("User")); + lblInfoUserOther->set_text(gettext("Run as another user")); + lblInfoUserName->set_text(gettext("User Name:")); + lblInfoNooPriority->set_text(gettext("Priority:")); + lblInfoExec->set_text(gettext("Change startup priority")); + lblInfoPriority->set_text(gettext("Priority:")); + lblMessageError->set_text(gettext("Select an executable file or program")); + lblInfoEnterProg->set_text(gettext("Selecting Programs")); + lblGraphics->set_text(gettext("Graphics")); + lblTools->set_text(gettext("Tools")); + lblInternet->set_text(gettext("Internet")); + lblMultimedia->set_text(gettext("Multimedia")); + lblSettings->set_text(gettext("Settings")); + lblEducation->set_text(gettext("Education")); + lblOffice->set_text(gettext("Office")); + lblOther->set_text(gettext("Other")); + lblDevelopment->set_text(gettext("Development")); + lblSystem->set_text(gettext("System")); +} + +void MainWindow::event(){ + btnFilemaneg->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_filemaneg)); + btnListApp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_list_app)); + btnStart->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::start_cmd)); + cmbUser->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::changed_user)); + //chbTerminal->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::execute_terminal)); + chbAnotherUser->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::activ_or_block_other_user)); + spinPriority->signal_value_changed().connect(sigc::mem_fun(*this, &MainWindow::change_scale_priority)); + scalePriority->signal_value_changed().connect(sigc::mem_fun(*this, &MainWindow::change_spin_priority)); + btnFilemangerExit->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::close_filemaneg)); + btnFilemangerOk->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::get_path_filemaneg)); + cbxExecuteEpriority->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::activ_or_block_execute_epriority)); + btnMessageErrorOk->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::message_gui_close)); + btnStartMenuOK->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::start_menu_entry_app)); + btnStartMenuExit->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::close_start_menu)); +} +void MainWindow::settings(){ + this->pars_apps(); + this->builder = builder; + this->get_builder(); + this->event(); + this->localization(); + this->add_CSS(); + spinPriority->set_range(0,19); + spinPriority->set_increments(1.0,-1.0); + scalePriority->set_range(0,19); + scalePriority->set_value(0); + lblTimeEpriorityLow->set_text("19 (Низкий)"); + lblTime4EpriorityHigh->set_text("0 (Высокий)"); + scalePriority->set_inverted(true); + this->pars_dir_bin(); + this->pars_users(); + this->activ_or_block_execute_epriority(); + cmbUser->set_active(0); + cmbUser->set_sensitive(false); + lblInfoUserName->set_sensitive(false); + rbPkexec->set_sensitive(false); + rbSu->set_sensitive(false); + rbSudo->set_sensitive(false); + +} +void MainWindow::close_start_menu(){ + dialogStartMenu->hide(); +} + +void MainWindow::start_menu_entry_app(){} + +void MainWindow::message_gui_close(){ + messageError->hide(); +} + +void MainWindow::activ_or_block_execute_epriority(){ + bool flag = cbxExecuteEpriority->get_active(); + scalePriority->set_sensitive(flag); + spinPriority->set_sensitive(flag); + lblInfoNooPriority->set_sensitive(flag); + lblTimeEpriorityLow->set_sensitive(flag); + lblTime4EpriorityHigh->set_sensitive(flag); +} + +void MainWindow::open_filemaneg(){ + wndChooseFileWallpaper->show(); +} +void MainWindow::close_filemaneg(){ + wndChooseFileWallpaper->hide(); +} +void MainWindow::get_path_filemaneg(){ + path_file = wndChooseFileWallpaper->get_filename(); + if (path_file.length()==0){} + else{ + txtCmd->set_text(path_file); + this->close_filemaneg(); + } +} +void MainWindow::open_list_app(){ + + + //liststoreDevelopment = iconDevelopment->get_model(); + string path = ""; + for ( const auto &str_app : list_app){ + for ( const auto &str_categor : str_app.Categories){ + path = "/usr/share/applications/" + str_app.Icon + ".svg"; + if (str_categor=="Graphics"){ + Gtk::TreeModel::Row row = *(list_Graphics->append()); + row[m_Columns.m_col_filename] = path; + row[m_Columns.m_col_description] = str_app.Name; + } + else if (str_categor=="Tools"){ + + } + else if (str_categor=="Internet"){ + + } + else if (str_categor=="Multimedia"){ + + } + else if (str_categor=="Settings"){ + + } + else if (str_categor=="Education"){ + + } + else if (str_categor=="Office"){ + + } + else if (str_categor=="Other"){ + + } + else if (str_categor=="Development"){ + cout << str_categor << endl; + } + else if (str_categor=="System"){ + + } + + } + } + dialogStartMenu->show_all(); + +} +/* +void MainWindow::tmp_desktop(string cmd_name){ + string desktop = ""; + desktop = "[Desktop Entry]\nEncoding=UTF-8\nName=test\nName[ru]=тест\nGenericName=test\nGenericName[ru]=тест\nComment=test\nComment[ru]=test\nType=Application\nExec=pkexec "+cmd_name + + "\nIcon=ublexec\nTerminal=false\nCategories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;"; + string cmd = ""; + cmd = "touch /tmp/" + cmd_name + ".desktop; echo \"" + desktop + "\" > /tmp/"+cmd_name+".desktop; chmod +x /tmp/"+cmd_name+".desktop"; + cout << cmd << endl; + system(cmd.c_str()); +} +*/ + +void MainWindow::start_cmd(){ + //txtCmd->set_text(""); + string str_cmd_terminal=""; + string str_variants_root = ""; + string str_nice_cmd = ""; + string user_cmd = ""; + user_cmd = txtCmd->get_text(); + //========================================= + if (chbAnotherUser->get_active()){ + if (geteuid()!=0){ + chbTerminal->set_active(true); + } + if (rbPkexec->get_active()){ + + if ((chbAnotherUser->get_active()) && (cmbUser->get_active_text().length()==0)) { + str_variants_root = "pkexec env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; + //this->tmp_desktop(user_cmd); + + } + else if (chbAnotherUser->get_active()){ + str_variants_root = "pkexec --user " + cmbUser->get_active_text() + " env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; + + } + else{ + str_variants_root = "pkexec env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; + //this->tmp_desktop(user_cmd); + //user_cmd = "/tmp/" + user_cmd + ".desktop"; + } + } + else if (rbSu->get_active()){ + if ((chbAnotherUser->get_active()) && (cmbUser->get_active_text().length()==0)) { + str_variants_root="su "; + } + else if (chbAnotherUser->get_active()){ + str_variants_root="su --user " + cmbUser->get_active_text() + " "; + } + else{ + str_variants_root="su" ; + } + } + else if (rbSudo->get_active()){ + if ((chbAnotherUser->get_active()) && (cmbUser->get_active_text().length()==0)) { + str_variants_root="sudo "; + } + else if (chbAnotherUser->get_active()){ + str_variants_root="sudo --user " + cmbUser->get_active_text() + " "; + } + else{ + str_variants_root="sudo "; + } + } + } + if (cbxExecuteEpriority->get_active()){ + str_nice_cmd = "nice -n " + to_string(spinPriority->get_value_as_int()) + " "; + } + + //========================================= + + //========================================= + if (user_cmd.length()==0){ + messageError->show(); + } + + if (chbTerminal->get_active()){ + str_cmd_terminal=" xterm -e "; + } + else{ + str_cmd_terminal=""; + } + string cmd = ""; + if (path_file!=""){ + + cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + " xdg-open '" + user_cmd + "' &"; + } + else{ + + cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + user_cmd + " &"; + } + txtCmd->set_text(cmd); + system(cmd.c_str()); + + path_file_name=""; + path_file=""; +} +void MainWindow::changed_user(){ + Glib::ustring entry_user = cmbUser->get_active_text(); + if (geteuid()==0 || entry_user == "root"){ + spinPriority->set_range(-20,19); + spinPriority->set_increments(1.0,-1.0); + scalePriority->set_range(-20,19); + scalePriority->set_value(0); + lblTimeEpriorityLow->set_text("19 (Низкий)"); + lblTime4EpriorityHigh->set_text("-20 (Высокий)"); + } + else{ + spinPriority->set_range(0,19); + spinPriority->set_increments(1.0,-1.0); + scalePriority->set_range(0,19); + scalePriority->set_value(0); + lblTimeEpriorityLow->set_text("19 (Низкий)"); + lblTime4EpriorityHigh->set_text("0 (Высокий)"); + } +} +//void MainWindow::execute_terminal(){} +//void MainWindow::execute_another_User(){} +void MainWindow::activ_or_block_other_user(){ + bool flag = chbAnotherUser->get_active(); + cmbUser->set_active(0); + cmbUser->set_sensitive(flag); + lblInfoUserName->set_sensitive(flag); + //lblInfoUserOther->set_sensitive(flag); + + if (flag_pkexec==true){ + rbPkexec->set_sensitive(flag); + } + if (flag_su==true){ + rbSu->set_sensitive(flag); + } + if (flag_sudo==true){ + rbSudo->set_sensitive(flag); + } +} +void MainWindow::change_scale_priority(){ + scalePriority->set_value(spinPriority->get_value_as_int()); +} +void MainWindow::change_spin_priority(){ + spinPriority->set_value(scalePriority->get_value()); +} +void MainWindow::pars_dir_bin(){ + namespace fs = std::filesystem; + std::string path = "/bin"; + string file_name = ""; + for (const auto & entry : fs::directory_iterator(path)){ + file_name = entry.path().filename().string(); + if (file_name=="su"){ + flag_su=true; + } + else if (file_name=="sudo"){ + flag_sudo=true; + } + else if (file_name=="pkexec"){ + flag_pkexec=true; + } + } + rbPkexec->set_sensitive(flag_pkexec); + rbSu->set_sensitive(flag_su); + rbSudo->set_sensitive(flag_sudo); +} +void MainWindow::pars_users(){ + while (true) { + errno = 0; // so we can distinguish errors from no more entries + passwd* entry = getpwent(); + if (!entry) { + if (errno) { + break; + } + break; + } + + if (entry->pw_uid>=1000 && entry->pw_uid!=65534){ + cmbUser->append(entry->pw_name); + } + } + + cmbUser->append("root"); + endpwent(); +} + +vector MainWindow::split(const std::string &s, char delim) { + std::stringstream ss(s); + std::string item; + std::vector elems; + while (std::getline(ss, item, delim)) { + elems.push_back(item); + // elems.push_back(std::move(item)); // if C++11 (based on comment from @mchiasson) + } + return elems; +} + +void MainWindow::pars_apps(){ + if (list_app.size()!=0){return;} + namespace fs = std::filesystem; + struct struct_App App; + string file_name = ""; + string str_Categories; + string path = "/usr/share/applications/"; + for (const auto & entry : fs::directory_iterator(path)){ + file_name = entry.path().filename().string(); + path = "/usr/share/applications/"+file_name; + if (file_name.find(".desktop")!=std::string::npos){ + GKeyFile *gfile=g_key_file_new(); + g_key_file_load_from_file(gfile,path.c_str(),G_KEY_FILE_KEEP_TRANSLATIONS,NULL); + char *Type=g_key_file_get_string(gfile,"Desktop Entry", "Type",NULL); + char *Name=g_key_file_get_locale_string(gfile,"Desktop Entry","Name",setlocale(LC_ALL,NULL),NULL); + char *Exec=g_key_file_get_string(gfile,"Desktop Entry", "Exec",NULL); + char *Categories=g_key_file_get_locale_string(gfile,"Desktop Entry", "Categories",setlocale(LC_ALL,""),NULL); + char *Icon=g_key_file_get_string(gfile,"Desktop Entry", "Icon",NULL); + char *Mime=g_key_file_get_string(gfile,"Desktop Entry", "MimeType",NULL); + if (Type==NULL) continue; + if (Name==NULL) continue; + if (Exec==NULL) continue; + if (Categories==NULL) continue; + if (Icon==NULL) continue; + str_Categories = Categories; + App.Name = Name; + App.Type = Type; + App.Exec = Exec; + App.Icon = Name; + if (Mime!=NULL){ + App.MimeType = Mime; + cout << App.MimeType << endl; + } + else{ + App.MimeType = ""; + } + App.Name_desktop = file_name; + App.Categories = split(str_Categories, ';'); + for ( const auto &text : App.Categories){ + set_categories.insert(text); + + } + + } + list_app.push_back(App); + } +} +SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr builder) + : Gtk::Plug{p_socketID} { + MainWindow* wnd = nullptr; + builder->get_widget_derived("window", wnd); + builder->get_widget("plugBox", plugBox); + plugBox->get_parent()->remove(*plugBox); + add(*plugBox); + show_all_children(); +} + + + + + diff --git a/source/ublexec.h b/source/ublexec.h new file mode 100644 index 0000000..f631439 --- /dev/null +++ b/source/ublexec.h @@ -0,0 +1,201 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +extern string path_app; +extern string app_name; +extern string path_glade; +extern string path_css; + + +class CmdArgParser : public Glib::OptionGroup +{ + +public: + + CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help); + + ::Window GetSocketID() const; + +private: + + int m_socketID = 0; + +}; + +// This is what is going to be plugged into xfce4-settings-manager: +// +// Documented here: +// +// https://developer.gnome.org/gtkmm-tutorial/3.22/sec-plugs-sockets-example.html.en +// +class MainWindow : public Gtk::ApplicationWindow { +public: + MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder); + MainWindow(Glib::RefPtr const& builder); + void get_builder(); + void add_CSS(); + void localization(); + void event(); + void settings(); + void close_start_menu(); + void start_menu_entry_app(); + void message_gui_close(); + void activ_or_block_execute_epriority(); + void open_filemaneg(); + void close_filemaneg(); + void get_path_filemaneg(); + void open_list_app(); + void start_cmd(); + void changed_user(); + void execute_terminal(){} + void execute_another_User(){} + void activ_or_block_other_user(); + void change_scale_priority(); + void change_spin_priority(); + void pars_dir_bin(); + void pars_users(); + void pars_apps(); + void tmp_desktop(string cmd_name); + vector split(const std::string &s, char delim); + + public: + class ModelColumns : public Gtk::TreeModel::ColumnRecord + { + public: + + ModelColumns() + { + add(m_col_filename); + add(m_col_description); + add(m_col_pixbuf); + } + + Gtk::TreeModelColumn m_col_filename; + Gtk::TreeModelColumn m_col_description; + Gtk::TreeModelColumn > m_col_pixbuf; + }; + + ModelColumns m_Columns; + public: + Glib::RefPtr builder; + Gtk::Button *btnFilemaneg; + Gtk::Button *btnListApp; + Gtk::Button *btnStart; + Gtk::CheckButton *chbTerminal; + Gtk::CheckButton *chbAnotherUser; + Gtk::CheckButton *cbxExecuteEpriority; + Gtk::ComboBoxText *cmbUser; + Gtk::SpinButton *spinPriority; + Gtk::Scale *scalePriority; + Gtk::RadioButton *rbPkexec; + Gtk::RadioButton *rbSu; + Gtk::RadioButton *rbSudo; + Gtk::Entry *txtCmd; + Gtk::FileChooserDialog *wndChooseFileWallpaper; + Gtk::Button *btnFilemangerExit; + Gtk::Button *btnFilemangerOk; + Gtk::Label *lblTimeEpriority; + Gtk::Label *lblTimeEpriorityLow; + Gtk::Label *lblTime4EpriorityHigh; + Gtk::Label *lblUserName; + Gtk::MessageDialog *messageError; + Gtk::Button *btnMessageErrorOk; + Gtk::Label *lblMessageError; + Gtk::Button *btnStartMenuOK; + Gtk::Button *btnStartMenuExit; + Gtk::Box *boxlistProgramm; + Gtk::Dialog *dialogStartMenu; + Gtk::Box *boxColor; + Gtk::Label *lblInfoHead; + Gtk::Label *lblinfoCmd; + Gtk::Label *lblInfoTime; + Gtk::Label *labInfoExecutTerm; + Gtk::Label *lblInfoUser; + Gtk::Label *lblInfoUserOther; + Gtk::Label *lblInfoUserName; + Gtk::Label *lblInfoNooPriority; + Gtk::Label *lblInfoExec; + Gtk::Label *lblInfoPriority; + Gtk::Label *lblInfoEnterProg; + + Gtk::Label *lblGraphics; + Gtk::Label *lblTools; + Gtk::Label *lblInternet; + Gtk::Label *lblMultimedia; + Gtk::Label *lblSettings; + Gtk::Label *lblEducation; + Gtk::Label *lblOffice; + Gtk::Label *lblOther; + Gtk::Label *lblDevelopment; + Gtk::Label *lblSystem; + Gtk::IconView *iconGraphics; + + + Glib::RefPtr list_Graphics; + + + + + public: + string execute_cmd = ""; + string path_file = ""; + bool flag_pkexec = false; + bool flag_su = false; + bool flag_sudo = false; + string path_file_name; + struct struct_App{ + string Name_desktop; + string Name; + string Exec; + string Icon; + string MimeType; + string Type; + vector Categories; + }; + list list_app; + set set_categories; + + +}; + +class SettingsPlug : public Gtk::Plug{ +public: + Gtk::Window *window; + SettingsPlug(::Window p_socketID, Glib::RefPtr builder); + +private: + Gtk::Widget *plugBox; + Gtk::Widget *parent; +}; + + diff --git a/style.css b/style.css new file mode 100644 index 0000000..d237a01 --- /dev/null +++ b/style.css @@ -0,0 +1,6 @@ +.cssboxColor1{ + background: url("/usr/share/ublexec/images/bg_top.png") no-repeat; +} +.textHead{ + text-shadow: 1px 1px #ffffff; +} \ No newline at end of file diff --git a/ublexec.desktop b/ublexec.desktop new file mode 100644 index 0000000..afa9126 --- /dev/null +++ b/ublexec.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=ublexec +Name[ru]=Выполнить +GenericName=Execution from user rights +GenericName[ru]=Выполнить +Comment=Execution from user rights +Comment[ru]=Выполнить +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 diff --git a/ublexec.glade b/ublexec.glade new file mode 100644 index 0000000..5da0d4d --- /dev/null +++ b/ublexec.glade @@ -0,0 +1,1417 @@ + + + + + + -20 + 19 + 1 + 10 + + + 250 + 250 + False + dialog + + + False + vertical + 2 + + + False + end + + + ОК + True + True + True + + + True + True + 0 + + + + + Выход + True + True + True + + + True + True + 1 + + + + + False + False + 0 + + + + + True + False + vertical + + + True + False + Выбор программ + + + False + True + 0 + + + + + True + True + in + + + True + False + + + True + False + vertical + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Графика + + + False + True + 0 + + + + + True + True + 6 + + + False + True + 1 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Инструменты + + + False + True + 2 + + + + + True + True + + + + + + False + True + 3 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Интернет + + + False + True + 4 + + + + + True + True + + + + + + False + True + 5 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Мультимедиа + + + False + True + 6 + + + + + True + True + + + + + + False + True + 7 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Настройки + + + False + True + 8 + + + + + True + True + + + + + + False + True + 9 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Образование + + + False + True + 10 + + + + + True + True + + + + + + False + True + 11 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Офис + + + False + True + 12 + + + + + True + True + + + + + + False + True + 13 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Прочие + + + False + True + 14 + + + + + True + True + + + + + + False + True + 15 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Разработка + + + False + True + 16 + + + + + True + True + + + + + + False + True + 17 + + + + + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Система + + + False + True + 18 + + + + + True + True + + + + + + False + True + 19 + + + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + gtk-media-play + + + False + Выполнить + + + True + False + vertical + + + True + False + vertical + + + 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 + Запуск приложений от имени пользователя с +указанным приоритетом + + + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 0.019999999552965164 + in + + + True + False + 5 + 5 + vertical + + + True + False + + + 145 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Команда: + True + 0 + + + False + True + 0 + + + + + 330 + True + True + Дата +Формат: ДД.ММ.ГГГГ + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 1 + + + + + True + True + True + end + 5 + 5 + 6 + 6 + + + True + False + center + center + 5 + 5 + 5 + 5 + 6 + 6 + gtk-directory + + + + + False + True + 2 + + + + + True + True + True + end + 5 + 5 + 5 + 5 + 6 + 6 + + + True + False + center + center + 5 + 5 + 5 + 5 + 6 + 6 + edit-select-all + + + + + False + True + 3 + + + + + False + True + 0 + + + + + True + False + 6 + 6 + + + 131 + True + False + 15 + 5 + 15 + 5 + + + False + True + 0 + + + + + True + True + False + start + center + 5 + 5 + 5 + 5 + 6 + True + + + True + False + Выполнить в эмуляторе терминале + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + Командная строка + + + + + False + True + 0 + + + + + False + True + 1 + + + + + True + False + 5 + vertical + + + True + False + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + 5 + vertical + + + True + False + + + True + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + True + + + True + False + Выполнить от имени другого пользователя + + + + + False + True + 0 + + + + + pkexec + True + True + False + True + rbSu + + + False + True + 1 + + + + + su + True + True + False + True + rbPkexec + + + False + True + 2 + + + + + sudo + True + True + False + True + rbSu + + + False + True + 3 + + + + + 95 + True + False + end + 15 + 5 + 15 + 5 + + + False + True + 4 + + + + + False + True + 0 + + + + + True + False + + + 145 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Имя поьзователя: + True + 0 + + + False + True + 0 + + + + + 330 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + Пользователь + + + + + False + True + 0 + + + + + False + True + 2 + + + + + True + False + 5 + vertical + + + True + False + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + 5 + vertical + + + True + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + True + + + True + False + Изменить приоритет запуска + + + + + False + True + 0 + + + + + True + False + + + 5 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Приоритет: + True + 0 + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + adjustment1 + 20 + 0 + 0 + + + True + True + 1 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + True + + + False + True + 2 + + + + + False + True + 1 + + + + + True + False + + + 65 + True + False + 15 + 5 + 15 + 5 + 0 + + + False + True + 0 + + + + + 145 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 19 (Низкий) + True + 0 + + + False + True + 1 + + + + + True + False + end + center + 5 + 5 + 5 + 5 + 6 + 6 + -20 (Высокий) + True + 0 + + + True + True + 3 + + + + + 95 + True + False + end + 15 + 5 + 15 + 5 + + + False + True + 4 + + + + + False + True + 2 + + + + + + + True + False + Приоритет + + + + + False + True + 0 + + + + + False + True + 3 + + + + + Запустить + True + True + True + 5 + 5 + 5 + 5 + 6 + 6 + image1 + True + + + False + True + 4 + + + + + True + True + 0 + + + + + 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 + Выберите исполняемый файл или программу + + + True + True + 2 + + + + + + + False + Пожалуйста выберите Файл + True + center + 500 + 400 + True + dialog + True + True + + + False + vertical + 2 + + + False + end + + + gtk-cancel + True + True + True + True + + + True + True + 0 + + + + + gtk-ok + True + True + True + True + + + True + True + 1 + + + + + False + False + 0 + + + + + + + + + diff --git a/ublexec.svg b/ublexec.svg new file mode 100644 index 0000000..0ec751a --- /dev/null +++ b/ublexec.svg @@ -0,0 +1,5680 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ublexec_ru.po b/ublexec_ru.po new file mode 100644 index 0000000..b718cd2 --- /dev/null +++ b/ublexec_ru.po @@ -0,0 +1,106 @@ +# English translations for PACKAGE package. +# Copyright (C) 2023 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Automatically generated, 2023. +# +msgid "" +msgstr "" + +msgid "System" +msgstr "Система" + +msgid "Development" +msgstr "Разработка" + +msgid "Other" +msgstr "Прочие" + +msgid "Office" +msgstr "Офис" + +msgid "Education" +msgstr "Образование" + +msgid "Settings" +msgstr "Настройки" + +msgid "Multimedia" +msgstr "Мультимедиа" + +msgid "Internet" +msgstr "Интернет" + +msgid "Tools" +msgstr "Инструменты" + +msgid "Graphics" +msgstr "Графика" + +msgid "ОК" +msgstr "ОК" + +msgid "Exit" +msgstr "Выход" + +msgid "Selecting Programs" +msgstr "Выбор программ" + +msgid "Running applications as a user with a\n specified priority" +msgstr "Запуск приложений от имени пользователя с\n указанным приоритетом" + +msgid "Team:" +msgstr "Команда:" + +msgid "Run in the terminal emulator" +msgstr "Выполнить в эмуляторе терминале" + +msgid "Command Line" +msgstr "Командная строка" + +msgid "Run as another user" +msgstr "Выполнить от имени другого пользователя" + +msgid "pkexec" +msgstr "pkexec" + +msgid "su" +msgstr "su" + +msgid "sudo" +msgstr "sudo" + +msgid "User Name:" +msgstr "Имя поьзователя:" + +msgid "User" +msgstr "Пользователь" + +msgid "Change startup priority" +msgstr "Изменить приоритет запуска" + +msgid "Priority:" +msgstr "Приоритет:" + +msgid "19 (Low)" +msgstr "19 (Низкий)" + +msgid "-20 (High)" +msgstr "-20 (Высокий)" + +msgid "Priority" +msgstr "Приоритет" + +msgid "Run" +msgstr "Запустить" + +msgid "Select an executable file or program" +msgstr "Выберите исполняемый файл или программу" + +msgid "Please select File" +msgstr "Пожалуйста выберите Файл" + +msgid "Warning!" +msgstr "Внимание!" + +msgid "ublexec" +msgstr "Выполнить"