Skip to content

Commit

Permalink
Fix newline in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
odensc committed Dec 5, 2018
1 parent 58118b3 commit 0e3d703
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Or, on anything else:
./install.sh
```


## Usage

Simply search for the account name, then hit enter (or click) to copy the code.
Expand Down
4 changes: 2 additions & 2 deletions yubioath-krunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_credentials(self):
def get_code(self, cred_id):
result = subprocess.run(["ykman", "oath", "code"], stdout=subprocess.PIPE)
codes = result.stdout.decode()
return re.search("{} +(\d+)".format(cred_id), codes).groups()[0].strip()
return re.search("{} +(\d+)".format(cred_id), codes).groups()[0]

@dbus.service.method(iface, out_signature='a(sss)')
def Actions(self, msg):
Expand All @@ -52,7 +52,7 @@ def Match(self, query):
@dbus.service.method(iface, in_signature='ss')
def Run(self, matchId, actionId):
code = self.get_code(matchId)
subprocess.run("echo '{}' | xclip -selection clipboard".format(code), shell=True)
subprocess.run("echo -n '{}' | xclip -selection clipboard".format(code), shell=True)
subprocess.run(["notify-send", "--urgency=low", "--expire-time=2000", "--icon=nm-vpn-active-lock", "YubiOATH", "Code copied to clipboard"])
# Refresh credentials.
self.credentials = self.get_credentials()
Expand Down

0 comments on commit 0e3d703

Please sign in to comment.