diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2024-05-20 07:31:01 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2024-05-20 07:31:01 +0900 |
| commit | 0d1cc073ed8edf18608545e35152e17a3e9affec (patch) | |
| tree | 7f4c09c1a686df4d8d6c46cf9b55d0f0f8ba8944 /slock/slock.c | |
| parent | e846347b5bc50a79094264f1dcfdbf197be17c0f (diff) | |
Updates dwm keybinding and slock
Diffstat (limited to 'slock/slock.c')
| -rw-r--r-- | slock/slock.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/slock/slock.c b/slock/slock.c index 1fc3d9d..957012b 100644 --- a/slock/slock.c +++ b/slock/slock.c @@ -672,7 +672,23 @@ main(int argc, char **argv) { config_init(dpy); /* Load picture */ - Imlib_Image buffer = imlib_load_image(background_image); + char* home_path = getenv("HOME"); + int size_needed = snprintf(NULL, 0, "mount | grep -q ' %s/Personal '", home_path) + 1; + char* command = malloc(size_needed); + snprintf(command, size_needed, "mount | grep -q ' %s/Personal '", home_path); + int result = system(command); + free(command); + if (result != 0) { + background_image = "Pictures/wallpaper/personal-default.png"; + personalblur = 0; + } + size_needed = strlen(home_path) + strlen(background_image) + 2; // +2 for slash and null terminator + char* full_background_image = malloc(size_needed); + strcpy(full_background_image, home_path); + strcat(full_background_image, "/"); + strcat(full_background_image, background_image); + + Imlib_Image buffer = imlib_load_image(full_background_image); if (buffer) { blurRadius = personalblur; |
