diff --git a/README.md b/README.md index fe8cb87..ddd6d2e 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,6 @@ TODO (wish list) ---------------- * plasmoid helper integration -* helper shell completions * gui helper|systemd integration * helper uid/euid check to allow use /Ctrl interface * include security notes / project architecture to about window diff --git a/sources/gui/netctl-gui.1 b/sources/gui/netctl-gui.1 index c5a5c71..cb90080 100644 --- a/sources/gui/netctl-gui.1 +++ b/sources/gui/netctl-gui.1 @@ -3,16 +3,20 @@ netctl-gui is a graphical interface for netctl .SH SYNOPSIS .B netctl-gui -[ --about ] [ --netctl-auto ] [ --settings ] - [ -e ESSID | --essid ESSID ] [ -o PROFILE | --open PROFILE ] - [ -s PROFILE | --select PROFILE ] - [ --config FILE ] [ -d | --debug ] [ --default ] - [ --set-opts OPTIONS ] [ -t NUM | --tab NUM ] - [ -v | --version ] [ -i | --info ] [ -h | --help] +[ options ] .SH DESCRIPTION Graphical user interface for netctl written on C++ using Qt toolkit. Provides shared library for interaction with netctl and Plasmoid and DataEngine for KDE. .SH OPTIONS .TP +--daemon +run as daemon +.TP +--maximized +run maximized +.TP +--minimized +run to system tray if it is available +.TP --about show about window .TP @@ -31,7 +35,7 @@ open profile PROFILE. This option will set tab to 2 automatically -s, --select PROFILE select profile PROFILE. This option will set tab to 1 automatically .TP ---config FILE +-c, --config FILE read configuration from file FILE .TP -d, --debug diff --git a/sources/gui/src/main.cpp b/sources/gui/src/main.cpp index d6a4f3c..126f3c3 100644 --- a/sources/gui/src/main.cpp +++ b/sources/gui/src/main.cpp @@ -48,29 +48,7 @@ bool restoreExistSession() int main(int argc, char *argv[]) { - // detach from console - bool debugFlag = false; - bool daemonFlag = false; - for (int i=0; i args = getArgs(); - // translation - QString language = Language::defineLanguage(args[QString("config")].toString()); - QTranslator translator; - translator.load(QString(":/translations/") + language); - a.installTranslator(&translator); - // reading for (int i=1; i +.SH LICENSE +This software is licensed under @PROJECT_LICENSE@ diff --git a/sources/helper/org.netctlgui.helper.conf b/sources/helper/org.netctlgui.helper.conf index 1f7e4b8..855ba0e 100644 --- a/sources/helper/org.netctlgui.helper.conf +++ b/sources/helper/org.netctlgui.helper.conf @@ -3,12 +3,12 @@ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> - + - + @@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/sources/helper/src/main.cpp b/sources/helper/src/main.cpp index 4cdf047..5a8d744 100644 --- a/sources/helper/src/main.cpp +++ b/sources/helper/src/main.cpp @@ -47,24 +47,6 @@ bool checkExistSession() int main(int argc, char *argv[]) { - // detach from console - bool debugFlag = false; - bool daemonFlag = true; - for (int i=0; i= 0x050000 - QCoreApplication::setSetuidAllowed(true); -#endif - QCoreApplication a(argc, argv); - // check if exists - if (checkExistSession()) - return 0; - QMap args = getArgs(); // reading for (int i=1; i= 0x050000 + QCoreApplication::setSetuidAllowed(true); +#endif + QCoreApplication a(argc, argv); + // check if exists + if (checkExistSession()) + return 0; + NetctlHelper w(0, args); return a.exec(); } diff --git a/sources/helper/zsh-completions b/sources/helper/zsh-completions new file mode 100644 index 0000000..f39c696 --- /dev/null +++ b/sources/helper/zsh-completions @@ -0,0 +1,44 @@ +#compdef netctlgui-helper +########################################################################### +# This file is part of netctl-gui # +# # +# netctl-gui is free software: you can redistribute it and/or # +# modify it under the terms of the GNU General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# netctl-gui is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with netctl-gui. If not, see http://www.gnu.org/licenses/ # +########################################################################### + + +# variables +_netctlgui_helper_arglist=( + {'--nodaemon','--nodaemon'}'[do not start as daemon]' + {'(--config)-c','(-c)--config'}'[read configuration from this file]:select file:->files' + {'(--debug)-d','(-d)--debug'}'[print debug information]' + {'(--version)-v','(-v)--version'}'[show version and exit]' + {'(--info)-i','(-i)--info'}'[show build information and exit]' + {'(--help)-h','(-h)--help'}'[show help and exit]' +) + +# work block +_netctlgui_helper() { + _arguments $_netctlgui_helper_arglist + case "$state" in + files) + _files + ;; + esac +} + +case "$service" in + netctlgui-helper) + _netctlgui_helper "$@" && return 0 + ;; +esac