Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Result Notification #77

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Action Result Notification
Answering a feature request from rien333
#64

If you use Dunst to manage notifications, this will work.

To be known:
1. Notifications will be run using the notify-send command
2. Currently only applies to wireless connections

This is not final, but I think it will be fun and stimulating us to develop it for other adapters such as ethernet, modem, to VPN.
anwareset authored Apr 17, 2020
commit 705e0ee209038aaeddbe5c4cf10a3ad9d470a69f
8 changes: 8 additions & 0 deletions networkmanager_dmenu
Original file line number Diff line number Diff line change
@@ -242,6 +242,10 @@ def process_ap(nm_ap, is_active, adapter):
"""Activate/Deactivate a connection and get password if required"""
if is_active:
CLIENT.deactivate_connection_async(nm_ap)
notify = Popen(["notify-send",
"-u", "low",
"Wireless Disconnected", ssid_to_utf8(adapter.get_active_access_point()),
"-h", "string:x-canonical-private-synchronous:wirelessnetwork"], stdout=PIPE, stderr=PIPE).communicate()
else:
conns_cur = [i for i in CONNS if
i.get_setting_wireless() is not None and
@@ -253,6 +257,10 @@ def process_ap(nm_ap, is_active, adapter):

if len(con) == 1:
CLIENT.activate_connection_async(con[0])
notify = Popen(["notify-send",
"-u", "low",
"Wireless Connected", ssid_to_utf8(nm_ap),
"-h", "string:x-canonical-private-synchronous:wirelessnetwork"], stdout=PIPE, stderr=PIPE).communicate()
else:
if ap_security(nm_ap) != "--":
password = get_passphrase()