From bb7387b52fa43a4ee49e9730ad71d8054f0da129 Mon Sep 17 00:00:00 2001 From: James Ridgway Date: Sat, 15 May 2021 15:38:30 +0100 Subject: [PATCH] Path expand for HOME --- devdeck/controls/command_control.py | 3 ++- devdeck/decks/single_page_deck_controller.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/devdeck/controls/command_control.py b/devdeck/controls/command_control.py index 32ba36b..6b959a4 100644 --- a/devdeck/controls/command_control.py +++ b/devdeck/controls/command_control.py @@ -1,3 +1,4 @@ +import os from subprocess import Popen, DEVNULL from devdeck_core.controls.deck_control import DeckControl @@ -7,7 +8,7 @@ class CommandControl(DeckControl): def initialize(self): with self.deck_context() as context: with context.renderer() as r: - r.image(self.settings['icon']).end() + r.image(os.path.expanduser(self.settings['icon'])).end() def pressed(self): Popen(self.settings['command'], stdout=DEVNULL, stderr=DEVNULL) diff --git a/devdeck/decks/single_page_deck_controller.py b/devdeck/decks/single_page_deck_controller.py index dfe5cfe..78b1c03 100644 --- a/devdeck/decks/single_page_deck_controller.py +++ b/devdeck/decks/single_page_deck_controller.py @@ -1,4 +1,5 @@ import logging +import os from devdeck_core.decks.deck_controller import DeckController from devdeck.settings.control_settings import ControlSettings @@ -14,7 +15,7 @@ def __init__(self, key_no, **kwargs): def initialize(self): with self.deck_context() as context: with context.renderer() as r: - r.image(self.settings['icon']).end() + r.image(os.path.expanduser(self.settings['icon'])).end() def deck_controls(self): controls = [ControlSettings(control_settings) for control_settings in self.settings['controls']]