diff --git a/plinth/frontpage.py b/plinth/frontpage.py index 5e63bff1c..ae1f73f46 100644 --- a/plinth/frontpage.py +++ b/plinth/frontpage.py @@ -160,11 +160,15 @@ def _extract_web_app_url(custom_shortcut): def get_custom_shortcuts(): """Return a merged dictionary of all custom shortcuts.""" - shortcuts_dirs = [cfg.config_dir, cfg.data_dir, cfg.file_root] + dirs = [cfg.config_dir, cfg.data_dir, cfg.file_root] + file_paths = [ + pathlib.Path(dir_) / 'custom-shortcuts.json' for dir_ in dirs + ] + file_paths = cfg.expand_to_dot_d_paths(file_paths) shortcuts = {'shortcuts': []} - for shortcuts_dir in shortcuts_dirs: - file_path = pathlib.Path(shortcuts_dir) / 'custom-shortcuts.json' + for file_path in file_paths: + file_path = pathlib.Path(file_path) if not file_path.is_file() or not file_path.stat().st_size: continue