Skip to content

Commit

Permalink
Feature/interactive aliases (#154)
Browse files Browse the repository at this point in the history
* Added interactive process call

* Fixed lint quote warning;

* Run commands in interactive mode

* Changed interactive shell comment;
Moved interactive shell to "/usr/bin/env bash" to improve compatibility;
Referred to #154 #discussion_r1014608222.

* Increased version;

* Update README.md

Add acknowledgement

Co-authored-by: Mark Hedley Jones <[email protected]>
  • Loading branch information
ZappaBoy and MarkHedleyJones authored Nov 20, 2022
1 parent 7ad25c0 commit 3cd31bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,4 @@ For those looking to improve the code, the code uses [Black](https://github.com/
* [**nanobecquerel**](https://github.com/nanobecquerel) for improving systemd integration
* [**fat-fighter**](https://github.com/fat-fighter) for bug fixes and solving GitHub issues
* [**vestingz**](https://github.com/vestingz) for Incron and pacman integration.
* [**ZappaBoy**](https://github.com/ZappaBoy) for improving alias/shell integration
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dmenu_extended"
version = "1.1.4"
version = "1.2.0"
authors = [
{ name="Mark Hedley Jones", email="[email protected]" },
]
Expand Down
6 changes: 5 additions & 1 deletion src/dmenu_extended/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def unsatisfied_plugin_requirements(plugin):
"indicator_edit": "*", # Symbol to indicate an item will launch an editor
"indicator_alias": "", # Symbol to indicate an aliased command
"prompt": "Open:", # Prompt
"interactive_shell": False, # Run commands in an interactive shell session
}


Expand Down Expand Up @@ -750,7 +751,10 @@ def execute(self, command, fork=None):
print("Command converted into:")
print(command)

return subprocess.call(command)
if self.prefs["interactive_shell"] is True:
shell = os.environ.get("SHELL", "/usr/bin/env bash")
command = shell + " -i -c " + " ".join(command)
return subprocess.call(command, shell=self.prefs["interactive_shell"])

def cache_regenerate(self, message=True):
if message:
Expand Down

0 comments on commit 3cd31bc

Please sign in to comment.