diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 5a7cf3a..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,7 +0,0 @@ -Go Fuck Yourself -============= - -Offended? Go away. We don't need people who are offended because of a stranger on the internet. -Not offended? You're welcome to contribute. - -© Copyright 2015 WTFCoC Consortium Committee. diff --git a/README.md b/README.md index 14f00a1..4ac2c2a 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ See also `man journalctl`. ## Contribution -Please create [issues](https://github.com/hakavlad/nohang/issues). Use cases, feature requests and any questions are welcome. See also [CoC](https://github.com/hakavlad/nohang/blob/master/CODE_OF_CONDUCT.md). +Please create [issues](https://github.com/hakavlad/nohang/issues). Use cases, feature requests and any questions are welcome. ## Changelog diff --git a/nohang_notify_helper b/nohang_notify_helper index b40e381..be5687b 100755 --- a/nohang_notify_helper +++ b/nohang_notify_helper @@ -94,24 +94,17 @@ def root_notify_env(): list_with_envs = root_notify_env() +print(list_with_envs) # if somebody logged in with GUI if len(list_with_envs) > 0: # iterating over logged-in users for i in list_with_envs: - username, display_env, dbus_env = i[0], i[1], i[2] - display_tuple = display_env.partition('=') + username, dbus_env = i[0], i[2] dbus_tuple = dbus_env.partition('=') - display_key, display_value = display_tuple[0], display_tuple[2] dbus_key, dbus_value = dbus_tuple[0], dbus_tuple[2] - with Popen(['sudo', '-u', username, - 'notify-send', '--icon=dialog-warning', - argv[1], argv[2] - ], env={ - display_key: display_value, - dbus_key: dbus_value - }) as proc: + with Popen(['sudo', '-u', username, 'env', 'DBUS_SESSION_BUS_ADDRESS={}'.format(dbus_value), 'notify-send', '--icon=dialog-warning', argv[1], argv[2]]) as proc: try: proc.wait(timeout=wait_time) except TimeoutExpired: @@ -119,3 +112,4 @@ if len(list_with_envs) > 0: print('TimeoutExpired: notify' + username) else: print('Nobody logged-in with GUI. Nothing to do.') +