mirror of
https://github.com/artizirk/wdisplays.git
synced 2026-10-03 21:05:43 +03:00
Keep a symlinked kanshi config a symlink
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "wdisplays.h"
|
||||
@@ -469,6 +470,10 @@ static char *update_config(const char *text, struct wl_list *outputs,
|
||||
|
||||
static bool write_config(const char *path, const char *contents,
|
||||
GError **error) {
|
||||
g_autofree char *real_path = realpath(path, NULL);
|
||||
if (real_path != NULL) {
|
||||
path = real_path;
|
||||
}
|
||||
g_autofree char *dir = g_path_get_dirname(path);
|
||||
if (g_mkdir_with_parents(dir, 0755) != 0) {
|
||||
int err = errno;
|
||||
|
||||
Reference in New Issue
Block a user