develop #12
@ -174,14 +174,15 @@ class Icon(DesktopIconMixin, VideoIconMixin, MeshsIconMixin):
|
||||
return path_exists, img_hash, hash_img_path
|
||||
|
||||
|
||||
def fast_hash(self, filename, hash_factory=hashlib.md5, chunk_num_blocks=128, i=1):
|
||||
def fast_hash(self, filename: str, hash_factory: callable = hashlib.md5, chunk_num_blocks: int = 128, i: int = 1) -> str:
|
||||
h = hash_factory()
|
||||
with open(filename,'rb') as f:
|
||||
# NOTE: Jump to middle of file
|
||||
f.seek(0, 2)
|
||||
mid = int(f.tell() / 2)
|
||||
f.seek(mid, 0)
|
||||
|
||||
while chunk := f.read(chunk_num_blocks*h.block_size):
|
||||
while chunk := f.read(chunk_num_blocks * h.block_size):
|
||||
h.update(chunk)
|
||||
if (i == 12):
|
||||
break
|
||||
|
@ -35,7 +35,7 @@ class SettingsManager(StartCheckMixin, Singleton):
|
||||
self._CSS_FILE = f"{self._HOME_CONFIG_PATH}/stylesheet.css"
|
||||
self._KEY_BINDINGS_FILE = f"{self._HOME_CONFIG_PATH}/key-bindings.json"
|
||||
self._PID_FILE = f"{self._HOME_CONFIG_PATH}/{app_name.lower()}.pid"
|
||||
self._WINDOW_ICON = f"{self._DEFAULT_ICONS}/icons/{app_name.lower()}.png"
|
||||
self._WINDOW_ICON = f"{self._DEFAULT_ICONS}/{app_name.lower()}.png"
|
||||
self._UI_WIDEGTS_PATH = f"{self._HOME_CONFIG_PATH}/ui_widgets"
|
||||
self._CONTEXT_MENU = f"{self._HOME_CONFIG_PATH}/contexct_menu.json"
|
||||
self._TRASH_FILES_PATH = f"{GLib.get_user_data_dir()}/Trash/files"
|
||||
@ -164,4 +164,4 @@ class SettingsManager(StartCheckMixin, Singleton):
|
||||
|
||||
def save_settings(self):
|
||||
with open(self._CONFIG_FILE, 'w') as outfile:
|
||||
json.dump(self.settings.as_dict(), outfile, separators=(',', ':'), indent=4)
|
||||
json.dump(self.settings.as_dict(), outfile, separators=(',', ':'), indent=4)
|
45
user_config/usr/share/solarfm/settings.json
Normal file
45
user_config/usr/share/solarfm/settings.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"config": {
|
||||
"base_of_home": "",
|
||||
"hide_hidden_files": "true",
|
||||
"thumbnailer_path": "ffmpegthumbnailer",
|
||||
"blender_thumbnailer_path": "",
|
||||
"go_past_home": "true",
|
||||
"lock_folder": "false",
|
||||
"locked_folders": "venv::::flasks",
|
||||
"mplayer_options": "-quiet -really-quiet -xy 1600 -geometry 50%:50%",
|
||||
"music_app": "deadbeef",
|
||||
"media_app": "mpv",
|
||||
"image_app": "mirage2",
|
||||
"office_app": "libreoffice",
|
||||
"pdf_app": "evince",
|
||||
"code_app": "newton",
|
||||
"text_app": "mousepad",
|
||||
"terminal_app": "terminator",
|
||||
"container_icon_wh": [128, 128],
|
||||
"video_icon_wh": [128, 64],
|
||||
"sys_icon_wh": [56, 56],
|
||||
"file_manager_app": "solarfm",
|
||||
"steam_cdn_url": "https://steamcdn-a.akamaihd.net/steam/apps/",
|
||||
"remux_folder_max_disk_usage": "8589934592"
|
||||
},
|
||||
"filters": {
|
||||
"meshs": [".dae", ".fbx", ".gltf", ".obj", ".stl"],
|
||||
"code": [".cpp", ".css", ".c", ".go", ".html", ".htm", ".java", ".js", ".json", ".lua", ".md", ".py", ".rs", ".toml", ".xml", ".pom"],
|
||||
"videos": [".mkv", ".mp4", ".webm", ".avi", ".mov", ".m4v", ".mpg", ".mpeg", ".wmv", ".flv"],
|
||||
"office": [".doc", ".docx", ".xls", ".xlsx", ".xlt", ".xltx", ".xlm", ".ppt", ".pptx", ".pps", ".ppsx", ".odt", ".rtf"],
|
||||
"images": [".png", ".jpg", ".jpeg", ".gif", ".ico", ".tga", ".webp"],
|
||||
"text": [".txt", ".text", ".sh", ".cfg", ".conf", ".log"],
|
||||
"music": [".psf", ".mp3", ".ogg", ".flac", ".m4a"],
|
||||
"pdf": [".pdf"]
|
||||
},
|
||||
"theming":{
|
||||
"success_color": "#88cc27",
|
||||
"warning_color": "#ffa800",
|
||||
"error_color": "#ff0000"
|
||||
},
|
||||
"debugging": {
|
||||
"ch_log_lvl": 20,
|
||||
"fh_log_lvl": 10
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user