From be1e3bad3fe5ce3eca7c0670ed98dada2ec1bd86 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 23 Oct 2023 13:04:03 +0200 Subject: Use XDG_VIDEOS_DIR if available --- src/config.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/config.hpp') diff --git a/src/config.hpp b/src/config.hpp index f812c5a..be3fbf3 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -86,6 +86,17 @@ static std::string get_config_dir() { return config_dir; } +static std::string get_videos_dir() { + std::string videos_dir; + const char *xdg_videos_dir = getenv("XDG_VIDEOS_DIR"); + if(xdg_videos_dir) { + videos_dir = xdg_videos_dir; + } else { + videos_dir = get_home_dir() + "/Videos"; + } + return videos_dir; +} + static int create_directory_recursive(char *path) { int path_len = strlen(path); char *p = path; -- cgit v1.2.3