parent
55acf27919
commit
dd77ed99b3
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@
|
|||||||
|
ubl-settings-bootloader.glade~
|
||||||
|
test.cpp
|
||||||
|
.vscode
|
||||||
|
ubl-settings-bootloader
|
||||||
@ -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 = ubl-settings-bootloader
|
||||||
|
|
||||||
|
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"
|
||||||
@ -1,2 +1,31 @@
|
|||||||
# ubl-settings-bootloader
|
# ubl-settings-bootloader
|
||||||
|
# Настройка grub
|
||||||
|
[RU] Утилита для настройки grub
|
||||||
|
|
||||||
|
Utility for setting the grub
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
# Build
|
||||||
|
In order to build ubl-settings-bootloader 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
|
||||||
|
```
|
||||||
|
|||||||
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 136 KiB |
@ -0,0 +1,28 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.7)
|
||||||
|
project(ubl-settings-bootloader)
|
||||||
|
|
||||||
|
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 -g")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \
|
||||||
|
-O2 -pipe -fno-plt -fexceptions \
|
||||||
|
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
|
||||||
|
-fstack-clash-protection -fcf-protection -g")
|
||||||
|
|
||||||
|
set(SOURCE_FILES
|
||||||
|
main.cc
|
||||||
|
ubl-settings-bootloader.cc
|
||||||
|
ubl-settings-bootloader.h)
|
||||||
|
|
||||||
|
set(LIBRARIES
|
||||||
|
${GTK_LIBRARIES}
|
||||||
|
pthread)
|
||||||
|
|
||||||
|
add_executable(ubl-settings-bootloader ${SOURCE_FILES})
|
||||||
|
target_link_libraries(ubl-settings-bootloader ${LIBRARIES})
|
||||||
|
install(TARGETS ubl-settings-bootloader DESTINATION bin)
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
#include "ubl-settings-bootloader.h"
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
string str_cmd_argv = "";
|
||||||
|
for (int i=1; i<argc; i++){
|
||||||
|
str_cmd_argv+= to_string(*argv[i]) + " ";
|
||||||
|
}
|
||||||
|
if (geteuid()!=0){
|
||||||
|
//string cmd = "pkexec " + app_name + " " + str_cmd_argv;
|
||||||
|
//system(cmd.c_str());
|
||||||
|
//return 0;
|
||||||
|
}
|
||||||
|
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug");
|
||||||
|
auto builder = Gtk::Builder::create_from_file(path_glade);
|
||||||
|
bindtextdomain("ubl-settings-bootloader", "/usr/share/locale/");
|
||||||
|
bind_textdomain_codeset("ubl-settings-bootloader", "UTF-8");
|
||||||
|
textdomain("ubl-settings-bootloader");
|
||||||
|
if (argc!=1){
|
||||||
|
Glib::init();
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
|
Glib::OptionContext context;
|
||||||
|
|
||||||
|
CmdArgParser parser{
|
||||||
|
"Socket ID",
|
||||||
|
"Command line argument for socket ID communication.",
|
||||||
|
"No help available, sorry"
|
||||||
|
};
|
||||||
|
|
||||||
|
context.set_main_group(parser);
|
||||||
|
context.parse(argc, argv);
|
||||||
|
|
||||||
|
::Window socketID = parser.GetSocketID();
|
||||||
|
|
||||||
|
// Handle plug:
|
||||||
|
SettingsPlug plug{socketID, builder};
|
||||||
|
plug.show();
|
||||||
|
|
||||||
|
app->run(plug);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MainWindow* wnd = nullptr;
|
||||||
|
builder->get_widget_derived("window", wnd);
|
||||||
|
auto r = app->run(*wnd);
|
||||||
|
delete wnd;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
.cssboxColor1{
|
||||||
|
background: url("/usr/share/ublexec/images/bg_top.png") no-repeat;
|
||||||
|
}
|
||||||
|
.textHead{
|
||||||
|
text-shadow: 1px 1px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Encoding=UTF-8
|
||||||
|
Name=ubl-settings-bootloader
|
||||||
|
Name[ru]=Загрузчик
|
||||||
|
GenericName=Загрузчик
|
||||||
|
GenericName[ru]=Загрузчик
|
||||||
|
Comment=ubl-settings-bootloader
|
||||||
|
Comment[ru]=Загрузчик
|
||||||
|
Type=Application
|
||||||
|
Exec=ubl-settings-bootloader
|
||||||
|
Icon=ubl-settings-bootloader
|
||||||
|
Terminal=false
|
||||||
|
X-XfcePluggable=true
|
||||||
|
Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;X-UBL-SettingsManager;X-UBL-SystemSettings;
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,116 @@
|
|||||||
|
# Russian 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 ""
|
||||||
|
"Project-Id-Version: ubconfig 1.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: info@ublinux.ru\n"
|
||||||
|
"POT-Creation-Date: 2020-02-22 23:22+0600\n"
|
||||||
|
"PO-Revision-Date: 2020-02-22 23:28+0600\n"
|
||||||
|
"Last-Translator: ublinux <info@ublinux.ru>\n"
|
||||||
|
"Language-Team: Russian - UBLinux Team <info@ublinux.ru>\n"
|
||||||
|
"Language: Russian\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
msgid "Configuring the boot loader settings"
|
||||||
|
msgstr "Настройка параметров загрузчика системы"
|
||||||
|
|
||||||
|
msgid "UBConfig - Loading"
|
||||||
|
msgstr "UBConfig - Загрузка"
|
||||||
|
|
||||||
|
msgid "Configuring system boot parameters"
|
||||||
|
msgstr "Настройка параметров загрузки системы"
|
||||||
|
|
||||||
|
msgid "Setting bootloader"
|
||||||
|
msgstr "Настройка загрузчика"
|
||||||
|
|
||||||
|
msgid "Project Home Page"
|
||||||
|
msgstr "Домашняя страница проекта"
|
||||||
|
|
||||||
|
msgid "Download menu"
|
||||||
|
msgstr "Меню загрузки"
|
||||||
|
|
||||||
|
msgid "Load variant selection timer"
|
||||||
|
msgstr "Таймер выбора варианта загрузки"
|
||||||
|
|
||||||
|
msgid "Seconds"
|
||||||
|
msgstr "Секунд"
|
||||||
|
|
||||||
|
msgid "Default download"
|
||||||
|
msgstr "Загрузка по умолчанию:"
|
||||||
|
|
||||||
|
msgid "The last selection will become the default boot choice"
|
||||||
|
msgstr "Последний выбор станет выбором загрузки по умолчанию"
|
||||||
|
|
||||||
|
msgid "Parameters passed to the kernel"
|
||||||
|
msgstr "Параметры, передаваемые ядру"
|
||||||
|
|
||||||
|
msgid "quiet (Downloading without text messages)"
|
||||||
|
msgstr "quiet (Загрузка без текстовых сообщений)"
|
||||||
|
|
||||||
|
msgid "splash (Show welcome window)"
|
||||||
|
msgstr "splash (Показать окно приветствия)"
|
||||||
|
|
||||||
|
msgid "no plymouth (Disable Plymouth)"
|
||||||
|
msgstr "no plymouth (Отключить Plymouth"
|
||||||
|
|
||||||
|
msgid "acpi=off (Disable ACPI)"
|
||||||
|
msgstr "acpi=off (Отключить ACPI)"
|
||||||
|
|
||||||
|
msgid "apic (Disable APIC)"
|
||||||
|
msgstr "apic (Отключить APIC)"
|
||||||
|
|
||||||
|
msgid "nolapic (Disable local APIC)"
|
||||||
|
msgstr "nolapic (Отключить локальный APIC)"
|
||||||
|
|
||||||
|
msgid "single (Single User Mode)"
|
||||||
|
msgstr "single (Однопользовательский режим)"
|
||||||
|
|
||||||
|
msgid "nomodeset (Disable kernel selection and loading of video drivers)"
|
||||||
|
msgstr "nomodeset (Отключите выбор ядра и загрузку видеодрайверов)"
|
||||||
|
|
||||||
|
msgid "i915.enable_dc=0 (Disable GPU power management)"
|
||||||
|
msgstr "i915.enable_dc=0 (Отключите управление питанием GPU)"
|
||||||
|
|
||||||
|
msgid "ahci.mobile_jpm_policy=1 (Maximum performance, power management)"
|
||||||
|
msgstr "ahci.mobile_jpm_policy=1 (Максимальная производительность, управление питанием)"
|
||||||
|
|
||||||
|
msgid "snd-intel-dspcfg.dsp_driver=1 (Forced selection of a sound device driver from Intel)"
|
||||||
|
msgstr "snd-intel-dspcfg.dsp_driver=1 (Принудительный выбор драйвера звукового устройства от Intel)"
|
||||||
|
|
||||||
|
msgid "intel_idle max_cstate=1 (Prevents the processor from going into a deep sleep state)"
|
||||||
|
msgstr "intel_idle max_cstate=1 (Предотвращает переход процессора в состояние глубокого сна)"
|
||||||
|
|
||||||
|
msgid "intel_idle.max_cstate=4 (Eliminates flickering laptop display on processors Ultra Voltage)"
|
||||||
|
msgstr "intel_idle.max_cstate=4 (Устраняет мерцание дисплея ноутбука на процессорах Ultra Voltage)"
|
||||||
|
|
||||||
|
msgid "Command line parameters:"
|
||||||
|
msgstr "Параметры командной строки:"
|
||||||
|
|
||||||
|
msgid "serial (Serial terminal)"
|
||||||
|
msgstr "serial (Последовательный терминал)"
|
||||||
|
|
||||||
|
msgid "at_keyboard (Keyboard PC AT (Coreboot))"
|
||||||
|
msgstr "at_keyboard (Клавиатура PC AT (Coreboot))"
|
||||||
|
|
||||||
|
msgid "usb_keyboard (Keyboard USB Keyboard (protocol HID Boot))"
|
||||||
|
msgstr "usb_keyboard (Клавиатура USB Keyboard (protocol HID Boot))"
|
||||||
|
|
||||||
|
msgid "Output terminal"
|
||||||
|
msgstr "Выходной терминал"
|
||||||
|
|
||||||
|
msgid "console (PC BIOS & console EFI)"
|
||||||
|
msgstr "Консоль (PC BIOS & console EFI)"
|
||||||
|
|
||||||
|
msgid "ofconsole (Console Open Firmware)"
|
||||||
|
msgstr "ofconsole (Консоль Open Firmware)"
|
||||||
|
|
||||||
|
msgid "gfxterm (Output in graphical mode)"
|
||||||
|
msgstr "gfxterm (Вывод в графическом режиме)"
|
||||||
|
|
||||||
|
msgid "vga_text (Text output VGA (Coreboot))"
|
||||||
|
msgstr "vga_text (Текстовый вывод VGA (Coreboot))"
|
||||||
Loading…
Reference in new issue