Skip to content

Commit

Permalink
reorganize open_window code
Browse files Browse the repository at this point in the history
  • Loading branch information
ederag committed Feb 15, 2020
1 parent 4626f6d commit 5b2b800
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/hamster-windows-service.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ def Quit(self):

def _open_window(self, name):
if hamster.installed:
subprocess.run("hamster {} &".format(name),
shell=True)
base_cmd = "hamster"
else:
subprocess.run("python3 {}/hamster-cli.py {} &".format(
os.path.dirname(__file__), name), shell=True)
# both scripts are at the same place in the source tree
cwd = os.path.dirname(__file__)
base_cmd = "python3 {}/hamster-cli.py".format(cwd)
cmd = "{} {} &".format(base_cmd, name)
subprocess.run(cmd, shell=True)

@dbus.service.method("org.gnome.Hamster.WindowServer")
def edit(self, id=0):
Expand Down

0 comments on commit 5b2b800

Please sign in to comment.