Allow ~/ expansion when specify image paths for @ set-(background|logo)

This commit is contained in:
Kovid Goyal 2021-12-05 17:16:17 +05:30
parent a7eb9850b7
commit 7a2003c371
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,7 @@
# License: GPLv3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
import imghdr
import os
import tempfile
from base64 import standard_b64decode, standard_b64encode
from typing import IO, TYPE_CHECKING, Optional
@ -67,7 +68,7 @@ failed, the command will exit with a success code.
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
if len(args) != 1:
self.fatal('Must specify path to exactly one PNG image')
path = args[0]
path = os.path.expanduser(args[0])
ret = {
'match': opts.match,
'configured': opts.configured,

View File

@ -3,6 +3,7 @@
import imghdr
import os
import tempfile
from base64 import standard_b64decode, standard_b64encode
from typing import IO, TYPE_CHECKING, Optional
@ -67,7 +68,7 @@ failed, the command will exit with a success code.
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
if len(args) != 1:
self.fatal('Must specify path to exactly one PNG image')
path = args[0]
path = os.path.expanduser(args[0])
ret = {
'match': opts.match,
'self': opts.self,