Is there a way to set a hotkey for toggling connection through a network cable:
Also if I have a command in command-line that can do this or a piece of C++ code that does this I can set a hotkey for it.
ccommand linekdenetworkingshortcut-keys
Is there a way to set a hotkey for toggling connection through a network cable:
Also if I have a command in command-line that can do this or a piece of C++ code that does this I can set a hotkey for it.
Best Answer
Control of the NetworkManger
The NetworkManger can be controlled from the commandline:
man nmcli:
The man page on the net: http://manpages.ubuntu.com/manpages/saucy/man1/nmcli.1.html
With the dbus:
Example - working at here:
Disconnecting from the current network connection and staying disconnected:
Connecting the network with th UUID:
1) Reading the UUID:
At here the UUID is 81540c01-2377-4d79-9763-d0f3104c81f3
2) Activating the connection:
Hotkeys
One way to add the shortcuts/hotkeys is to use the KDE menu editor.
The command can be added to the KDE menu with a shortcut to run the command.
The KDE document can be found: K-Menu > Applications > Help ...
The KDE menu editor handbook on the net: http://docs.kde.org/development/en/kde-workspace/kmenuedit/index.html