From 49b41667ad1e879076c58a9128e36ef148754aad Mon Sep 17 00:00:00 2001 From: o9000 Date: Sat, 22 Apr 2017 19:31:59 +0200 Subject: [PATCH] tint2conf: Add mime type and full support for editing by path --- src/tint2conf/CMakeLists.txt | 1 + src/tint2conf/main.c | 2 +- src/tint2conf/tint2conf.desktop | 1 + src/tint2conf/tint2conf.xml | 8 ++++++++ 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/tint2conf/tint2conf.xml diff --git a/src/tint2conf/CMakeLists.txt b/src/tint2conf/CMakeLists.txt index 12d1494..530ddf1 100644 --- a/src/tint2conf/CMakeLists.txt +++ b/src/tint2conf/CMakeLists.txt @@ -71,3 +71,4 @@ add_subdirectory(po) install( TARGETS tint2conf DESTINATION bin ) install( FILES tint2conf.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps ) install( FILES tint2conf.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications ) +install( FILES tint2conf.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages ) diff --git a/src/tint2conf/main.c b/src/tint2conf/main.c index 90a8b27..3bc7f32 100644 --- a/src/tint2conf/main.c +++ b/src/tint2conf/main.c @@ -74,7 +74,7 @@ gboolean endswith(const char *str, const char *suffix) // Returns TRUE if the theme file is in ~/.config. gboolean theme_is_editable(const char *filepath) { - return startswith(filepath, g_get_user_config_dir()); + return access(filepath, W_OK) == 0; } // Returns TRUE if the theme file is ~/.config/tint2/tint2rc. diff --git a/src/tint2conf/tint2conf.desktop b/src/tint2conf/tint2conf.desktop index ca4bc18..e92a33f 100644 --- a/src/tint2conf/tint2conf.desktop +++ b/src/tint2conf/tint2conf.desktop @@ -113,3 +113,4 @@ Exec=tint2conf Icon=tint2conf Terminal=false Categories=Settings;DesktopSettings; +MimeType=application/x-tint2-theme diff --git a/src/tint2conf/tint2conf.xml b/src/tint2conf/tint2conf.xml new file mode 100644 index 0000000..c5d3e6c --- /dev/null +++ b/src/tint2conf/tint2conf.xml @@ -0,0 +1,8 @@ + + + + tint2 theme file + + + +