Skip to content

Commit

Permalink
Path expand for HOME
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesridgway committed May 15, 2021
1 parent efc109a commit bb7387b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion devdeck/controls/command_control.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from subprocess import Popen, DEVNULL

from devdeck_core.controls.deck_control import DeckControl
Expand All @@ -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)
3 changes: 2 additions & 1 deletion devdeck/decks/single_page_deck_controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os

from devdeck_core.decks.deck_controller import DeckController
from devdeck.settings.control_settings import ControlSettings
Expand All @@ -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']]
Expand Down

0 comments on commit bb7387b

Please sign in to comment.