From 7fc29a1f43952177c6c7e146a14c9df2ed3a3ec9 Mon Sep 17 00:00:00 2001 From: Krzysztof Jurewicz Date: Mon, 30 Dec 2019 19:39:44 +0100 Subject: [PATCH] Use $SHELL in the shell module --- bumblebee/modules/shell.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/shell.py b/bumblebee/modules/shell.py index 726530b..038e519 100644 --- a/bumblebee/modules/shell.py +++ b/bumblebee/modules/shell.py @@ -11,7 +11,7 @@ Few command examples: Parameters: * shell.command: Command to execute - Use single parentheses if evaluating anything inside + Use single parentheses if evaluating anything inside (sh-style) For example shell.command='echo $(date +"%H:%M:%S")' But NOT shell.command="echo $(date +'%H:%M:%S')" Second one will be evaluated only once at startup @@ -23,6 +23,7 @@ Parameters: (defaults to False) """ +import os import subprocess import threading @@ -73,6 +74,7 @@ class Module(bumblebee.engine.Module): def _get_command_output_or_error(command): try: command_output = subprocess.check_output(command, + executable=os.environ.get('SHELL'), shell=True, stderr=subprocess.STDOUT) return command_output.decode('utf-8').strip()