diff --git a/controldeck.py b/controldeck.py index f26cbf3..5ad4bff 100644 --- a/controldeck.py +++ b/controldeck.py @@ -203,9 +203,9 @@ def application(request): Button(empty=True, a=eval(var)) elif 'icon-image' in j and j['icon-image'] != '': svg = '' - if path.isfile(j['icon-image']): + if path.isfile(path.expanduser(j['icon-image'])): try: - with open(j['icon-image']) as f: + with open(path.expanduser(j['icon-image'])) as f: svg = f.read() except Exception as e: print(f"{e}") diff --git a/example/controldeck.conf b/example/controldeck.conf index 3acfd12..c62243f 100644 --- a/example/controldeck.conf +++ b/example/controldeck.conf @@ -20,18 +20,20 @@ # second command # ... # icon = Font Awesome name +# icon-image = path to svg file # -# : N. optional group/row specification -# : NAME id, name of the button -# : color-bg background color -# : color-bg forground color -# : command command(s) to run -# : icon use icon instead of NAME (Font Awesome), e.g.: fas fa-play +# : N. optional group/row specification +# : NAME id, name of the button +# : color-bg background color +# : color-bg forground color +# : command command(s) to run +# : icon use icon instead of NAME (Font Awesome), e.g.: fas fa-play +# : icon-image absolute path to svg file # # [N.empty.NAME] # -# : N. optional number to specify group/row -# : NAME id, name of the button +# : N. optional number to specify group/row +# : NAME id, name of the button [gui] width = 800