Allow ~/ expansion when specify image paths for @ set-(background|logo)
This commit is contained in:
parent
a7eb9850b7
commit
7a2003c371
@ -2,6 +2,7 @@
|
|||||||
# License: GPLv3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
|
# License: GPLv3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
|
||||||
import imghdr
|
import imghdr
|
||||||
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
from base64 import standard_b64decode, standard_b64encode
|
from base64 import standard_b64decode, standard_b64encode
|
||||||
from typing import IO, TYPE_CHECKING, Optional
|
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:
|
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
self.fatal('Must specify path to exactly one PNG image')
|
self.fatal('Must specify path to exactly one PNG image')
|
||||||
path = args[0]
|
path = os.path.expanduser(args[0])
|
||||||
ret = {
|
ret = {
|
||||||
'match': opts.match,
|
'match': opts.match,
|
||||||
'configured': opts.configured,
|
'configured': opts.configured,
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import imghdr
|
import imghdr
|
||||||
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
from base64 import standard_b64decode, standard_b64encode
|
from base64 import standard_b64decode, standard_b64encode
|
||||||
from typing import IO, TYPE_CHECKING, Optional
|
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:
|
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
self.fatal('Must specify path to exactly one PNG image')
|
self.fatal('Must specify path to exactly one PNG image')
|
||||||
path = args[0]
|
path = os.path.expanduser(args[0])
|
||||||
ret = {
|
ret = {
|
||||||
'match': opts.match,
|
'match': opts.match,
|
||||||
'self': opts.self,
|
'self': opts.self,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user