diff --git a/plyer/platforms/linux/storagepath.py b/plyer/platforms/linux/storagepath.py index 736674a2..2d0d5651 100755 --- a/plyer/platforms/linux/storagepath.py +++ b/plyer/platforms/linux/storagepath.py @@ -3,8 +3,10 @@ -------------------- ''' +from os.path import expanduser, dirname, abspath, join, exists, isdir +import os + from plyer.facades import StoragePath -from os.path import expanduser, dirname, abspath, join, exists # Default paths for each name USER_DIRS = "/.config/user-dirs.dirs" @@ -39,7 +41,9 @@ def _get_home_dir(self): return expanduser('~') def _get_external_storage_dir(self): - return "/media/" + self._get_home_dir().split("/")[-1] + for i in ["/media", "/run/media"]: + if isdir(i): + return join(i, os.getlogin()) def _get_root_dir(self): return "/"