cp cache to get the path of the cached file
This commit is contained in:
parent
112ff11d3d
commit
ca1cd780a3
|
@ -1,5 +1,11 @@
|
|||
# Offpunk History
|
||||
|
||||
## 1.1 - Unreleased
|
||||
- "cp cache" put the path of the cached content in clipboard
|
||||
- HTML renderering of <pre> has been improved
|
||||
- Fixed crash when chafa is not installed (Thanks Xavier Hinault for the report)
|
||||
- Fixed crash when python-readability not installed (Thanks Nic for the report)
|
||||
|
||||
## 1.0 - March 14th 2022
|
||||
- Default width is now the standard 72
|
||||
- Content and pictures now centered for more elegant reading
|
||||
|
|
|
@ -2576,13 +2576,16 @@ class GeminiClient(cmd.Cmd):
|
|||
def do_copy(self, *args):
|
||||
"""Copy the content of the last visited page as gemtext in the clipboard.
|
||||
Use with "url" as argument to only copy the adress.
|
||||
Use with "raw" to copy the content as seen in your terminal (not gemtext)"""
|
||||
Use with "raw" to copy ANSI content as seen in your terminal (not gemtext).
|
||||
Use with "cache" to copy the path of the cached content."""
|
||||
if self.gi:
|
||||
if _HAS_XSEL:
|
||||
if args and args[0] == "url":
|
||||
subprocess.call(("echo %s |xsel -b -i" % self.gi.url), shell=True)
|
||||
elif args and args[0] == "raw":
|
||||
subprocess.call(("cat %s |xsel -b -i" % self._get_active_tmpfile()), shell=True)
|
||||
elif args and args[0] == "cache":
|
||||
subprocess.call(("echo %s |xsel -b -i" % self.gi.get_cache_path()), shell=True)
|
||||
else:
|
||||
subprocess.call(("cat %s |xsel -b -i" % self.gi.get_body(as_file=True)), shell=True)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue