nix/home/program/bash/module/Network.nix

38 lines
707 B
Nix
Raw Normal View History

{ ... }:
{
text = ''
# Open bluetooth control panel.
function bluetooth() {
blueman-manager
}
2024-04-06 03:03:58 +03:00
# Open network control panel.
function network() {
nm-connection-editor
}
2024-04-06 03:03:58 +03:00
# Show active connections.
function nms() {
nmcli connection show
}
2024-04-06 03:03:58 +03:00
# Start the connection.
# Usage: nu <CONNECTION>
function nmu() {
nmcli connection up "''${@}"
}
2024-04-06 03:03:58 +03:00
# Stop the connection.
# Usage: nd <CONNECTION>
function nmd() {
nmcli connection down "''${@}"
}
2024-04-06 03:03:58 +03:00
function _complete_connections() {
_autocomplete $(nmcli connection show | sed "1d" | cut -d\ -f1)
}
2024-04-06 03:03:58 +03:00
complete -F _complete_connections nmd nmu
'';
2024-04-06 03:03:58 +03:00
}