Skip to content

Commit

Permalink
incr: refresh script
Browse files Browse the repository at this point in the history
  • Loading branch information
LighghtEeloo committed Apr 17, 2024
1 parent fd9025e commit 1f3ecc4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/refresh.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import os

if __name__ == "__main__":
with open("~/.zhistory", 'r') as f:
home = os.path.expanduser("~")
with open(os.path.join(home, ".zhistory"), 'r') as f:
lines = [line for line in f.readlines() if line.startswith("ww ")]
print(lines)
lines = [line.rstrip().lstrip("ww ") for line in lines]
# for line in lines:
# for letter in line:
# # report if letter is not english
# if not letter.isalpha() and not letter.isspace() and not letter == '-':
# print(line)
# break
for line in lines:
os.system(f"charcoal query {line} -s --refresh")

0 comments on commit 1f3ecc4

Please sign in to comment.