--- a/gntwm.c Thu Feb 29 22:08:51 2024 -0600
+++ b/gntwm.c Tue Apr 09 21:34:39 2024 -0500
@@ -23,12 +23,6 @@
#define GNT_LOG_DOMAIN "WM"
-/* Python.h may define _GNU_SOURCE and _XOPEN_SOURCE_EXTENDED, so protect
- * these checks with #ifndef/!defined() */
@@ -153,9 +147,6 @@
static gboolean idle_update;
static GList *act = NULL; /* list of WS with unseen activity */
static gboolean ignore_keys = FALSE;
-static gboolean started_python = FALSE;
G_DEFINE_TYPE_WITH_PRIVATE(GntWM, gnt_wm, GNT_TYPE_BINDABLE)
@@ -1394,51 +1385,6 @@
-python_script_selected(GntFileSel *fs, const char *path,
- G_GNUC_UNUSED const char *f, G_GNUC_UNUSED gpointer n)
- char *dir = g_path_get_dirname(path);
- FILE *file = fopen(path, "r");
- PyObject *pp = PySys_GetObject("path");
-#if PY_MAJOR_VERSION >= 3
- PyObject *dirobj = PyUnicode_FromString(dir);
- PyObject *dirobj = PyString_FromString(dir);
- PyList_Insert(pp, 0, dirobj);
- PyRun_SimpleFile(file, path);
- if (PyErr_Occurred()) {
- gnt_widget_destroy(GNT_WIDGET(fs));
-run_python(G_GNUC_UNUSED GntBindable *bindable, G_GNUC_UNUSED GList *params)
- GntWidget *window = gnt_file_sel_new();
- GntFileSel *sel = GNT_FILE_SEL(window);
- g_object_set(window, "vertical", TRUE, NULL);
- gnt_box_add_widget(GNT_BOX(window), gnt_label_new("Please select the python script you want to run."));
- gnt_box_set_title(GNT_BOX(window), "Select Python Script...");
- g_signal_connect(G_OBJECT(sel), "file_selected", G_CALLBACK(python_script_selected), NULL);
- g_signal_connect_swapped(G_OBJECT(sel), "cancelled",
- G_CALLBACK(gnt_widget_destroy), sel);
- gnt_widget_show(window);
help_for_bindable(GntWM *wm, GntBindable *bindable)
@@ -1519,13 +1465,6 @@
g_clear_pointer(&priv->loop, g_main_loop_unref);
- started_python = FALSE;
@@ -1696,19 +1635,6 @@
snprintf(key, sizeof(key), "\033%s", GNT_KEY_BACK_TAB);
gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-prev-urgent", window_prev_urgent,
key[1] ? key : NULL, NULL);
- gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "run-python", run_python,
- if (!Py_IsInitialized()) {
-#if PY_MAJOR_VERSION >= 3
- Py_SetProgramName(L"gnt");
- Py_SetProgramName("gnt");
gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass));
--- a/meson.build Thu Feb 29 22:08:51 2024 -0600
+++ b/meson.build Tue Apr 09 21:34:39 2024 -0500
@@ -209,24 +209,6 @@
libgnt_generated_targets = []
-# Check for Python headers
- ['python-3.10-embed', '>=3.10'],
- ['python-3.9-embed', '>=3.9'],
- ['python-3.8-embed', '>=3.8'],
- ['python3-embed', '>=3.8'],
- ['python-3.7', '>=3.7'],
- ['python-3.7m', '>=3.7'],
-foreach _PYTHON : _PYTHONS
- python_dep = dependency(_PYTHON[0], version : _PYTHON[1], required: false)
-gnt_config.set('USE_PYTHON', python_dep.found())
configure_file(output : 'gntconfig.h',
configuration : gnt_config)
configure_file(input : 'gntversion.h.in', output : 'gntversion.h',
@@ -279,7 +261,7 @@
- dependencies : [ncurses, libxml, glib, gobject, gmodule, python_dep])
+ dependencies : [ncurses, libxml, glib, gobject, gmodule])