diff --git a/README.md b/README.md index 6fbb96d..22e964d 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ Additional information TODO (wish list) ---------------- -* add helper polkit-qt integration ? -* test several profiles support +* remove suid bit from helper (polkit/logind/etc) +* option descriptions to /etc/netctlgui-helper.conf Links ----- diff --git a/sources/gui/bash-completions b/sources/gui/bash-completions index ee9efc2..934e9ba 100644 --- a/sources/gui/bash-completions +++ b/sources/gui/bash-completions @@ -18,7 +18,7 @@ # variables _netctl_gui_arglist=( - '--daemon' + '--detached' '--maximized' '--minimized' '--about' diff --git a/sources/gui/netctl-gui.1 b/sources/gui/netctl-gui.1 index d25dc22..d5b3c54 100644 --- a/sources/gui/netctl-gui.1 +++ b/sources/gui/netctl-gui.1 @@ -1,4 +1,4 @@ -.TH netctl-gui 1 "@CURRENT_DATE@" "version @PROJECT_VERSION@" "USER COMMANDS" +.TH netctl-gui 1 "@CURRENT_DATE@" "version @PROJECT_VERSION@" "General Commands Manual" .SH NAME netctl-gui is a graphical interface for netctl .SH SYNOPSIS @@ -10,8 +10,8 @@ is a project which provides graphical user interface for .B netctl written on C++ using Qt toolkit. It provides shared library and DBus API (through helper daemon) and Plasmoid and DataEngine for KDE. .SH OPTIONS -.IP "--daemon" -run as daemon +.IP "--detached" +run detached from console .IP "--maximized" run maximized .IP "--minimized" @@ -64,6 +64,7 @@ Configuration file .RE .SH SEE ALSO .BR netctlgui-helper (1) +.BR netctlgui-helper.conf (5) .SH STANDARDS See .B @CMAKE_INSTALL_PREFIX@/share/doc/netctl-gui/netctl-gui-dbus-api.html diff --git a/sources/gui/src/main.cpp b/sources/gui/src/main.cpp index b2513af..9c19fff 100644 --- a/sources/gui/src/main.cpp +++ b/sources/gui/src/main.cpp @@ -63,15 +63,15 @@ int main(int argc, char *argv[]) QMap args = getArgs(); // reading for (int i=1; i args) createActions(); // tray - if (isDaemon) - return; if ((QSystemTrayIcon::isSystemTrayAvailable()) && (configuration[QString("SYSTRAY")] == QString("true"))) trayIcon->setVisible(true); @@ -374,9 +372,9 @@ void MainWindow::updateConfiguration(const QMap args) hide(); else show(); - if (args[QString("minimized")].toInt() == 2) + if (args[QString("minimized")].toInt() == 1) show(); - else if (args[QString("minimized")].toInt() == 3) + else if (args[QString("minimized")].toInt() == 2) hide(); } else diff --git a/sources/gui/src/mainwindow.cpp b/sources/gui/src/mainwindow.cpp index 8199bcd..52950b7 100644 --- a/sources/gui/src/mainwindow.cpp +++ b/sources/gui/src/mainwindow.cpp @@ -70,10 +70,6 @@ MainWindow::MainWindow(QWidget *parent, if (debug) qDebug() << PDEBUG << ":" << "settings" << args[QString("settings")].toBool(); if (debug) qDebug() << PDEBUG << ":" << "tab" << args[QString("tab")].toInt(); - if (args[QString("minimized")].toInt() == 1) - isDaemon = true; - else - isDaemon = false; updateConfiguration(args); // main actions diff --git a/sources/gui/src/mainwindow.h b/sources/gui/src/mainwindow.h index 97ccb2b..d4061dd 100644 --- a/sources/gui/src/mainwindow.h +++ b/sources/gui/src/mainwindow.h @@ -165,7 +165,6 @@ private: QString configPath; bool debug = false; bool hiddenNetwork; - bool isDaemon = false; bool useHelper = true; QTranslator *qtTranslator = nullptr; QTranslator *translator = nullptr; diff --git a/sources/gui/src/messages.cpp b/sources/gui/src/messages.cpp index a92b542..fcb5d3e 100644 --- a/sources/gui/src/messages.cpp +++ b/sources/gui/src/messages.cpp @@ -35,6 +35,7 @@ QMap getArgs() { QMap args; // windows + args[QString("detached")] = false; args[QString("minimized")] = (int) 0; args[QString("about")] = false; args[QString("auto")] = false; @@ -67,8 +68,8 @@ QString helpMessage() helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Options:")); // windows helpMessage += QString(" %1\n").arg(QApplication::translate("MainWindow", "Open window:")); - helpMessage += QString(" --daemon - %1\n") - .arg(QApplication::translate("MainWindow", "start as daemon")); + helpMessage += QString(" --detached - %1\n") + .arg(QApplication::translate("MainWindow", "start detached from console")); helpMessage += QString(" --maximized - %1\n") .arg(QApplication::translate("MainWindow", "start maximized")); helpMessage += QString(" --minimized - %1\n") diff --git a/sources/gui/zsh-completions b/sources/gui/zsh-completions index a2b22e0..195caca 100644 --- a/sources/gui/zsh-completions +++ b/sources/gui/zsh-completions @@ -19,7 +19,7 @@ # variables _netctl_gui_arglist=( - {'--daemon','--daemon'}'[start as daemon]' + {'--detached','--detached'}'[start detached from console]' {'--maximized','--maximized'}'[start maximized]' {'--minimized','--minimized'}'[start minimized to tray]' {'--about','--about'}'[show about window]' diff --git a/sources/helper/CMakeLists.txt b/sources/helper/CMakeLists.txt index 8da671c..ec45e48 100644 --- a/sources/helper/CMakeLists.txt +++ b/sources/helper/CMakeLists.txt @@ -17,12 +17,16 @@ set (HEADERS "") add_subdirectory (${SUBPROJECT_SOURCE_DIR}) # build man file (GLOB SUBPROJECT_MAN_IN *.1) +file (GLOB SUBPROJECT_MAN5_IN *.5) file (RELATIVE_PATH SUBPROJECT_MAN ${CMAKE_SOURCE_DIR} ${SUBPROJECT_MAN_IN}) +file (RELATIVE_PATH SUBPROJECT_MAN5 ${CMAKE_SOURCE_DIR} ${SUBPROJECT_MAN5_IN}) configure_file (${SUBPROJECT_MAN_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MAN}) +configure_file (${SUBPROJECT_MAN5_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MAN5}) install (FILES org.netctlgui.helper.conf DESTINATION ${DBUS_SYSTEMCONF_PATH}) install (FILES netctlgui-helper.conf DESTINATION /etc) install (FILES netctlgui-helper.service DESTINATION ${SYSTEMD_SERVICE_PATH}) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MAN} DESTINATION share/man/man1/) +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MAN5} DESTINATION share/man/man5/) install (FILES bash-completions DESTINATION share/bash-completion/completions/ RENAME ${SUBPROJECT}) install (FILES zsh-completions DESTINATION share/zsh/site-functions/ RENAME _${SUBPROJECT}) diff --git a/sources/helper/netctlgui-helper.1 b/sources/helper/netctlgui-helper.1 index 2d11b24..3274859 100644 --- a/sources/helper/netctlgui-helper.1 +++ b/sources/helper/netctlgui-helper.1 @@ -1,4 +1,4 @@ -.TH netctlgui-helper 1 "@CURRENT_DATE@" "version @PROJECT_VERSION@" "USER COMMANDS" +.TH netctlgui-helper 1 "@CURRENT_DATE@" "version @PROJECT_VERSION@" "General Commands Manual" .SH NAME netctlgui-helper is a helper daemon for netctl-gui .SH SYNOPSIS @@ -14,6 +14,7 @@ without any additional permissions. To have access to DBus interface user should .IP "-c, --config FILE" read configuration from file .I FILE +instead of default user configuration .IP "-d, --debug" print debug information .IP "--nodaemon" @@ -32,8 +33,10 @@ show build information and exit show this help and exit .SH FILES .I $HOME/.config/netctl-gui.conf +, +.I /etc/netctlgui-helper.conf .RS -Configuration file +Configuration files .RE .I /usr/lib/systemd/system/netctlgui-helper.service .RS @@ -61,6 +64,7 @@ By the way it is highly recommended to copy source service file before to and edit copied file to avoid upgrade problems. .SH SEE ALSO .BR netctl-gui (1) +.BR netctlgui-helper.conf (5) .SH STANDARDS See .B @CMAKE_INSTALL_PREFIX@/share/doc/netctl-gui/netctl-gui-dbus-api.html diff --git a/sources/helper/netctlgui-helper.conf.5 b/sources/helper/netctlgui-helper.conf.5 new file mode 100644 index 0000000..f7edf05 --- /dev/null +++ b/sources/helper/netctlgui-helper.conf.5 @@ -0,0 +1,104 @@ +.TH netctlgui-helper.conf 5 "@CURRENT_DATE@" "version @PROJECT_VERSION@" "File Formats Manual" +.SH NAME +netctlgui-helper.conf is a configuration file of Netctl GUI project +.SH SYNOPSIS +.B /etc/netctlgui-helper.conf +for system-wide configuration or +.B $HOME/.config/netctl-gui.conf +for user one +.SH DESCRIPTION +.B netctlgui-helper.conf +is a file which contains parameters for +.BR netctlgui-helper (1) +and may be used as template for +.BR netctl-gui (1) +configuration also. +.SH OPTIONS +.IP "CLOSE_HELPER=false" +close helper after GUI application quit. This option is not recognized by +.BR netctlgui-helper (1) +.IP "CLOSETOTRAY=true" +hide application to tray on exit if tray is available. This option is not recognized by +.BR netctlgui-helper (1) +.IP "CTRL_DIR=/run/wpa_supplicant_netctl-gui" +path to control directory which is required by +.BR wpa_supplicant (8) +.IP "CTRL_GROUP=users" +group which is owner of +.B CTRL_DIR +.IP "FORCE_SUDO=false" +force use +.B SUDO_PATH +for helper instead of using +.BR setuid (3) +to child processes +.IP "HELPER_PATH=/usr/bin/netctlgui-helper" +path to +.BR netctlgui-helper (1) +This option is not recognized by +.BR netctlgui-helper (1) +.IP "HELPER_SERVICE=netctlgui-helper.service" +.BR netctlgui-helper (1) +service name. This option is not recognized by +.BR netctlgui-helper (1) +.IP "IFACE_DIR=/sys/class/net/" +path to directory which contains interface information +.IP "LANGUAGE=en" +application language +.IP "NETCTL_PATH=/usr/bin/netctl" +path to +.BR netctl (1) +.IP "NETCTLAUTO_PATH=/usr/bin/netctl-auto" +path to +.BR netctl-auto (1) +.IP "NETCTLAUTO_SERVICE=netctl-auto" +.BR netctl-auto (1) +service name without +.I .service +suffix +.IP "PID_FILE=/run/wpa_supplicant_netctl-gui.pid" +.BR wpa_supplicant (8) +PID file +.IP "PREFERED_IFACE=" +prefered wireless interface +.IP "PROFILE_DIR=/etc/netctl/" +path to +.BR netctl (1) +profile directory +.IP "RFKILL_DIR=/sys/class/rfkill/" +path to directory with +.BR rfkill (8) +devices. This option is not recognized by +.BR netctlgui-helper (1) +.IP "STARTTOTRAY=false" +start +.BR netctl-gui (1) +minimized to tray if it is available. This option is not recognized by +.BR netctlgui-helper (1) +.IP "SUDO_PATH=/usr/bin/kdesu" +path to +.BR sudo (8) +frontend +.IP "SYSTEMCTL_PATH=/usr/bin/systemctl" +path to +.BR systemctl (1) +.IP "SYSTRAY=true" +create system tray icon. This option is not recognized by +.BR netctlgui-helper (1) +.IP "USE_HELPER=true" +use +.BR netctlgui-helper (1) +if it is available. This option is not recognized by +.BR netctlgui-helper (1) +.IP "WPACLI_PATH=/usr/bin/wpa_cli" +path to +.BR wpa_cli (8) +.IP "WPASUP_PATH=/usr/bin/wpa_supplicant" +path to +.BR wpa_supplicant (8) +.IP "WPA_DRIVERS=nl80211,wext" +.BR wpa_supplicant (8) +drivers for wireless interface comma separated +.SH SEE ALSO +.BR netctl-gui (1) +.BR netctlgui-helper (1)