devilspie2-0.31/0000755000175000017500000000000012207660372013060 5ustar gusnangusnandevilspie2-0.31/Makefile0000644000175000017500000000407012207660372014521 0ustar gusnangusnanCC=gcc SRC=src OBJ=obj BIN=bin ifdef DEBUG STD_CFLAGS=-Wall -g3 -ggdb -D_DEBUG else STD_CFLAGS=-Wall -Wformat -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -Wformat=2 endif DEPEND=Makefile.dep OBJECTS=$(OBJ)/config.o $(OBJ)/devilspie2.o $(OBJ)/xutils.o $(OBJ)/script.o $(OBJ)/script_functions.o $(OBJ)/error_strings.o ifndef PREFIX ifdef INSTALL_PREFIX PREFIX=$(INSTALL_PREFIX) else PREFIX=/usr/local endif endif NAME = devilspie2 PROG=$(BIN)/$(NAME) VERSION = $(shell cat ./VERSION) DATADIR = ${DESTDIR}${PREFIX}/share LOCALEDIR = ${DATADIR}/locale ifdef GTK2 PKG_GTK=gtk+-2.0 PKG_WNCK=libwnck-1.0 CHECK_GTK3=1 else PKG_GTK=gtk+-3.0 PKG_WNCK=libwnck-3.0 endif LIB_CFLAGS=$(shell pkg-config --cflags --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.1 || pkg-config --cflags $(PKG_GTK) $(PKG_WNCK) lua) STD_LDFLAGS= LIBS=-lX11 $(shell pkg-config --libs --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.1 || pkg-config --libs $(PKG_GTK) $(PKG_WNCK) lua) LOCAL_CFLAGS=$(STD_CFLAGS) $(DEPRECATED) $(CFLAGS) $(LIB_CFLAGS) LOCAL_LDFLAGS=$(LDFLAGS) $(STD_LDFLAGS) LOCAL_CPPFLAGS=$(CPPFLAGS) ifdef CHECK_GTK3 LOCAL_CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES LOCAL_CFLAGS+=-DGSEAL_ENABLE CHECK_DEPRECATED=1 endif ifdef CHECK_DEPRECATED LOCAL_CFLAGS+=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED endif LOCAL_CFLAGS+=-DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(NAME)\" -DDEVILSPIE2_VERSION=\"$(VERSION)\" .PHONY: all all: $(BIN)/devilspie2 ${MAKE} -C po -j1 all $(OBJ)/%.o: $(SRC)/%.c $(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -c $< -o $@ $(BIN)/$(NAME): $(OBJECTS) $(CC) $(LOCAL_CFLAGS) $(LOCAL_LDFLAGS) $(OBJECTS) -o $(PROG) $(LIBS) .PHONY: clean clean: rm -rf $(OBJECTS) $(PROG) $(DEPEND) ${MAKE} -C po clean install: install -d $(DESTDIR)$(PREFIX)/bin install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin ${MAKE} -C po install .PHONY: uninstall uninstall: rm -f $(DESTDIR)$(PREFIX)/$(PROG) ${MAKE} -C po uninstall $(DEPEND): $(CC) -MM $(SRC)/*.c | sed -e "s/\([A-Za-z0-9+-0._&+-]*:\)/\$(OBJ)\/\1/g" > $(DEPEND) -include $(DEPEND) devilspie2-0.31/INSTALL0000644000175000017500000000206712207660372014116 0ustar gusnangusnan Installation: ------------- Building Devilspie2 requires pkg-config, gtk, wnck and lua libraries. On a Debian system, installing the following packages should do it: pkg-config libglib2.0-dev liblua5.1-0-dev libwnck-3-dev libgtk-3-dev on a system still using Gtk version 2 replace the wnck and gtk libs with: libwnck-dev libgtk2.0-dev To build, you simply do a make (which will build with Gtk3 libs) or make GTK2=on to make the build use the Gtk2 libs. This will in the end create the devilspie2 binary in the bin/ folder. To build the same executable, but with debugging enabled, run make DEBUG=1. To install Devilspie2 system-wide - simply run make install as superuser: su -c "make install" or on systems using sudo: sudo make install depending on your system setup. This will default to /usr/local, installing the binary to /usr/local/bin - this can be changed using PREFIX variable, and need to applied all through the build system - the PREFIX is used to make the location of translations known to all code: make PREFIX=/usr sudo make install devilspie2-0.31/obj/0000755000175000017500000000000012207660372013632 5ustar gusnangusnandevilspie2-0.31/obj/place_holder.txt0000644000175000017500000000000012207660372017002 0ustar gusnangusnandevilspie2-0.31/README.translators0000644000175000017500000000451212207660372016315 0ustar gusnangusnan Information for new translators ------------------------------- Starting fresh -------------- Get a copy of the devilspie2 sources, and if a devilspie2.pot isn't availible in the po folder, create one: cd po make devilspie2.pot When you have made sure you have a devilspie2.pot, generate a po file for your language using msginit: msginit --input=devilspie2.pot This copies the devilspie2.pot to [LANGUAGE ABBREV].po, (it replaces [LANGUAGE ABBREV] with the correct abbreviation for your language, e.g. 'sv' if you are translating into Swedish) and fills it with information that it gets from your system. Then start translating all strings in the generated po file using your favourite texteditor, or a "gettext catalogs (.po files) editor" like poedit (which can be found at http://www.poedit.net.) Checking your translation for errors and completeness ----------------------------------------------------- msgfmt -c --statistics sv.po -o /dev/null Checks the file (in this example sv.po) for errors, and outputs the result statistics to stdout, and other output to /dev/null ("Other output" is of no use if just checking for errors.) Building Devilspie2 with your translation included -------------------------------------------------- Edit the Makefile in the po folder to include your translation under the LANGUAGES variable listing. Then build devilspie2 as usual with make and install using make install as root. Updating your translation ------------------------- When it is time to update your translation, you update your language po file from the content of the devilspie2.pot file (in this example the language is Swedish, and the po is called sv.po): msgmerge --update sv.po devilspie2.pot I will provide you all with an updated devilspie2.pot in the git repository before each release, but if you would like to generate it yourself, just get the latest git version of devilspie2, and then do the following: cd po rm devilspie2.pot make devilspie2.pot and then update your po file as described above. Open your file and locate the strings that need updating. To get the translation to me you can fork devilspie2 on github, do the translation, and send a pull request to me, which I will merge into my devilspie2 repository. Please use English language in your commit messages so that I can understand what you have done. devilspie2-0.31/src/0000755000175000017500000000000012207660372013647 5ustar gusnangusnandevilspie2-0.31/src/xutils.c0000644000175000017500000002345312207660372015352 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2001 Havoc Pennington, 2011-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #include #include #include #include #include #include #include #include #define _(String) gettext (String) #define gettext_noop(String) String #define N_(String) gettext_noop (String) #include "xutils.h" #if (GTK_MAJOR_VERSION >= 3) #define HAVE_GTK3 #endif static GHashTable *atom_hash = NULL; static GHashTable *reverse_atom_hash = NULL; /** * */ Atom my_wnck_atom_get(const char *atom_name) { Atom retval; g_return_val_if_fail (atom_name != NULL, None); if (!atom_hash) { atom_hash = g_hash_table_new (g_str_hash, g_str_equal); reverse_atom_hash = g_hash_table_new (NULL, NULL); } retval = GPOINTER_TO_UINT (g_hash_table_lookup (atom_hash, atom_name)); if (!retval) { retval = XInternAtom (gdk_x11_get_default_xdisplay(), atom_name, FALSE); if (retval != None) { char *name_copy; name_copy = g_strdup (atom_name); g_hash_table_insert (atom_hash, name_copy, GUINT_TO_POINTER (retval)); g_hash_table_insert (reverse_atom_hash, GUINT_TO_POINTER (retval), name_copy); } } return retval; } /** * */ void devilspie2_change_state(Screen *screen, Window xwindow, gboolean add, Atom state1, Atom state2) { XEvent xev; #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */ #define _NET_WM_STATE_ADD 1 /* add/set property */ #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ xev.xclient.type = ClientMessage; xev.xclient.serial = 0; xev.xclient.send_event = True; xev.xclient.display = gdk_x11_get_default_xdisplay(); xev.xclient.window = xwindow; xev.xclient.message_type = my_wnck_atom_get ("_NET_WM_STATE"); xev.xclient.format = 32; xev.xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; xev.xclient.data.l[1] = state1; xev.xclient.data.l[2] = state2; XSendEvent (gdk_x11_get_default_xdisplay(), RootWindowOfScreen (screen), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } /** * */ void devilspie2_error_trap_push() { gdk_error_trap_push(); } /** * */ int devilspie2_error_trap_pop() { XSync(gdk_x11_get_default_xdisplay(),False); return gdk_error_trap_pop(); } /** * */ static void set_decorations(Window xid /*WnckWindow *window*/, gboolean decorate) { #define PROP_MOTIF_WM_HINTS_ELEMENTS 5 #define MWM_HINTS_DECORATIONS (1L << 1) struct { unsigned long flags; unsigned long functions; unsigned long decorations; long inputMode; unsigned long status; } hints = {0,}; hints.flags = MWM_HINTS_DECORATIONS; hints.decorations = decorate ? 1 : 0; /* Set Motif hints, most window managers handle these */ XChangeProperty(gdk_x11_get_default_xdisplay(), xid /*wnck_window_get_xid (window)*/, my_wnck_atom_get ("_MOTIF_WM_HINTS"), my_wnck_atom_get ("_MOTIF_WM_HINTS"), 32, PropModeReplace, (unsigned char *)&hints, PROP_MOTIF_WM_HINTS_ELEMENTS); //Window xid; XWindowAttributes attrs; //xid = wnck_window_get_xid (window); XGetWindowAttributes(gdk_x11_get_default_xdisplay(), xid, &attrs); /* Apart from OpenBox, which doesn't respect it changing after mapping. Instead it has this workaround. */ devilspie2_change_state (attrs.screen, xid /*wnck_window_get_xid(window)*/, !decorate, my_wnck_atom_get ("_OB_WM_STATE_UNDECORATED"), 0); } /** * */ gboolean decorate_window(Window xid) { devilspie2_error_trap_push(); set_decorations(xid, TRUE); if (devilspie2_error_trap_pop()) { g_printerr("decorate_window %s\n",_("Failed!")); return FALSE; } return TRUE; } /** * */ gboolean undecorate_window(Window xid) { devilspie2_error_trap_push(); set_decorations(xid, FALSE); if (devilspie2_error_trap_pop()) { g_printerr("decorate_window %s\n", _("Failed!")); return FALSE; } return TRUE; } /** * */ Screen *devilspie2_window_get_xscreen(Window xid) { XWindowAttributes attrs; XGetWindowAttributes(gdk_x11_get_default_xdisplay(), xid, &attrs); return attrs.screen; } /** * */ char* my_wnck_get_string_property_latin1(Window xwindow, Atom atom) { Atom type; int format; gulong nitems; gulong bytes_after; unsigned char *property; int err, result; char *retval; devilspie2_error_trap_push(); property = NULL; result = XGetWindowProperty (gdk_x11_get_default_xdisplay (), xwindow, atom, 0, G_MAXLONG, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &property); err = devilspie2_error_trap_pop (); if (err != Success || result != Success) return NULL; retval = NULL; if (type == XA_STRING) { retval = g_strdup ((char*)property); } else if (type == XA_ATOM && nitems > 0 && format == 32) { long *pp; pp = (long *)property; // we can assume (long *) since format == 32 if (nitems == 1) { char* prop_name; prop_name = XGetAtomName (gdk_x11_get_default_xdisplay (), *pp); if (prop_name) { retval = g_strdup (prop_name); XFree (prop_name); } } else { int i; char** prop_names; prop_names = g_new (char *, nitems + 1); prop_names[nitems] = NULL; for (i=0; i < nitems; i++) { prop_names[i] = XGetAtomName (gdk_x11_get_default_xdisplay (), *pp++); } retval = g_strjoinv (", ", prop_names); for (i=0; i < nitems; i++) { if (prop_names[i]) XFree (prop_names[i]); } g_free (prop_names); } } else if (type == XA_CARDINAL && nitems == 1) { switch(format) { case 32: retval = g_strdup_printf("%lu",*(unsigned long*)property); break; case 16: retval = g_strdup_printf("%u",*(unsigned int*)property); break; case 8: retval = g_strdup_printf("%c",*(unsigned char*)property); break; } } XFree (property); return retval; } /** * */ gboolean my_wnck_get_cardinal_list (Window xwindow, Atom atom, gulong **cardinals, int *len) { Atom type; int format; gulong nitems; gulong bytes_after; gulong *nums; int err, result; *cardinals=NULL; *len=0; devilspie2_error_trap_push(); type=None; result=XGetWindowProperty(gdk_x11_get_default_xdisplay (), xwindow, atom, 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, &bytes_after, (void*)&nums); err=devilspie2_error_trap_pop(); if ((err!=Success) || (result!=Success)) return FALSE; if (type!=XA_CARDINAL) { XFree (nums); return FALSE; } *cardinals=g_new(gulong, nitems); memcpy(*cardinals, nums, sizeof (gulong) * nitems); *len=nitems; XFree(nums); return TRUE; } /** * */ int devilspie2_get_viewport_start(Window xid) { gulong *list; int len; int result=-1; my_wnck_get_cardinal_list(RootWindowOfScreen( devilspie2_window_get_xscreen(xid)), my_wnck_atom_get("_NET_DESKTOP_VIEWPORT"), &list, &len); if (len>0) result=list[0]; g_free(list); return result; } /** * */ void my_window_set_window_type(Window xid, gchar *window_type) { Display *display = gdk_x11_get_default_xdisplay(); Atom atoms[10]; /* _NET_WM_WINDOW_TYPE_DESKTOP, ATOM _NET_WM_WINDOW_TYPE_DOCK, ATOM _NET_WM_WINDOW_TYPE_TOOLBAR, ATOM _NET_WM_WINDOW_TYPE_MENU, ATOM _NET_WM_WINDOW_TYPE_UTILITY, ATOM _NET_WM_WINDOW_TYPE_SPLASH, ATOM _NET_WM_WINDOW_TYPE_DIALOG, ATOM _NET_WM_WINDOW_TYPE_NORMAL, ATOM */ gchar *type = NULL; // Make it a recognized _NET_WM_TYPE if (g_ascii_strcasecmp(window_type, "WINDOW_TYPE_DESKTOP")==0) { type = g_strdup("_NET_WM_WINDOW_TYPE_DESKTOP"); } else if (g_ascii_strcasecmp(window_type, "WINDOW_TYPE_DOCK")==0) { type = g_strdup("_NET_WM_WINDOW_TYPE_DOCK"); } else if (g_ascii_strcasecmp(window_type, "WINDOW_TYPE_TOOLBAR")==0) { type = g_strdup("_NET_WM_WINDOW_TYPE_TOOLBAR"); } else if (g_ascii_strcasecmp(window_type, "WINDOW_TYPE_MENU")==0) { type = g_strdup("_NET_WM_WINDOW_TYPE_MENU"); } else if (g_ascii_strcasecmp(window_type, "WINDOW_TYPE_UTILITY")==0) { type = g_strdup("_NET_WM_WINDOW_TYPE_UTILITY"); } else if (g_ascii_strcasecmp(window_type, "WINDOW_TYPE_SPLASH")==0) { type = g_strdup("_NET_WM_WINDOW_TYPE_SPLASH"); } else if (g_ascii_strcasecmp(window_type, "WINDOW_TYPE_DIALOG")==0) { type = g_strdup("_NET_WM_WINDOW_TYPE_DIALOG"); } else if (g_ascii_strcasecmp(window_type, "WINDOW_TYPE_NORMAL")==0) { type = g_strdup("_NET_WM_WINDOW_TYPE_NORMAL"); } else { type = g_strdup(window_type); } atoms[0]=XInternAtom(display, type, False); XChangeProperty(gdk_x11_get_default_xdisplay(), xid, XInternAtom(display, "_NET_WM_WINDOW_TYPE", False), XA_ATOM, 32, PropModeReplace, (unsigned char *) &atoms, 1); if (type) g_free(type); } /** * */ void my_window_set_opacity(Window xid, double value) { Display *display = gdk_x11_get_default_xdisplay(); unsigned int opacity = (uint)(0xffffffff * value); Atom atom_net_wm_opacity = XInternAtom(display, "_NET_WM_WINDOW_OPACITY", False); XChangeProperty(gdk_x11_get_default_xdisplay(), xid, atom_net_wm_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); } devilspie2-0.31/src/script_functions.h0000644000175000017500000000601312207660372017414 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2011-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #ifndef __HEADER_SCRIPT_FUNCTIONS_ #define __HEADER_SCRIPT_FUNCTIONS_ /** * */ int c_get_window_name(lua_State *lua); int c_get_window_has_name(lua_State *lua); int c_set_window_position(lua_State *lua); int c_set_window_position2(lua_State *lua); int c_set_window_geometry(lua_State *lua); int c_set_window_geometry2(lua_State *lua); int c_set_window_size(lua_State *lua); int c_make_always_on_top(lua_State *lua); int c_set_on_top(lua_State *lua); int c_get_application_name(lua_State *lua); int c_debug_print(lua_State *lua); int c_shade_window(lua_State *lua); int c_unshade_window(lua_State *lua); int c_minimize_window(lua_State *lua); int c_unminimize_window(lua_State *lua); int c_decorate_window(lua_State *lua); int c_undecorate_window(lua_State *lua); int c_set_window_workspace(lua_State *lua); int c_change_workspace(lua_State *lua); int c_get_workspace_count(lua_State *lua); int c_unmaximize_window(lua_State *lua); int c_maximize_window(lua_State *lua); int c_maximize_window_vertically(lua_State *lua); int c_maximize_window_horisontally(lua_State *lua); int c_pin_window(lua_State *lua); int c_unpin_window(lua_State *lua); int c_stick_window(lua_State *lua); int c_unstick_window(lua_State *lua); int c_close_window(lua_State *lua); void set_current_window(WnckWindow *window); WnckWindow *get_current_window(); int c_get_window_geometry(lua_State *lua); int c_get_client_window_geometry(lua_State *lua); int c_set_skip_tasklist(lua_State *lua); int c_set_skip_pager(lua_State *lua); int c_get_window_is_maximized(lua_State *lua); int c_get_window_is_maximized_vertically(lua_State *lua); int c_get_window_is_maximized_horisontally(lua_State *lua); int c_set_window_fullscreen(lua_State *lua); int c_set_window_above(lua_State *lua); int c_set_window_below(lua_State *lua); int c_get_window_type(lua_State *lua); #ifdef HAVE_GTK3 int c_get_class_instance_name(lua_State *lua); #endif int c_get_window_property(lua_State *lua); int c_get_window_role(lua_State *lua); int c_get_window_xid(lua_State *lua); int c_get_window_class(lua_State *lua); int c_set_viewport(lua_State *lua); int c_center(lua_State *lua); int c_set_opacity(lua_State *lua); int c_set_window_type(lua_State *lua); int c_get_screen_geometry(lua_State *lua); int c_focus(lua_State *lua); #endif /*__HEADER_SCRIPT_FUNCTIONS_*/ devilspie2-0.31/src/error_strings.h0000644000175000017500000000261612207660372016727 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2012-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #ifndef __HEADER_ERROR_STRINGS_ #define __HEADER_ERROR_STRINGS_ /** * */ extern gchar *no_indata_expected_error; extern gchar *one_indata_expected_error; extern gchar *two_indata_expected_error; extern gchar *four_indata_expected_error; extern gchar *number_expected_as_indata_error; extern gchar *boolean_expected_as_indata_error; extern gchar *string_expected_as_indata_error; extern gchar *integer_greater_than_zero_expected_error; extern gchar *could_not_find_current_viewport_error; extern gchar *setting_viewport_failed_error; extern gchar *failed_string; /** * */ int init_script_error_messages(); void done_script_error_messages(); #endif /*__HEADER_ERROR_STRINGS_*/ devilspie2-0.31/src/error_strings.c0000644000175000017500000000763112207660372016724 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2012-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #include #include #include #include "error_strings.h" gchar *no_indata_expected_error=NULL; gchar *one_indata_expected_error=NULL; gchar *two_indata_expected_error=NULL; gchar *four_indata_expected_error=NULL; gchar *number_expected_as_indata_error=NULL; gchar *boolean_expected_as_indata_error=NULL; gchar *string_expected_as_indata_error=NULL; gchar *integer_greater_than_zero_expected_error=NULL; gchar *could_not_find_current_viewport_error=NULL; gchar *setting_viewport_failed_error=NULL; gchar *failed_string=NULL; /** * */ int init_script_error_messages() { #define ALLOCATE_ERROR_STRING _("Couldn't allocate error string!") no_indata_expected_error=g_strdup_printf(_("No indata expected")); if (!no_indata_expected_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } one_indata_expected_error=g_strdup_printf(_("One indata expected")); if (!one_indata_expected_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } two_indata_expected_error=g_strdup_printf(_("Two indata expected")); if (!two_indata_expected_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } four_indata_expected_error=g_strdup_printf(_("Four indata expected")); if (!four_indata_expected_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } number_expected_as_indata_error= g_strdup_printf(_("Number expected as indata")); if (!number_expected_as_indata_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } boolean_expected_as_indata_error= g_strdup_printf(_("Boolean expected as indata")); if (!boolean_expected_as_indata_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } string_expected_as_indata_error= g_strdup_printf(_("String expected as indata")); if (!string_expected_as_indata_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } integer_greater_than_zero_expected_error= g_strdup_printf(_("Integer greater than zero expected")); if (!integer_greater_than_zero_expected_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } could_not_find_current_viewport_error= g_strdup_printf(_("Could not find current viewport")); if (!could_not_find_current_viewport_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } setting_viewport_failed_error= g_strdup_printf(_("Setting viewport failed")); if (!setting_viewport_failed_error) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } failed_string=g_strdup_printf(_("Failed!")); if (!failed_string) { printf("%s", ALLOCATE_ERROR_STRING); printf("\n"); return -1; } return 0; } /** * */ void done_script_error_messages() { g_free(no_indata_expected_error); g_free(one_indata_expected_error); g_free(two_indata_expected_error); g_free(four_indata_expected_error); g_free(number_expected_as_indata_error); g_free(boolean_expected_as_indata_error); g_free(string_expected_as_indata_error); g_free(integer_greater_than_zero_expected_error); g_free(could_not_find_current_viewport_error); g_free(setting_viewport_failed_error); g_free(failed_string); } devilspie2-0.31/src/xutils.h0000644000175000017500000000310612207660372015350 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2001 Havoc Pennington, 2011-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #ifndef __HEADER_XUTILS_ #define __HEADER_XUTILS_ /** * */ Atom my_wnck_atom_get(const char *atom_name); void devilspie2_change_state(Screen *screen, Window xwindow, gboolean add, Atom state1, Atom state2); Screen* devilspie2_window_get_xscreen(Window xid); void devilspie2_error_trap_push(); int devilspie2_error_trap_pop(); gboolean decorate_window(Window xid); gboolean undecorate_window(Window xid); char* my_wnck_get_string_property_latin1 (Window xwindow, Atom atom); gboolean my_wnck_get_cardinal_list(Window xwindow, Atom atom, gulong **cardinals, int *len); int devilspie2_get_viewport_start(Window xwindow); void my_window_set_window_type(Window xid, gchar *window_type); void my_window_set_opacity(Window xid, double value); #endif /*__HEADER_XUTILS_*/ devilspie2-0.31/src/script.c0000644000175000017500000001356512207660372015331 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2011-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #define WNCK_I_KNOW_THIS_IS_UNSTABLE #include #include #include #include #include #include #include #include #define _(String) gettext (String) #define gettext_noop(String) String #define N_(String) gettext_noop (String) #include "script.h" #if (GTK_MAJOR_VERSION >= 3) #define HAVE_GTK3 #endif #include "script_functions.h" /** * */ gboolean script_loaded=FALSE; gboolean devilspie2_debug=FALSE; gboolean devilspie2_emulate=FALSE; lua_State *global_lua_state=NULL; /** * */ lua_State * init_script() { lua_State *lua=luaL_newstate(); luaL_openlibs(lua); register_cfunctions(lua); return lua; } /** * */ void register_cfunctions(lua_State *lua) { lua_register(lua, "get_window_name", c_get_window_name); lua_register(lua, "get_window_has_name", c_get_window_has_name); lua_register(lua, "set_window_position", c_set_window_position); lua_register(lua, "set_window_position2", c_set_window_position2); lua_register(lua, "set_window_size", c_set_window_size); lua_register(lua, "set_window_geometry", c_set_window_geometry); lua_register(lua, "set_window_geometry2", c_set_window_geometry2); lua_register(lua, "get_application_name", c_get_application_name); lua_register(lua, "make_always_on_top", c_make_always_on_top); lua_register(lua, "set_on_top", c_set_on_top); lua_register(lua, "debug_print", c_debug_print); lua_register(lua, "shade", c_shade_window); lua_register(lua, "unshade", c_unshade_window); lua_register(lua, "maximize", c_maximize_window); lua_register(lua, "maximize_horisontally", c_maximize_window_horisontally); lua_register(lua, "maximize_horizontally", c_maximize_window_horisontally); lua_register(lua, "maximize_vertically", c_maximize_window_vertically); lua_register(lua, "unmaximize", c_unmaximize_window); lua_register(lua, "minimize", c_minimize_window); lua_register(lua, "unminimize", c_unminimize_window); lua_register(lua, "decorate_window", c_decorate_window); lua_register(lua, "undecorate_window", c_undecorate_window); lua_register(lua, "set_window_workspace", c_set_window_workspace); lua_register(lua, "change_workspace", c_change_workspace); lua_register(lua, "get_workspace_count", c_get_workspace_count); lua_register(lua, "pin_window", c_pin_window); lua_register(lua, "unpin_window", c_unpin_window); lua_register(lua, "stick_window", c_stick_window); lua_register(lua, "unstick_window", c_unstick_window); lua_register(lua, "close_window", c_close_window); lua_register(lua, "get_window_geometry", c_get_window_geometry); lua_register(lua, "get_window_client_geometry", c_get_client_window_geometry); lua_register(lua, "set_skip_tasklist", c_set_skip_tasklist); lua_register(lua, "set_skip_pager", c_set_skip_pager); lua_register(lua, "get_window_is_maximized", c_get_window_is_maximized); lua_register(lua, "get_window_is_maximized_vertically", c_get_window_is_maximized_vertically); lua_register(lua, "get_window_is_maximized_horisontally", c_get_window_is_maximized_horisontally); lua_register(lua, "get_window_is_maximized_horizontally", c_get_window_is_maximized_horisontally); lua_register(lua, "set_window_below", c_set_window_below); lua_register(lua, "set_window_above", c_set_window_above); lua_register(lua, "set_window_fullscreen", c_set_window_fullscreen); lua_register(lua, "get_window_type", c_get_window_type); lua_register(lua, "get_window_property", c_get_window_property); lua_register(lua, "get_window_role", c_get_window_role); lua_register(lua, "get_window_xid", c_get_window_xid); lua_register(lua, "get_window_class", c_get_window_class); lua_register(lua, "set_viewport", c_set_viewport); lua_register(lua, "center", c_center); lua_register(lua, "set_opacity", c_set_opacity); lua_register(lua, "set_window_opacity", c_set_opacity); lua_register(lua, "set_window_type", c_set_window_type); lua_register(lua, "get_screen_geometry", c_get_screen_geometry); #ifdef HAVE_GTK3 // wnck_window_get_class_instance_name is only availible on wnck 3 and later lua_register(lua, "get_class_instance_name",c_get_class_instance_name); #endif lua_register(lua, "focus", c_focus); lua_register(lua, "focus_window", c_focus); } /** * */ int load_script(lua_State *lua,char *filename) { if (lua) { int result=luaL_loadfile(lua,filename); if (!result) { script_loaded=TRUE; } else { // We got an error, print it printf("%s\n",lua_tostring(lua,-1)); lua_pop(lua,1); return -1; } } else { return -1; } return 0; } /** * */ void run_script(lua_State *lua) { int s = lua_pcall( lua, 0, LUA_MULTRET, 0 ); if (s) { char *error_msg; error_msg=(char*)lua_tostring( lua, -1 ); //std::string luaErrorString=getLuaErrorString(s); /* mssOut.str( "" ); mssOut << "Script::runScript : Error caught running script " << sScriptName << "\n" << " Error code is " << luaErrorString << ".\n" << " Error msg is: " << errorMsg; throw( ScriptException( mssOut.str().c_str(), errorMsg ) ); */ printf(_("Error: %s"),error_msg); printf("\n"); } } /** * */ void done_script(lua_State *lua) { if (lua) lua_close(lua); //lua=NULL; } devilspie2-0.31/src/script_functions.c0000644000175000017500000007644712207660372017431 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2011-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #include #define WNCK_I_KNOW_THIS_IS_UNSTABLE #include #include #include #include #include #include #include #define _(String) gettext (String) #define gettext_noop(String) String #define N_(String) gettext_noop (String) #include #include #include #if (GTK_MAJOR_VERSION >= 3) #define HAVE_GTK3 #endif #include "script_functions.h" #include "script.h" #include "xutils.h" #include "error_strings.h" /** * */ WnckWindow *current_window = NULL; /** * returns the window name */ int c_get_window_name(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_name: %s", no_indata_expected_error); return 0; } char *test = NULL; WnckWindow *window = get_current_window(); if (window) { test=(char*)wnck_window_get_name(window); } else { test = ""; } lua_pushstring(lua, test); // one item returned (the window name as a string) return 1; } /** * c_get_window_name always returns a string, even if a window hasn't * got a name - use this function to determine if a window really has * a name or not. * returns a boolean true or false */ int c_get_window_has_name(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_has_name: %s", no_indata_expected_error); return 0; } gboolean has_name = FALSE; WnckWindow *window = get_current_window(); if (window) { has_name = wnck_window_has_name(window); } lua_pushboolean(lua, has_name); return 1; } /** * Set the Window Geometry * set_window_geometry(x,y,xsize,ysize); */ int c_set_window_geometry(lua_State *lua) { int top = lua_gettop(lua); if (top!=4) { luaL_error(lua, "set_window_geometry: %s", four_indata_expected_error); return 0; } int type1 = lua_type(lua, 1); int type2 = lua_type(lua, 2); int type3 = lua_type(lua, 3); int type4 = lua_type(lua, 4); if ((type1!=LUA_TNUMBER) || (type2!=LUA_TNUMBER) || (type3!=LUA_TNUMBER) || (type4!=LUA_TNUMBER)) { luaL_error(lua, "set_window_geometry: %s", four_indata_expected_error); return 0; } int x = lua_tonumber(lua, 1); int y = lua_tonumber(lua, 2); int xsize = lua_tonumber(lua, 3); int ysize = lua_tonumber(lua, 4); if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { WnckScreen *screen = wnck_window_get_screen(window); int sw = wnck_screen_get_width(screen); int sh = wnck_screen_get_height(screen); int gravity = WNCK_WINDOW_GRAVITY_CURRENT; if (x >= 0 && y >= 0) gravity = WNCK_WINDOW_GRAVITY_NORTHWEST; if (x >= 0 && y < 0) gravity = WNCK_WINDOW_GRAVITY_SOUTHWEST; if (x < 0 && y >= 0) gravity = WNCK_WINDOW_GRAVITY_NORTHEAST; if (x < 0 && y < 0) gravity = WNCK_WINDOW_GRAVITY_SOUTHEAST; if (x < 0) x = sw + x; if (y < 0) y = sh + y; wnck_window_set_geometry(window, gravity, WNCK_WINDOW_CHANGE_X + WNCK_WINDOW_CHANGE_Y + WNCK_WINDOW_CHANGE_WIDTH + WNCK_WINDOW_CHANGE_HEIGHT, x, y, xsize, ysize); } } return 0; } /** * Set the Window Geometry2 * set_window_geometry2(x,y,xsize,ysize); */ int c_set_window_geometry2(lua_State *lua) { int top = lua_gettop(lua); if (top!=4) { luaL_error(lua,"set_window_geometry: %s",four_indata_expected_error); return 0; } int type1=lua_type(lua, 1); int type2=lua_type(lua, 2); int type3=lua_type(lua, 3); int type4=lua_type(lua, 4); if ((type1!=LUA_TNUMBER) || (type2!=LUA_TNUMBER) || (type3!=LUA_TNUMBER) || (type4!=LUA_TNUMBER)) { luaL_error(lua, "set_window_geometry: %s", four_indata_expected_error); return 0; } int x=lua_tonumber(lua, 1); int y=lua_tonumber(lua, 2); int xsize=lua_tonumber(lua, 3); int ysize=lua_tonumber(lua, 4); if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { XMoveResizeWindow(gdk_x11_get_default_xdisplay(), wnck_window_get_xid(window), x,y, xsize,ysize); } } return 0; } /** * Set the position of the window */ int c_set_window_position(lua_State *lua) { int top = lua_gettop(lua); if (top!=2) { luaL_error(lua,"set_window_position: %s", two_indata_expected_error); return 0; } int type1=lua_type(lua, 1); int type2=lua_type(lua, 2); if ((type1!=LUA_TNUMBER) || (type2!=LUA_TNUMBER)) { luaL_error(lua, "set_window_position: %s", two_indata_expected_error); return 0; } int x=lua_tonumber(lua, 1); int y=lua_tonumber(lua, 2); if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_set_geometry(window, WNCK_WINDOW_GRAVITY_CURRENT, WNCK_WINDOW_CHANGE_X + WNCK_WINDOW_CHANGE_Y, x, y, -1, -1); } } return 0; } /** * */ int c_set_window_position2(lua_State *lua) { int top = lua_gettop(lua); if (top!=2) { luaL_error(lua,"set_window_position2: %s", two_indata_expected_error); return 0; } int type1=lua_type(lua,1); int type2=lua_type(lua,2); if ((type1!=LUA_TNUMBER) || (type2!=LUA_TNUMBER)) { luaL_error(lua,"set_window_position2: %s", two_indata_expected_error); return 0; } int x=lua_tonumber(lua,1); int y=lua_tonumber(lua,2); if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { XMoveWindow(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), wnck_window_get_xid(window), x,y); } } return 0; } /** * Sets the size of the window */ int c_set_window_size(lua_State *lua) { int top = lua_gettop(lua); if (top!=2) { luaL_error(lua,"set_window_size: %s", two_indata_expected_error); return 0; } int type1=lua_type(lua,1); int type2=lua_type(lua,2); if ((type1!=LUA_TNUMBER) || (type2!=LUA_TNUMBER)) { luaL_error(lua,"set_window_size: %s", two_indata_expected_error); return 0; } int x = lua_tonumber(lua,1); int y = lua_tonumber(lua,2); if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { devilspie2_error_trap_push(); wnck_window_set_geometry(window, WNCK_WINDOW_GRAVITY_CURRENT, WNCK_WINDOW_CHANGE_WIDTH + WNCK_WINDOW_CHANGE_HEIGHT, -1, -1, x, y); if (devilspie2_error_trap_pop()) { gchar *temperror= g_strdup_printf("set_window_size: %s", failed_string); g_printerr("%s", temperror); g_free(temperror); } } } return 0; } /** * Sets the window on top of all others and locks it "always on top" */ int c_make_always_on_top(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "make_always_on_top: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_make_above(window); } } return 0; } /** * sets the window on top of all the others */ int c_set_on_top(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "set_on_top: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_make_above(window); wnck_window_unmake_above(window); } } return 0; } /** * returns the application name */ int c_get_application_name(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_application_name: %s", no_indata_expected_error); return 0; } const char *application_name; WnckWindow *window = get_current_window(); if (window) { WnckApplication *application= wnck_window_get_application(get_current_window()); application_name = wnck_application_get_name(application); } else { application_name = ""; } // one item returned - the application name as a string. lua_pushstring(lua, application_name); return 1; } /** * lua_Bprint from http://www.lua.org/source/5.1/lbaselib.c.html * but with the change that fputs is only called if devilspie2_debug is * set to TRUE */ int c_debug_print(lua_State *lua) { int n = lua_gettop(lua); /* number of arguments */ int i; lua_getglobal(lua, "tostring"); for (i=1; i<=n; i++) { const char *s; lua_pushvalue(lua, -1); /* function to be called */ lua_pushvalue(lua, i); /* value to print */ lua_call(lua, 1, 1); s = lua_tostring(lua, -1); /* get result */ if (s == NULL) return luaL_error(lua, LUA_QL("tostring") " must return a string to " LUA_QL("print")); if (i>1) { if (devilspie2_debug) fputs("\t", stdout); } if (devilspie2_debug) fputs(s, stdout); lua_pop(lua, 1); /* pop result */ } if (devilspie2_debug) fputs("\n", stdout); return 0; } /** * "Shades" the window */ int c_shade_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"shade_window: %s",no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_shade(window); } } return 0; } /** * "Unshades" the window */ int c_unshade_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"unshade_window: %s"); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_unshade(window); } } return 0; } /** * Minimizes the window */ int c_minimize_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"minimize_window: %s",no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_minimize(window); } } return 0; } /** * unminimizes window */ int c_unminimize_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"unminimize_window: %s",no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_unminimize (window, GDK_CURRENT_TIME); } } return 0; } /** * sets the window that the scripts are affecting */ void set_current_window(WnckWindow *window) { current_window=window; } /** * gets the window that the scripts are affecting */ WnckWindow *get_current_window() { return current_window; } /** * Decorates a window */ int c_undecorate_window(lua_State *lua) { gboolean result=TRUE; int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"undecorate_window: %s",no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { if (!devilspie2_emulate) { gulong xid = wnck_window_get_xid(window); if (!undecorate_window(xid)) { result=FALSE; } } } } lua_pushboolean(lua,result); return 1; } /** * undecorates a window */ int c_decorate_window(lua_State *lua) { gboolean result=TRUE; int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"decorate_window: %s",no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { if (!devilspie2_emulate) { gulong xid = wnck_window_get_xid(window); if (!decorate_window(xid)) { result=FALSE; } } } } lua_pushboolean(lua,result); return 1; } /** * Move a window to a specific workspace */ int c_set_window_workspace(lua_State *lua) { int top = lua_gettop(lua); if (top!=1) { luaL_error(lua,"set_window_workspace: %s", one_indata_expected_error); return 0; } int type=lua_type(lua, 1); if (type!=LUA_TNUMBER) { luaL_error(lua, "set_window_workspace: %s", number_expected_as_indata_error); return 0; } int number=lua_tonumber(lua, 1); WnckWindow *window = get_current_window(); if (window) { WnckScreen *screen; WnckWorkspace *workspace; screen = wnck_window_get_screen(window); workspace = wnck_screen_get_workspace(screen, number-1); if (!workspace) { g_warning(_("Workspace number %d does not exist!"), number); } if (!devilspie2_emulate) { wnck_window_move_to_workspace(window, workspace); } } lua_pushboolean(lua,TRUE); return 1; } /** * Makes a workspace the active one */ int c_change_workspace(lua_State *lua) { int top = lua_gettop(lua); GTimeVal timestamp; if (top!=1) { luaL_error(lua,"change_workspace: %s", one_indata_expected_error); return 0; } int type=lua_type(lua, 1); if (type!=LUA_TNUMBER) { luaL_error(lua,"change_workspace: %s", number_expected_as_indata_error); return 0; } int number=lua_tonumber(lua, 1); WnckWindow *window = get_current_window(); if (window) { WnckScreen *screen; WnckWorkspace *workspace; screen = wnck_window_get_screen(window); workspace = wnck_screen_get_workspace(screen, number-1); if (!workspace) { g_warning(_("Workspace number %d does not exist!"), number); } g_get_current_time(×tamp); if (!devilspie2_emulate) { wnck_workspace_activate(workspace, timestamp.tv_sec); } } lua_pushboolean(lua, TRUE); return 1; } /** * Return workspace count */ int c_get_workspace_count(lua_State *lua) { int count = 0; int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"get_workspace_count: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); if (window) { WnckScreen *screen; screen = wnck_window_get_screen(window); count = wnck_screen_get_workspace_count(screen); } lua_pushnumber(lua, count); return 1; } /** * Unmaximize window */ int c_unmaximize_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"unmaximize: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_unmaximize(window); } } return 0; } /** * Maximize Window */ int c_maximize_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"maximize: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_maximize(window); } } return 0; } /** * Maximize Window Vertically */ int c_maximize_window_vertically(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"maximize_vertically: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_maximize_vertically(window); } } return 0; } /** * Maximize the window horisontally */ int c_maximize_window_horisontally(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"maximize_horisontally: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_maximize_horizontally(window); } } return 0; } /** * Pins the window */ int c_pin_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"pin_window: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_pin(window); } } return 0; } /** * Unpin the window */ int c_unpin_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"unpin_window: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_unpin(window); } } return 0; } /** * Sticks the window */ int c_stick_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"stick_window: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_stick(window); } } return 0; } /** * Unstick the window */ int c_unstick_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"unstick_window: %s", no_indata_expected_error); return 0; } if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_unstick(window); } } return 0; } /** * return the geometry of the current window to the LUA script */ int c_get_window_geometry(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"get_window_geometry: %s", no_indata_expected_error); return 0; } int x, y, width, height; WnckWindow *window = get_current_window(); if (window) { wnck_window_get_geometry(window,&x,&y,&width,&height); } lua_pushnumber(lua, x); lua_pushnumber(lua, y); lua_pushnumber(lua, width); lua_pushnumber(lua, height); return 4; } /** * return the client geometry of the current window to the LUA script * this is excluding the window manager frame */ int c_get_client_window_geometry(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"get_client_window_geometry: %s",no_indata_expected_error); return 0; } int x, y, width, height; WnckWindow *window = get_current_window(); if (window) { wnck_window_get_client_window_geometry(window, &x, &y, &width, &height); } lua_pushnumber(lua, x); lua_pushnumber(lua, y); lua_pushnumber(lua, width); lua_pushnumber(lua, height); return 4; } /** * */ int c_set_skip_tasklist(lua_State *lua) { int top = lua_gettop(lua); if (top!=1) { luaL_error(lua, "set_skip_tasklist: %s", one_indata_expected_error); return 0; } int type = lua_type(lua, 1); if (type!=LUA_TBOOLEAN) { luaL_error(lua, "set_skip_tasklist: %s", boolean_expected_as_indata_error); return 0; } int value=lua_toboolean(lua, 1); gboolean skip_tasklist = (gboolean)(value); if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_set_skip_tasklist(window, skip_tasklist); } } return 0; } /** * */ int c_set_skip_pager(lua_State *lua) { int top = lua_gettop(lua); if (top!=1) { luaL_error(lua, "set_skip_pager: %s", one_indata_expected_error); return 0; } int type=lua_type(lua, 1); if (type!=LUA_TBOOLEAN) { luaL_error(lua, "set_skip_pager: %s", boolean_expected_as_indata_error); return 0; } int value = lua_toboolean(lua, 1); gboolean skip_pager=(gboolean)(value); if (!devilspie2_emulate) { WnckWindow *window = get_current_window(); if (window) { wnck_window_set_skip_pager(window,skip_pager); } } return 0; } /** * */ int c_get_window_is_maximized(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_is__maximized: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); gboolean is_maximized = FALSE; if (window) { is_maximized = wnck_window_is_maximized(window); } lua_pushboolean(lua, is_maximized); return 1; } /** * */ int c_get_window_is_maximized_vertically(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_is_horisontally_maximized: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); gboolean is_vertically_maximized = FALSE; if (window) { is_vertically_maximized = wnck_window_is_maximized_vertically(window); } lua_pushboolean(lua, is_vertically_maximized); return 1; } /** * */ int c_get_window_is_maximized_horisontally(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_is_horisontally_maximized: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); gboolean is_horisontally_maximized = FALSE; if (window) { is_horisontally_maximized = wnck_window_is_maximized_horizontally(window); } lua_pushboolean(lua, is_horisontally_maximized); return 1; } /** * */ int c_set_window_above(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"set_window_above: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); if (!devilspie2_emulate) { Window xid = wnck_window_get_xid(window); devilspie2_change_state(devilspie2_window_get_xscreen(xid), xid, TRUE, my_wnck_atom_get("_NET_WM_STATE_ABOVE"), 0); } return 0; } /** * */ int c_set_window_below(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"set_window_above: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); if (!devilspie2_emulate) { Window xid = wnck_window_get_xid(window); devilspie2_change_state(devilspie2_window_get_xscreen(xid), xid, TRUE, my_wnck_atom_get("_NET_WM_STATE_BELOW"), 0); } return 0; } /** * */ int c_get_window_type(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua,"get_window_type: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); gchar *window_type_string = NULL; if (window) { WnckWindowType window_type = wnck_window_get_window_type(window); switch (window_type) { case WNCK_WINDOW_NORMAL: window_type_string = g_strdup("WINDOW_TYPE_NORMAL"); break; case WNCK_WINDOW_DESKTOP: window_type_string = g_strdup("WINDOW_TYPE_DESKTOP"); break; case WNCK_WINDOW_DOCK: window_type_string = g_strdup("WINDOW_TYPE_DOCK"); break; case WNCK_WINDOW_DIALOG: window_type_string = g_strdup("WINDOW_TYPE_DIALOG"); break; case WNCK_WINDOW_TOOLBAR: window_type_string = g_strdup("WINDOW_TYPE_TOOLBAR"); break; case WNCK_WINDOW_MENU: window_type_string = g_strdup("WINDOW_TYPE_MENU"); break; case WNCK_WINDOW_UTILITY: window_type_string = g_strdup("WINDOW_TYPE_UTILITY"); break; case WNCK_WINDOW_SPLASHSCREEN: window_type_string = g_strdup("WINDOW_TYPE_SPLASHSCREEN"); break; default: window_type_string = g_strdup("WINDOW_TYPE_UNRECOGNIZED"); }; } else { window_type_string = g_strdup("WINDOW_ERROR"); } lua_pushstring(lua, window_type_string); g_free(window_type_string); return 1; } #ifdef HAVE_GTK3 /** * c_get_class_instance_name * Only available on libwnck 3+ */ int c_get_class_instance_name(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_class_instance_name: %s", no_indata_expected_error); return 0; } const char *class_instance_name; WnckWindow *window = get_current_window(); if (window) { class_instance_name = wnck_window_get_class_instance_name(window); } else { class_instance_name=""; } // one item returned - the window class instance name as a string. lua_pushstring(lua, class_instance_name); return 1; } #endif /** * */ int c_get_window_property(lua_State *lua) { int top = lua_gettop(lua); if (top!=1) { luaL_error(lua, "get_window_property: %s", one_indata_expected_error); return 0; } // gchar *property= int type=lua_type(lua, 1); if (type!=LUA_TSTRING) { luaL_error(lua,"get_window_property: %s",string_expected_as_indata_error); return 0; } const gchar *value = lua_tostring(lua, 1); WnckWindow *window = get_current_window(); gchar *result=NULL; if (window) { result = my_wnck_get_string_property_latin1(wnck_window_get_xid(window), my_wnck_atom_get(value)); } else { result = g_strdup_printf("NO RESULT"); } if (result) { lua_pushstring(lua, result); } else { lua_pushstring(lua, ""); } g_free(result); return 1; } /** * */ int c_get_window_role(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_role: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); gchar *result = NULL; if (window) { result = my_wnck_get_string_property_latin1(wnck_window_get_xid(window), my_wnck_atom_get("WM_WINDOW_ROLE")); } if (result) { lua_pushstring(lua, result); } else { lua_pushstring(lua, ""); } g_free(result); return 1; } /** * */ int c_get_window_xid(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_xid: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); gulong result; if (window) { result = wnck_window_get_xid(window); } else { result = 0; } lua_pushnumber(lua, result); return 1; } /** * */ int c_get_window_class(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_window_class: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); gchar *result; if (window) { WnckClassGroup *class_group = wnck_window_get_class_group(window); #ifdef WNCK_MAJOR_VERSION #if WNCK_CHECK_VERSION(3,2,0) gchar *class_name=(char*)wnck_class_group_get_id(class_group); #else gchar *class_name=(char*)wnck_class_group_get_res_class (class_group); #endif #else gchar *class_name = (char*)wnck_class_group_get_res_class (class_group); #endif result = g_strdup(class_name); } else { result = g_strdup(""); } lua_pushstring(lua, result); g_free(result); return 1; } /** * */ int c_set_window_fullscreen(lua_State *lua) { int top = lua_gettop(lua); if (top!=1) { luaL_error(lua, "set_window_fullscreen: %s", one_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); int type=lua_type(lua, 1); if (type!=LUA_TBOOLEAN) { luaL_error(lua, "set_window_fullscreen: %s", boolean_expected_as_indata_error); return 0; } gboolean fullscreen = lua_toboolean(lua, 1); if (window) { if (!devilspie2_emulate) { wnck_window_set_fullscreen(window, fullscreen); } } return 0; } /** * */ int c_set_viewport(lua_State *lua) { int top = lua_gettop(lua); WnckScreen *screen; int x,y,width,height, viewport_start; if (top!=1) { luaL_error(lua, "set_viewport: %s", one_indata_expected_error); return 0; } int type=lua_type(lua, 1); if (type!=LUA_TNUMBER) { luaL_error(lua, "set_viewport: %s", number_expected_as_indata_error); return 0; } int num = lua_tonumber(lua,1); if (num<=0) { g_error("set_viewport: %s", integer_greater_than_zero_expected_error); lua_pushboolean(lua, FALSE); return 1; } WnckWindow *window = get_current_window(); if (!window) { lua_pushboolean(lua, FALSE); return 1; } screen = wnck_window_get_screen(window); wnck_window_get_geometry(window, &x, &y, &width, &height); gulong xid = wnck_window_get_xid(window); viewport_start = devilspie2_get_viewport_start(xid); if (viewport_start<0) { g_printerr("set_viewport: %s", could_not_find_current_viewport_error); lua_pushboolean(lua, FALSE); return 1; } x=((num-1) * wnck_screen_get_width(screen)) - viewport_start + x; devilspie2_error_trap_push(); XMoveResizeWindow(gdk_x11_get_default_xdisplay(), wnck_window_get_xid(window), x,y,width,height); if (devilspie2_error_trap_pop()) { g_printerr("set_viewport: %s",setting_viewport_failed_error); lua_pushboolean(lua, FALSE); return 1; } lua_pushboolean(lua, TRUE); return 1; } /** * */ int c_center(lua_State *lua) { int top = lua_gettop(lua); int workspace_width, workspace_height, window_width, window_height; int xoffset, yoffset; WnckScreen *screen; WnckWorkspace *workspace; if (top!=0) { luaL_error(lua, "center: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); if (!window) { lua_pushboolean(lua, FALSE); return 1; } wnck_window_get_geometry(window, NULL, NULL, &window_width, &window_height); screen = wnck_window_get_screen(window); workspace = wnck_screen_get_active_workspace(screen); if (workspace==NULL) { workspace = wnck_screen_get_workspace(screen,0); } if (workspace==NULL) { g_printerr(_("Could not get workspace")); lua_pushboolean(lua, FALSE); return 1; } workspace_width = wnck_workspace_get_width(workspace); workspace_height = wnck_workspace_get_height(workspace); xoffset = (workspace_width - window_width) / 2; yoffset = (workspace_height - window_height) / 2; devilspie2_error_trap_push(); XMoveWindow (gdk_x11_get_default_xdisplay(), wnck_window_get_xid(window), xoffset, yoffset); if (devilspie2_error_trap_pop()) { g_printerr("center: %s", failed_string); lua_pushboolean(lua, FALSE); return 1; } lua_pushboolean(lua, TRUE); return 1; } /** * */ int c_set_opacity(lua_State *lua) { int top = lua_gettop(lua); //WnckScreen *screen; if (top!=1) { luaL_error(lua, "set_opacity: %s", one_indata_expected_error); return 0; } int type=lua_type(lua, 1); if (type!=LUA_TNUMBER) { luaL_error(lua, "set_opacity: %s", number_expected_as_indata_error); return 0; } double value = (double)lua_tonumber(lua, 1); WnckWindow *window = get_current_window(); gulong xid = wnck_window_get_xid(window); if (window) my_window_set_opacity(xid, value); return 0; } /** * */ int c_set_window_type(lua_State *lua) { int top = lua_gettop(lua); if (top!=1) { luaL_error(lua, "set_window_type: %s", one_indata_expected_error); return 0; } int type=lua_type(lua, 1); if (type!=LUA_TSTRING) { luaL_error(lua, "set_window_type: %s", string_expected_as_indata_error); return 0; } gchar *indata = (gchar*)lua_tostring(lua, 1); WnckWindow *window = get_current_window(); if (window) { gulong xid = wnck_window_get_xid(window); my_window_set_window_type(xid, indata); } return 0; } /** * return the geometry of the screen to the LUA script */ int c_get_screen_geometry(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "get_screen_geometry: %s", no_indata_expected_error); return 0; } int width = -1, height = -1; WnckWindow *window = get_current_window(); if (window) { WnckScreen *screen; screen = wnck_window_get_screen(window); width = wnck_screen_get_width(screen); height = wnck_screen_get_height(screen); } lua_pushnumber(lua, width); lua_pushnumber(lua, height); return 2; } /** * */ int c_focus(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "focus: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); if (window) { wnck_window_activate(window, GDK_CURRENT_TIME); } return 0; } /** * */ int c_close_window(lua_State *lua) { int top = lua_gettop(lua); if (top!=0) { luaL_error(lua, "close_window: %s", no_indata_expected_error); return 0; } WnckWindow *window = get_current_window(); if (window) { wnck_window_close(window, GDK_CURRENT_TIME); } return 0; } /* * Devilspie: * Focus the current window. ESExpResult *func_focus(ESExp *f, int argc, ESExpResult **argv, Context *c) { wnck_window_activate (c->window, GDK_CURRENT_TIME); if (debug) g_printerr (_("Focusing\n")); return e_sexp_result_new_bool (f, TRUE); } */ devilspie2-0.31/src/script.h0000644000175000017500000000215412207660372015326 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2011-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #ifndef __HEADER_SCRIPT_ #define __HEADER_SCRIPT_ /** * */ /** * */ lua_State *init_script(); void register_cfunctions(lua_State *lua); int load_script(lua_State *lua,char *filename); void run_script(lua_State *lua); void done_script(lua_State *lua); extern gboolean devilspie2_debug; extern gboolean devilspie2_emulate; extern lua_State *global_lua_state; #endif /*__HEADER_SCRIPT_*/ devilspie2-0.31/src/config.c0000644000175000017500000001272312207660372015265 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #include #define WNCK_I_KNOW_THIS_IS_UNSTABLE #include #include #include #include #include #include #include "script.h" #include "script_functions.h" #include "config.h" /** * */ GSList *file_window_open_list = NULL; GSList *file_window_close_list = NULL; /** * filename_list_sortfunc * function to sort the inserted filenames, to be able to determine * which order files are loaded. */ gint filename_list_sortfunc(gconstpointer a,gconstpointer b) { gchar *file1 = (gchar*)a; gchar *file2 = (gchar*)b; return g_ascii_strcasecmp(file1, file2); } /** * */ GSList *add_lua_file_to_list(GSList *list, gchar *filename) { gchar *temp_filename = g_strdup(filename); list=g_slist_insert_sorted(list, temp_filename, filename_list_sortfunc); return list; } /** * */ GSList *get_table_of_strings(lua_State *luastate, gchar *script_folder, gchar *table_name) { GSList *list=NULL; if (luastate) { lua_getglobal(luastate, table_name); // Do we have a value? if (lua_isnil(luastate, -1)) { goto EXITPOINT; } // Is it a table? if (!lua_istable(luastate, -1)) { goto EXITPOINT; } lua_pushnil(luastate); while(lua_next(luastate, -2)) { if (lua_isstring(luastate, -1)) { char *temp = (char *)lua_tostring(luastate, -1); gchar *added_filename = g_build_path(G_DIR_SEPARATOR_S, script_folder, temp, NULL); list = add_lua_file_to_list(list, added_filename); } lua_pop(luastate, 1); } lua_pop(luastate, 1); } EXITPOINT: return list; } /** * is_in_list * Go through _one_ list, and check if the filename is in this list */ gboolean is_in_list(GSList *list, gchar *filename) { gboolean result=FALSE; if (list) { GSList *temp_list = list; while (temp_list) { gchar *list_filename = (gchar*)temp_list->data; if (list_filename) { if (g_ascii_strcasecmp(list_filename, filename)==0) { result=TRUE; } } temp_list = temp_list->next; } } return result; } /** * is_in_any_list * Go through our lists, and check if the file is already in any of them */ gboolean is_in_any_list(gchar *filename) { gboolean result = FALSE; if (is_in_list(file_window_close_list, filename)) result = TRUE; return result; } /** * load_config * Load configuration from a file - From this we set up the lists of files * which decides what script to load on what wnck event. */ int load_config(gchar *filename) { lua_State *config_lua_state = NULL; int result = 0; const gchar *current_file = NULL; GSList *temp_window_open_file_list = NULL; // set the current window to NULL, we don't need to be able to modify // the windows when reading the config set_current_window(NULL); // First get list of Lua files in folder - Then read variables from // devilspie2.lua and put the files in the required lists. gchar *script_folder = g_path_get_dirname(filename); GDir *dir = g_dir_open(script_folder, 0, NULL); if (!g_file_test(script_folder, G_FILE_TEST_IS_DIR)) { printf("%s", _("script_folder isn't a folder.")); printf("\n"); return -1; } int total_number_of_files = 0; config_lua_state = init_script(); if (g_file_test(filename, G_FILE_TEST_EXISTS)) { if (load_script(config_lua_state, filename)!=0) { printf(_("Error: %s"), filename); printf("\n"); result = -1; goto EXITPOINT; } run_script(config_lua_state); file_window_close_list = get_table_of_strings(config_lua_state, script_folder, "scripts_window_close"); } // add the files in the folder to our linked list while ((current_file = g_dir_read_name(dir))) { gchar *temp_filename = g_build_path(G_DIR_SEPARATOR_S, script_folder, current_file, NULL); // we only bother with *.lua in the folder if (g_str_has_suffix(current_file, ".lua")) { if (!is_in_any_list(temp_filename)) { temp_window_open_file_list = add_lua_file_to_list(temp_window_open_file_list, temp_filename); } total_number_of_files++; } g_free(temp_filename); } file_window_open_list = temp_window_open_file_list; EXITPOINT: if (config_lua_state) done_script(config_lua_state); return result; } /** * */ void unalloacte_file_list(GSList *file_list) { if (file_list) { while(file_list) { gchar *file_name = (gchar*)file_list->data; if (file_name) g_free(file_name); file_list = file_list->next; } } } /** * */ void clear_file_lists() { if (file_window_open_list) { unalloacte_file_list(file_window_open_list); } if (file_window_close_list) { unalloacte_file_list(file_window_close_list); } } devilspie2-0.31/src/config.h0000644000175000017500000000206412207660372015267 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #ifndef __HEADER_CONFIG_ #define __HEADER_CONFIG_ /** * */ int load_config(gchar *config_filename); void clear_file_lists(); extern GSList *file_window_open_list; extern GSList *file_window_close_list; // Our git version which is defined through some magic in the build system extern const char *gitversion; #endif /*__HEADER_CONFIG_*/ devilspie2-0.31/src/devilspie2.c0000644000175000017500000002310512207660372016062 0ustar gusnangusnan/** * This file is part of devilspie2 * Copyright (C) 2005 Ross Burton, 2011-2013 Andreas Rönnquist * * devilspie2 is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * devilspie2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with devilspie2. * If not, see . */ #include #include #include #include #include #include #include #define WNCK_I_KNOW_THIS_IS_UNSTABLE #include #include #include #include #include #include "script.h" #include "script_functions.h" #include "error_strings.h" #include "config.h" /** * */ GMainLoop *loop = NULL; static gboolean debug = FALSE; static gboolean emulate = FALSE; static gboolean show_version = FALSE; #ifdef HAVE_GTK3 // libwnck Version Information is only availible if you have // libwnck 3.0 or later static gboolean show_wnck_version = FALSE; #endif static gchar *script_folder = NULL; static gchar *temp_folder = NULL; GFileMonitor *mon = NULL; gchar *config_filename = NULL; /** * */ static void load_list_of_scripts(WnckScreen *screen, WnckWindow *window, GSList *file_list) { GSList *temp_file_list = file_list; // set the window to work on set_current_window(window); // for every file in the folder - load the script if (file_window_open_list != NULL) { while(temp_file_list) { gchar *filename = (gchar*)temp_file_list->data; // is it a LUA file? if (g_str_has_suffix((gchar*)filename,".lua")) { // init the script, run it if (!load_script(global_lua_state, filename)) { } run_script(global_lua_state); } temp_file_list=temp_file_list->next; } } return; } /** * */ static void window_opened_cb(WnckScreen *screen, WnckWindow *window) { load_list_of_scripts(screen, window, file_window_open_list); } /** * */ static void window_closed_cb(WnckScreen *screen, WnckWindow *window) { load_list_of_scripts(screen, window, file_window_close_list); } /** * */ void init_screens() { int i; const int num_screens = gdk_display_get_n_screens(gdk_display_get_default()); for (i=0; idata; if (file_name) { if (g_str_has_suffix((gchar*)file_name, ".lua")) { printf("%s\n", (gchar*)file_name); } } temp_list = temp_list->next; } } } /** * */ void print_script_lists() { if (debug) printf("------------\n"); if ((file_window_open_list == NULL) && (file_window_close_list == NULL)) { printf("%s", _("No script files found in the script folder - exiting.")); printf("\n\n"); exit(EXIT_SUCCESS); } // If we are running debug mode - print the list of files: if (debug) { printf(_("List of LUA files handling \"%s\" events in folder:"), "window_open"); printf("\n"); if (file_window_open_list) print_list(file_window_open_list); } if (debug) { printf(_("List of LUA files handling \"%s\" events in folder:"), "window_close"); printf("\n"); if (file_window_close_list) print_list(file_window_close_list); } } /** * */ void folder_changed_callback(GFileMonitor *mon, GFile *first_file, GFile *second_file, GFileMonitorEvent event, gpointer user_data) { gchar *our_filename = (gchar*)(user_data); // If a file is created or deleted, we need to check the file lists again if ((event == G_FILE_MONITOR_EVENT_CREATED) || (event == G_FILE_MONITOR_EVENT_DELETED)) { clear_file_lists(); load_config(our_filename); if (debug) printf("Files in folder updated!\n - new lists:\n\n"); print_script_lists(); if (debug) printf("-----------\n"); } // Also monitor if our devilspie2.lua file is changed - since it handles // which files are window close or window open scripts. if (event == G_FILE_MONITOR_EVENT_CHANGED) { if (first_file) { gchar *short_filename = g_file_get_basename(first_file); if (g_strcmp0(short_filename, "devilspie2.lua")==0) { clear_file_lists(); load_config(our_filename); print_script_lists(); if (debug) printf("----------"); } } } } /** * Program main entry */ int main(int argc, char *argv[]) { static const GOptionEntry options[]={ { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, N_("Print debug info to stdout")}, { "emulate", 'e', 0, G_OPTION_ARG_NONE, &emulate, N_("Don't apply any rules, only emulate execution")}, { "folder", 'f', 0, G_OPTION_ARG_STRING, &script_folder, N_("Search for scripts in this folder"),N_("FOLDER")}, { "version", 'v', 0, G_OPTION_ARG_NONE, &show_version, N_("Show Devilspie2 version and quit")}, #ifdef HAVE_GTK3 // libwnck Version Information is only availible if you have // libwnck 3.0 or later { "wnck-version", 'w', 0, G_OPTION_ARG_NONE, &show_wnck_version, N_("Show libwnck version and quit")}, #endif { NULL } }; GError *error = NULL; GOptionContext *context; // Init gettext stuff setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); bind_textdomain_codeset(PACKAGE, ""); textdomain(PACKAGE); gdk_init(&argc, &argv); gchar *devilspie2_description = g_strdup_printf(_("apply rules on windows")); gchar *full_desc_string = g_strdup_printf("- %s", devilspie2_description); context=g_option_context_new(full_desc_string); g_option_context_add_main_entries(context,options,NULL); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print(_("option parsing failed: %s"), error->message); printf("\n"); exit(EXIT_FAILURE); } g_free(full_desc_string); g_free(devilspie2_description); // if the folder is NULL, default to ~/.config/devilspie2/ if (script_folder == NULL) { temp_folder = g_build_path(G_DIR_SEPARATOR_S, g_get_user_config_dir(), "devilspie2", NULL); // check if the folder does exist if (!g_file_test(temp_folder, G_FILE_TEST_IS_DIR)) { // - and if it doesn't, create it. if (g_mkdir(temp_folder, 0700) != 0) { printf("%s", _("Couldn't create the default folder for devilspie2 scripts.")); printf("\n"); exit(EXIT_FAILURE); } } script_folder = temp_folder; } if (show_version) { printf("Devilspie2 v%s\n\n", DEVILSPIE2_VERSION); exit(EXIT_SUCCESS); } #ifdef HAVE_GTK3 // libwnck Version Information is only availible if you have // libwnck 3.0 or later if (show_wnck_version) { printf("libwnck v%d.%d.%d\n\n", WNCK_MAJOR_VERSION, WNCK_MINOR_VERSION, WNCK_MICRO_VERSION); exit(EXIT_SUCCESS); } #endif #if (GTK_MAJOR_VERSION >= 3) if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) { printf("%s", _("An X11 display is required for devilspie2.")); printf("\n\n"); return EXIT_FAILURE; } #endif if (init_script_error_messages()!=0) { printf("%s", _("Couldn't init script error messages!")); printf("\n"); exit(EXIT_FAILURE); } config_filename = g_build_filename(script_folder, "devilspie2.lua", NULL); if (load_config(config_filename)!=0) { devilspie_exit(); return EXIT_FAILURE; } if (debug) { if (emulate) { printf("%s", _("Running devilspie2 in debug and emulate mode.")); } else { printf("%s", _("Running devilspie2 in debug mode.")); } printf("\n\n"); printf(_("Using scripts from folder: %s"), script_folder); printf("\n"); devilspie2_debug = TRUE; } // Should we only run an emulation (don't modify any windows) if (emulate) devilspie2_emulate = emulate; GFile *directory_file; directory_file = g_file_new_for_path(script_folder); // mon = g_file_monitor_directory(directory_file, G_FILE_MONITOR_WATCH_MOUNTS, mon = g_file_monitor_directory(directory_file, G_FILE_MONITOR_NONE, NULL, NULL); if (!mon) { printf("%s", _("Couldn't create directory monitor!")); printf("\n"); return EXIT_FAILURE; } g_signal_connect(mon, "changed", G_CALLBACK(folder_changed_callback), (gpointer)(config_filename)); global_lua_state = init_script(); print_script_lists(); if (debug) printf("------------\n"); // remove stuff cleanly atexit(devilspie_exit); struct sigaction signal_action; sigemptyset(&signal_action.sa_mask); signal_action.sa_flags = 0; signal_action.sa_handler = signal_handler; if (sigaction(SIGINT, &signal_action, NULL) == -1) { exit(EXIT_FAILURE); } init_screens(); loop=g_main_loop_new(NULL, TRUE); g_main_loop_run(loop); return EXIT_SUCCESS; } devilspie2-0.31/bin/0000755000175000017500000000000012207660372013630 5ustar gusnangusnandevilspie2-0.31/bin/place_holder.txt0000644000175000017500000000000012207660372017000 0ustar gusnangusnandevilspie2-0.31/ChangeLog0000644000175000017500000001217312207660372014636 0ustar gusnangusnan ChangeLog: ---------- 0.31 * Add close_window function * Remove unused C function my_wnck_get_cardinal * Fix string problems reported by pscan * Updated Russian translation * Added Japanese translation 0.30 * Update French translation * Add function set_window_opacity to do the same as set_opacity * Add maximize_horizontally with same functionality as maximize_horisontally * Add get_window_is_maximized_horizontally with same functionality as get_window_is_maximized_horisontally * Add focus and focus_window functions * Updated Brasilian-Portugese translation 0.29 * Add finnish translation * Updated dutch translation * Add examples to get_window_geometry and get_window_client_geometry * Add get_screen_geometry function (Thanks to Ronan Barzic) 0.28 * Make get workspace error string consistent with other past-tense strings * wnck_class_group_get_res_class is deprecated, use wnck_class_group_get_id instead on wnck versions it isn't available * Make 'relative window positioning' possible, allowing negative values to set_window_geometry * Remove sciteproj project file * Add set_window_type function * Add set_window_opacity function * Added handling of window closing events * Add file monitor to automatically load added scripts 0.27 * Update Makefile to fix a LUA problem with pkg-config * Update the email contact address in the README * Add get_workspace_count function - Thanks Hans Nieser! * Use luaL_newstate instead of lua_open which is deprecated 0.26 * Add "center" function * Register set_window_position2 under the correct name - Fixes bug where set_window_position2 couldn't be found * Add a text file describing development for people who want to join * Add a TODO file * Updated translations 0.25 * Add set_viewport function * Move error strings to a source file of their own * Updated translations - Thanks guys! * Make it possible to build using -j without screwing up translation build 0.24 * Fix bug where folder settings got overridden - Thanks Andreas Müller! * Add set_window_fullscreen function * Add some required checks for running in emulation mode 0.23 * Added Russian translation - Thanks to Roman V. Nikolaev * Fix a string memory leak * Some source cleanups 0.22 * Make scripts keep their environment between runs - Makes it possible to do something to a window class the "n-th" time a window of that class opens. * Documentation and translation updates. 0.21 * Add get_window_is_maximized, get_window_is_maximized_horisontally and get_window_is_maximized_vertically functions * Add set_window_geometry2 and set_window_position2 functions, giving more similar behaviour to original devilspie functionality * Add set_window_above and set_window_below functions * Add get_window_type function * Add get_class_instance_name function * Add get_window_property function * Add get_window_role function * Add get_window_xid function * Add get_window_class function * Sort the list of scripts loaded, making it easier to determine script loading order. * Require an X11 display to run on GTK3 * Updated translations (Thanks guys!) 0.20 * Add get_window_has_name function * Added Brasilian Portugese translation - thanks to Hélder Máximo Botter Ribas * Massive whitespace fixes in the source * Documentation updates * Add linking to X11 (fixes linker error on some ports) 0.19 * Add C preprocessor flags to build system * Minor update to documentation for translators 0.18 * Translation fixes * Minor translation documentation fixes * Minor cleanups and fixes * Added French translation - thanks to Robin Hahling 0.17 * Fix build warning for string not using %s 0.16 * Documentation updates * Add get_window_geometry and get_client_window_geometry functions * Add option to get system wnck version (on systems that support it) * Added gettext support for translations, and added Swedish translation * Add set_skip_tasklist function * Add set_skip_pager function 0.15 * Fix GPL headers, which incorrectly was LGPL * Minor documentation fixes 0.14 * Better checks for valid windows * Source code commenting updates * Minor documentation updates 0.13 * Updated example in the README and other documentation updates * Makefile updates 0.12 * Fixes to the Makefile, fixing the depends system, fixing installation prefxes 0.11 * Fix a build problem where standard C-flags wouldn't be included in makefile * Fix incorrect debug stuff to the makefile 0.10 * Fixed a problem that made the project link even if no objects had changed * Default to build using GTK3, and add option to build using GTK2 * Documentation fixes 0.09 * Fixes to the Makefile * Minor documentation updates 0.08 * Fix manpage problems 0.07 * Fixes to the build system * Fixes of previous sloppy releases * Minor documentation updates 0.05 * Update Makefile to allow CFLAGS changes, required by CDBS 0.04 * Build system updates 0.03 * Remove CMake stuff and go to a standard Makefile * Documentation updates * Move installation instructions to file of its own 0.02 * Rename set_workspace to set_window_workspace * Massive documentation updates 0.01 * Initial release devilspie2-0.31/development.txt0000644000175000017500000000352712207660372016152 0ustar gusnangusnan Devilspie2 development ====================== Git is used for version control for devilpsie2. If you would like to provide code to devilspie2, the first thing to do is - learn git. Number two to think about is if you are willing to release your code as GPL. Devilspie2 is released under the GPL license version 3, and I will only accept code under that license. As with any C program, program execution starts in the main function - which is placed in devilspie2.c in this case. The main function interprets the command line options, sets up a list of script files that should be interpreted, and registers the signal for window_opened to the proper callback function. Adding a new script function ============================ Add it in script.c in the function "register_cfunctions", using a lua_register call - To add a function having the lua name "center", and connect it with the C function c_center, do this: lua_register(lua,"center",c_center); This registers a center function, that will call the c_center function in the C code. The C function should be placed in script_functions.c & its header, with the following prototype: int c_center(lua_State *lua); What is returned is an integer represeting the amount of return values that the LUA function returns. These return values are pushed to the stack using a lua_push for the correct type - for example lua_pushboolean(lua, TRUE); And logically if there are nothing to return, we simply do a "return 0;". If we need something that isn't directly implemented in libwnck, we can add a function implementing it to the file "xutils.c" - please separate stuff from script_functions if it has no need to be there, and simply call it from your function in script_functions.c. The point is to keep input and LUA interpreting to script_functions, while the actual wnck and/or X work is in the xutils files. devilspie2-0.31/AUTHORS0000644000175000017500000000211712207660372014131 0ustar gusnangusnanAuthors: -------- Andreas Rönnquist - Code, Swedish translation Ross Burton - Original Devilspie Robin Hahling - French translation Hélder Máximo Botter Ribas - Brasilian Portugese translation Frans de Jonge - Dutch translation Roman V. Nikolaev - Russian translation Andreas Müller - Patch fixing --folder setting getting overridden in load_scripts Hans Nieser - Patch adding get_workspace_count function larchunix - Patch replacing lua_open with luaL_newstate, to make it work with LUA 5.2. Laurent Brachet - Patch to make set_window_geometry accept negative values Johan Lantto - Finnish translation Ronan Barzic - Function get_screen_geometry Hiroshi Hasebe - Japanese translation devilspie2-0.31/GPL3.txt0000644000175000017500000010451312207660372014332 0ustar gusnangusnan GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . devilspie2-0.31/VERSION0000644000175000017500000000000412207660372014122 0ustar gusnangusnan0.31devilspie2-0.31/po/0000755000175000017500000000000012207660372013476 5ustar gusnangusnandevilspie2-0.31/po/pt_BR.po0000644000175000017500000001064012207660372015045 0ustar gusnangusnan# Portuguese translations for devilspie2 package. # Copyright (C) 2012 THE devilspie2'S COPYRIGHT HOLDER # This file is distributed under the same license as the devilspie2 package. # Helder Maximo Botter Ribas <>, 2012. # msgid "" msgstr "" "Project-Id-Version: devilspie2 0.19\n" "Report-Msgid-Bugs-To: gusnan@gusnan.se\n" "POT-Creation-Date: 2013-02-07 14:18+0100\n" "PO-Revision-Date: 2012-06-05 14:01-0300\n" "Last-Translator: Helder Maximo Botter Ribas <>\n" "Language-Team: Brazilian Portuguese\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: config.c:188 #, c-format msgid "script_folder isn't a folder." msgstr "script_folder não é um diretório." #: config.c:200 script.c:216 #, c-format msgid "Error: %s" msgstr "Erro: %s" #: devilspie2.c:161 #, c-format msgid "Received signal:" msgstr "Sinal recebido:" #: devilspie2.c:205 #, c-format msgid "No script files found in the script folder - exiting." msgstr "Nenhum arquivo de script encontrado no diretório de scripts - saindo." #: devilspie2.c:212 devilspie2.c:219 #, c-format msgid "List of LUA files handling \"%s\" events in folder:" msgstr "Lista de arquivos LUA de manipulação de eventos \"%s\" no diretório:" #: devilspie2.c:284 msgid "Print debug info to stdout" msgstr "Imprimindo informação de debug no stdout" #: devilspie2.c:286 msgid "Don't apply any rules, only emulate execution" msgstr "Não aplique nenhuma regra, apena simule a execução" #: devilspie2.c:288 msgid "Search for scripts in this folder" msgstr "Procurar por scripts neste diretório" #: devilspie2.c:288 msgid "FOLDER" msgstr "DIRETÓRIO" #: devilspie2.c:290 msgid "Show Devilspie2 version and quit" msgstr "Mostar versão do Devilspie2 e sair" #: devilspie2.c:295 msgid "Show libwnck version and quit" msgstr "Mostrar versão do libwnck e sair" #: devilspie2.c:313 msgid "apply rules on windows" msgstr "aplicar regras na janela" #: devilspie2.c:320 #, c-format msgid "option parsing failed: %s" msgstr "falha no parsing da opção: %s" #: devilspie2.c:341 #, c-format msgid "Couldn't create the default folder for devilspie2 scripts." msgstr "Não pode criar o diretório padrão para os scripts do devilspie2." #: devilspie2.c:368 #, c-format msgid "An X11 display is required for devilspie2." msgstr "Uma tela X11 é necessária para o devilspie2" #: devilspie2.c:376 #, c-format msgid "Couldn't init script error messages!" msgstr "Não pode iniciar script de mensagens de erro!" #: devilspie2.c:393 #, c-format msgid "Running devilspie2 in debug and emulate mode." msgstr "Rodando devilspie2 em modo debug e emulação." #: devilspie2.c:395 #, c-format msgid "Running devilspie2 in debug mode." msgstr "Rodando devilspie2 em modo debug." #: devilspie2.c:400 #, c-format msgid "Using scripts from folder: %s" msgstr "Usando scripts do diretório: %s" #: devilspie2.c:416 #, c-format msgid "Couldn't create directory monitor!" msgstr "Não pode criar o monitor de diretório" #: script_functions.c:686 script_functions.c:732 #, c-format msgid "Workspace number %d does not exist!" msgstr "Workspace de número %d não existe!" #: script_functions.c:1596 msgid "Could not get workspace" msgstr "Não foi possível obter o workspace" #: xutils.c:180 xutils.c:198 error_strings.c:127 msgid "Failed!" msgstr "Falhou!" #: error_strings.c:49 msgid "Couldn't allocate error string!" msgstr "Não pode alocar string de erro!" #: error_strings.c:51 msgid "No indata expected" msgstr "Nenhum dado de entrada esperado" #: error_strings.c:58 msgid "One indata expected" msgstr "Um dado de entrada esperado" #: error_strings.c:65 msgid "Two indata expected" msgstr "Dois dados de entrada esperados" #: error_strings.c:72 msgid "Four indata expected" msgstr "Quatro dados de entrada esperados" #: error_strings.c:80 msgid "Number expected as indata" msgstr "Esperado número como dado de entrada" #: error_strings.c:88 msgid "Boolean expected as indata" msgstr "Esperado boleano como dado de entrada" #: error_strings.c:96 msgid "String expected as indata" msgstr "Esperado string como dado de entrada" #: error_strings.c:104 msgid "Integer greater than zero expected" msgstr "Esperado inteiro maior que zero" #: error_strings.c:112 msgid "Could not find current viewport" msgstr "Não pode encontrar a viewport atual" #: error_strings.c:120 msgid "Setting viewport failed" msgstr "Falha no ajuste da viewport" devilspie2-0.31/po/Makefile0000644000175000017500000000274412207660372015145 0ustar gusnangusnan# # Devilspie2 po makefile # $Id$ # ifndef PREFIX ifdef INSTALL_PREFIX PREFIX=$(INSTALL_PREFIX) else PREFIX=/usr/local endif endif NAME = devilspie2 VERSION = $(shell cat ../VERSION) DATADIR = ${DESTDIR}${PREFIX}/share LOCALEDIR = ${DATADIR}/locale SOURCES = config.c devilspie2.c script.c script_functions.c xutils.c error_strings.c XG_ARGS = --keyword=_ --keyword=N_ -w 80 --package-name=${NAME} --package-version=${VERSION} --msgid-bugs-address=gusnan@gusnan.se LANGUAGES = sv fr pt_BR nl ru fi ja LANGUAGES_MO = $(foreach currlang,$(LANGUAGES),$(currlang).mo) LANGUAGES_PO = $(foreach currlang,$(LANGUAGES),$(currlang).po) all: build ${NAME}.pot: xgettext ${XG_ARGS} --directory=../src/ ${SOURCES} -d ${NAME} -o ./${NAME}.pot update-pot: ${NAME}.pot %.pox: %.po msgmerge -o $@ --previous $< ${NAME}.pot build: $(LANGUAGES_MO) $(LANGUAGES_MO): $(LANGUAGES_PO) for po in ${LANGUAGES}; \ do msgfmt -v --statistics -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \ done install: all install-dirs for po in ${LANGUAGES}; \ do install -m 0644 $${po}.mo ${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \ done install-dirs: for po in ${LANGUAGES}; \ do install -d ${LOCALEDIR}/$${po}/LC_MESSAGES; \ done uninstall: for po in ${LANGUAGES}; \ do rm -f ${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \ done clean-build: rm -f *.mo clean-pox: rm -f *.pox clean: clean-build rm -f *~ .PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot devilspie2-0.31/po/ja.po0000644000175000017500000001114312207660372014430 0ustar gusnangusnan# Japanese translations for devilspie2 package # devilspie2 パッケージに対する英訳. # Copyright (C) 2013 THE devilspie2'S COPYRIGHT HOLDER # This file is distributed under the same license as the devilspie2 package. # Hiroshi Hasebe , 2013. # msgid "" msgstr "" "Project-Id-Version: devilspie2 0.28pre\n" "Report-Msgid-Bugs-To: gusnan@gusnan.se\n" "POT-Creation-Date: 2013-02-07 14:18+0100\n" "PO-Revision-Date: 2013-08-28 12:34+0900\n" "Last-Translator: Hiroshi Hasebe \n" "Language-Team: Japanese\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Gtranslator 2.91.6\n" #: config.c:188 #, c-format msgid "script_folder isn't a folder." msgstr "script_folderがフォルダに非ず" #: config.c:200 script.c:216 #, c-format msgid "Error: %s" msgstr "エラー: %s" #: devilspie2.c:161 #, c-format msgid "Received signal:" msgstr "シグナルを検出:" #: devilspie2.c:205 #, c-format msgid "No script files found in the script folder - exiting." msgstr "script_folderにスクリプトが存在せず - 終了." #: devilspie2.c:212 devilspie2.c:219 #, c-format msgid "List of LUA files handling \"%s\" events in folder:" msgstr "イベント \"%s\" を担当するLUAファイルの一覧:" #: devilspie2.c:284 msgid "Print debug info to stdout" msgstr "標準出力にデバッグ情報を書き出す" #: devilspie2.c:286 msgid "Don't apply any rules, only emulate execution" msgstr "ルールを適用せず, エミュレーションを行う" #: devilspie2.c:288 msgid "Search for scripts in this folder" msgstr "スクリプト収容先フォルダ" #: devilspie2.c:288 msgid "FOLDER" msgstr "FOLDER" #: devilspie2.c:290 msgid "Show Devilspie2 version and quit" msgstr "Devilspie2のバージョン情報を表示して終了" #: devilspie2.c:295 msgid "Show libwnck version and quit" msgstr "libwnckのバージョンを表示して終了" #: devilspie2.c:313 msgid "apply rules on windows" msgstr "ウィンドウにルールを適用" #: devilspie2.c:320 #, c-format msgid "option parsing failed: %s" msgstr "引数の解釈に失敗: %s" #: devilspie2.c:341 #, c-format msgid "Couldn't create the default folder for devilspie2 scripts." msgstr "デフォルトのスクリプト・フォルダの作成に失敗" #: devilspie2.c:368 #, c-format msgid "An X11 display is required for devilspie2." msgstr "Devilspie2の実行にはX11環境を要する" #: devilspie2.c:376 #, c-format msgid "Couldn't init script error messages!" msgstr "スクリプト・エラー・メッセージの初期化に失敗" #: devilspie2.c:393 #, c-format msgid "Running devilspie2 in debug and emulate mode." msgstr "devilspie2をデバック + エミュレーション・モードで実行中" #: devilspie2.c:395 #, c-format msgid "Running devilspie2 in debug mode." msgstr "devilspie2をデバッグ・モードで実行中" #: devilspie2.c:400 #, c-format msgid "Using scripts from folder: %s" msgstr "スクリプト・フォルダ \"%s\" を使用中" #: devilspie2.c:416 #, c-format msgid "Couldn't create directory monitor!" msgstr "ディレクトリ・モニタの作成に失敗!" #: script_functions.c:686 script_functions.c:732 #, c-format msgid "Workspace number %d does not exist!" msgstr "%d番のワークスペースが存在せず" #: script_functions.c:1596 msgid "Could not get workspace" msgstr "ワークスペースの取得に失敗" #: xutils.c:180 xutils.c:198 error_strings.c:127 msgid "Failed!" msgstr "処理に失敗!" #: error_strings.c:49 msgid "Couldn't allocate error string!" msgstr "エラー文字列の割当に失敗!" #: error_strings.c:51 msgid "No indata expected" msgstr "引数は不要" #: error_strings.c:58 msgid "One indata expected" msgstr "引数1件を要する" #: error_strings.c:65 msgid "Two indata expected" msgstr "引数が2つ必要" #: error_strings.c:72 msgid "Four indata expected" msgstr "引数が4つ必要" #: error_strings.c:80 msgid "Number expected as indata" msgstr "数値の引数が必要" #: error_strings.c:88 msgid "Boolean expected as indata" msgstr "ブール型の引数が必要" #: error_strings.c:96 msgid "String expected as indata" msgstr "文字列型の引数が必要" #: error_strings.c:104 msgid "Integer greater than zero expected" msgstr "引数にはゼロより大きな整数が必要" #: error_strings.c:112 msgid "Could not find current viewport" msgstr "カレント・ビューポートの検出に失敗" #: error_strings.c:120 msgid "Setting viewport failed" msgstr "ビューポートの設定に失敗" devilspie2-0.31/po/fi.po0000644000175000017500000001052512207660372014437 0ustar gusnangusnan# Finnish translations for devilspie2 package. # Copyright (C) 2013 THE devilspie2'S COPYRIGHT HOLDER # This file is distributed under the same license as the devilspie2 package. # Johan Lantto , 2013. # msgid "" msgstr "" "Project-Id-Version: devilspie2 0.28pre\n" "Report-Msgid-Bugs-To: gusnan@gusnan.se\n" "POT-Creation-Date: 2013-02-07 14:18+0100\n" "PO-Revision-Date: 2013-02-22 09:02+0200\n" "Last-Translator: Johan Lantto \n" "Language-Team: Finnish\n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: config.c:188 #, c-format msgid "script_folder isn't a folder." msgstr "script_folder ei ole kansio." #: config.c:200 #: script.c:216 #, c-format msgid "Error: %s" msgstr "Virhe: %s" #: devilspie2.c:161 #, c-format msgid "Received signal:" msgstr "Vastaanotettu signaali:" #: devilspie2.c:205 #, c-format msgid "No script files found in the script folder - exiting." msgstr "Käsikirjoituksia ei löytynyt käsikirjoituskansiossa - lopetetaan." #: devilspie2.c:212 devilspie2.c:219 #, c-format msgid "List of LUA files handling \"%s\" events in folder:" msgstr "\"%s\"-tapahtumien käsitteleviä LUA-tiedostoja kansiossa:" #: devilspie2.c:284 msgid "Print debug info to stdout" msgstr "Kirjoita debug-info stdout:iin" #: devilspie2.c:286 msgid "Don't apply any rules, only emulate execution" msgstr "Älä noudata yhtään sääntöja, emuloi vaan" #: devilspie2.c:288 msgid "Search for scripts in this folder" msgstr "Etsi käsikirjoituksia tästä kansiosta" #: devilspie2.c:288 msgid "FOLDER" msgstr "KANSIO" #: devilspie2.c:290 msgid "Show Devilspie2 version and quit" msgstr "Näytä Devilspie2:n versio ja lopeta" #: devilspie2.c:295 msgid "Show libwnck version and quit" msgstr "Näytä libwnckin versio ja lopeta" #: devilspie2.c:313 msgid "apply rules on windows" msgstr "käytä sääntöjä ikkunoissa" #: devilspie2.c:320 #, c-format msgid "option parsing failed: %s" msgstr "vaihtoehtojen tulkinta epäonnistui: %s" #: devilspie2.c:341 #, c-format msgid "Couldn't create the default folder for devilspie2 scripts." msgstr "Ei voitu luoda devilspie2:n käsikirjoituksien oletuskansio" #: devilspie2.c:368 #, c-format msgid "An X11 display is required for devilspie2." msgstr "Devilspie2 vaatii X11-näytin" #: devilspie2.c:376 #, c-format msgid "Couldn't init script error messages!" msgstr "Ei voitu alustaa käsikirjoituksien virheilmoituksia!" #: devilspie2.c:393 #, c-format msgid "Running devilspie2 in debug and emulate mode." msgstr "Ajaa Devilspie2 virheenhaku- ja emulointimoodissa" #: devilspie2.c:395 #, c-format msgid "Running devilspie2 in debug mode." msgstr "Ajaa Devilspie2 virheenhakumoodissa" #: devilspie2.c:400 #, c-format msgid "Using scripts from folder: %s" msgstr "Käyttää käsikirjoituksia kansiosta: %s" #: devilspie2.c:416 #, c-format msgid "Couldn't create directory monitor!" msgstr "Ei voitu luoda kansiomonitori!" #: script_functions.c:686 script_functions.c:732 #, c-format msgid "Workspace number %d does not exist!" msgstr "Työpöytä numero %d ei ole olemassa!" #: script_functions.c:1596 msgid "Could not get workspace" msgstr "Työpöytä ei saatu haettu" #: xutils.c:180 xutils.c:198 error_strings.c:127 msgid "Failed!" msgstr "Epäonnistui!" #: error_strings.c:49 msgid "Couldn't allocate error string!" msgstr "Ei voitu allokoida virhemerkkijono!" #: error_strings.c:51 msgid "No indata expected" msgstr "Syötejonoa ei odotettu" #: error_strings.c:58 msgid "One indata expected" msgstr "Yksi syötejono odotettiin" #: error_strings.c:65 msgid "Two indata expected" msgstr "Kaksi syötejonoa odotettiin" #: error_strings.c:72 msgid "Four indata expected" msgstr "Nejlä syötejonoa odotettiin" #: error_strings.c:80 msgid "Number expected as indata" msgstr "Numero odotettiin syötejonona" #: error_strings.c:88 msgid "Boolean expected as indata" msgstr "Boolinen arvo odotettiin syötejonona" #: error_strings.c:96 msgid "String expected as indata" msgstr "Merkkijono odotettiin syötejonona" #: error_strings.c:104 msgid "Integer greater than zero expected" msgstr "Kokonaisluvu nolla suurempi odotettiin" #: error_strings.c:112 msgid "Could not find current viewport" msgstr "Nykyinen työtila ei löydetty" #: error_strings.c:120 msgid "Setting viewport failed" msgstr "Työtilan asettelu epäonnistui" devilspie2-0.31/po/sv.po0000644000175000017500000001060212207660372014465 0ustar gusnangusnan# Swedish translation of Devilspie2 # Copyright (C) 2011 Andreas Rönnquist # This file is distributed under the same license as the devilspie2 package. # Andreas Rönnquist , 2011. # # msgid "" msgstr "" "Project-Id-Version: devilspie2 0.26\n" "Report-Msgid-Bugs-To: gusnan@gusnan.se\n" "POT-Creation-Date: 2013-02-07 14:16+0100\n" "PO-Revision-Date: 2013-02-07 14:17+0100\n" "Last-Translator: Andreas Rönnquist \n" "Language-Team: Swedish\n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: config.c:188 #, c-format msgid "script_folder isn't a folder." msgstr "script_folder är inte en folder." #: config.c:200 #: script.c:216 #, c-format msgid "Error: %s" msgstr "Fel: %s" #: devilspie2.c:161 #, c-format msgid "Received signal:" msgstr "Tog emot signal:" #: devilspie2.c:205 #, c-format msgid "No script files found in the script folder - exiting." msgstr "Inga skript hittades i skript-mappen - avslutar." #: devilspie2.c:212 #: devilspie2.c:219 #, c-format msgid "List of LUA files handling \"%s\" events in folder:" msgstr "Lista på LUA-filer som hanterar \"%s\"-händelser i mappen:" #: devilspie2.c:284 msgid "Print debug info to stdout" msgstr "Skriv ut debug-information till stdout" #: devilspie2.c:286 msgid "Don't apply any rules, only emulate execution" msgstr "Applicera inga regler, emulera endast körning" #: devilspie2.c:288 msgid "Search for scripts in this folder" msgstr "Sök efter skript i denna mapp" #: devilspie2.c:288 msgid "FOLDER" msgstr "MAPP" #: devilspie2.c:290 msgid "Show Devilspie2 version and quit" msgstr "Visa version av Devilspie2 och avsluta" #: devilspie2.c:295 msgid "Show libwnck version and quit" msgstr "Visa version av libwnck och avsluta" #: devilspie2.c:313 msgid "apply rules on windows" msgstr "applicera regler på fönster" #: devilspie2.c:320 #, c-format msgid "option parsing failed: %s" msgstr "tolkning av alternativ misslyckades; %s" #: devilspie2.c:341 #, c-format msgid "Couldn't create the default folder for devilspie2 scripts." msgstr "Kunde inte skapa standard-mappen för devilspie2-skript." #: devilspie2.c:368 #, c-format msgid "An X11 display is required for devilspie2." msgstr "En X11-display krävs för att köra devilspie2" #: devilspie2.c:376 #, c-format msgid "Couldn't init script error messages!" msgstr "Kunde inte initiera skript-felmeddelanden!" #: devilspie2.c:393 #, c-format msgid "Running devilspie2 in debug and emulate mode." msgstr "Kör Devilspie2 i debug och emulerings-mode" #: devilspie2.c:395 #, c-format msgid "Running devilspie2 in debug mode." msgstr "Kör Devilspie2 i debug-mode" #: devilspie2.c:400 #, c-format msgid "Using scripts from folder: %s" msgstr "Använder skript från mappen: %s" #: devilspie2.c:416 #, c-format msgid "Couldn't create directory monitor!" msgstr "Kunde inte skapa folder-monitor!" #: script_functions.c:686 #: script_functions.c:732 #, c-format msgid "Workspace number %d does not exist!" msgstr "Arbetsyta nummer %d finns inte!" #: script_functions.c:1596 msgid "Could not get workspace" msgstr "Kunde inte hämta arbetsytan" #: xutils.c:180 #: xutils.c:198 #: error_strings.c:127 msgid "Failed!" msgstr "Misslyckades!" #: error_strings.c:49 msgid "Couldn't allocate error string!" msgstr "Kunde inte allokera felsträng!" #: error_strings.c:51 msgid "No indata expected" msgstr "Ingen indata väntad" #: error_strings.c:58 msgid "One indata expected" msgstr "En indata väntad" #: error_strings.c:65 msgid "Two indata expected" msgstr "Två indata väntade" #: error_strings.c:72 msgid "Four indata expected" msgstr "Fyra indata väntade" #: error_strings.c:80 msgid "Number expected as indata" msgstr "Nummer väntat som indata" #: error_strings.c:88 msgid "Boolean expected as indata" msgstr "Boolskt värde väntat som indata" #: error_strings.c:96 msgid "String expected as indata" msgstr "Sträng väntad som indata" #: error_strings.c:104 msgid "Integer greater than zero expected" msgstr "Heltal större än noll väntat" #: error_strings.c:112 msgid "Could not find current viewport" msgstr "Kunde inte hitta aktuell visningsyta" #: error_strings.c:120 msgid "Setting viewport failed" msgstr "Kunde inte sätta visningsyta" #~ msgid "List of LUA files handling \"window open\" events in folder:" #~ msgstr "Lista på LUA-filer som hanterar \"window open\"-händelser i mappen:" devilspie2-0.31/po/fr.po0000644000175000017500000001120512207660372014444 0ustar gusnangusnan# French translations for devilspie2 package. # Copyright (C) 2012 THE devilspie2'S COPYRIGHT HOLDER # This file is distributed under the same license as the devilspie2 package. # Robin Hahling , 2012. # msgid "" msgstr "" "Project-Id-Version: devilspie2 0.18\n" "Report-Msgid-Bugs-To: gusnan@gusnan.se\n" "POT-Creation-Date: 2013-05-09 10:08+0200\n" "PO-Revision-Date: 2012-04-15 15:44+0200\n" "Last-Translator: Robin Hahling \n" "Language-Team: French\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: config.c:188 #, c-format msgid "script_folder isn't a folder." msgstr "script_folder n'est pas un dossier." #: config.c:200 script.c:218 #, c-format msgid "Error: %s" msgstr "Erreur: %s" #: devilspie2.c:161 #, c-format msgid "Received signal:" msgstr "Signal reçu:" #: devilspie2.c:205 #, c-format msgid "No script files found in the script folder - exiting." msgstr "Aucun script trouvé dans le dossier de scripts - sortie du programme." #: devilspie2.c:212 devilspie2.c:220 #, c-format msgid "List of LUA files handling \"%s\" events in folder:" msgstr "Liste des fichiers LUA gérant les évènements \"%s\"dans le dossier:" #: devilspie2.c:286 msgid "Print debug info to stdout" msgstr "Affiche les informations de debug dans la sortie standard (stdout)" #: devilspie2.c:288 msgid "Don't apply any rules, only emulate execution" msgstr "N'applique aucune règle, simule seulement l'exécution" #: devilspie2.c:290 msgid "Search for scripts in this folder" msgstr "Recherche de scripts dans ce dossier" #: devilspie2.c:290 msgid "FOLDER" msgstr "DOSSIER" #: devilspie2.c:292 msgid "Show Devilspie2 version and quit" msgstr "Affiche la version de Devilspie2 et quitte le programme" #: devilspie2.c:297 msgid "Show libwnck version and quit" msgstr "Affiche la version de libwnck et quitte le programme" #: devilspie2.c:315 msgid "apply rules on windows" msgstr "applique les règles sur les fenêtres" #: devilspie2.c:322 #, c-format msgid "option parsing failed: %s" msgstr "l'analyse des options a échoué: %s" #: devilspie2.c:343 #, c-format msgid "Couldn't create the default folder for devilspie2 scripts." msgstr "Impossible de créer le fichier par défaut pour les scripts devilspie2" #: devilspie2.c:370 #, c-format msgid "An X11 display is required for devilspie2." msgstr "Un affichage X11 est requis pour devilspie2." #: devilspie2.c:378 #, c-format msgid "Couldn't init script error messages!" msgstr "Impossible d'initialiser le script de messages d'erreurs" #: devilspie2.c:395 #, c-format msgid "Running devilspie2 in debug and emulate mode." msgstr "Fonctionnement de devilspie2 en mode debug et simulation." #: devilspie2.c:397 #, c-format msgid "Running devilspie2 in debug mode." msgstr "Fonctionnement de devilspie2 en mode debug." #: devilspie2.c:402 #, c-format msgid "Using scripts from folder: %s" msgstr "Utilise les scripts de ce dossier: %s" #: devilspie2.c:418 #, c-format msgid "Couldn't create directory monitor!" msgstr "Impossible de créer le dossier moniteur!" #: script_functions.c:691 script_functions.c:737 #, c-format msgid "Workspace number %d does not exist!" msgstr "L'espace de travail numéro %d n'existe pas!" #: script_functions.c:1605 msgid "Could not get workspace" msgstr "Impossible d'obtenir l'espace de travail" #: xutils.c:183 xutils.c:201 error_strings.c:127 msgid "Failed!" msgstr "Échec!" #: error_strings.c:49 msgid "Couldn't allocate error string!" msgstr "Impossible d'allouer la chaine de caractères de l'erreur" #: error_strings.c:51 msgid "No indata expected" msgstr "Aucune donnée d'entrée attendue" #: error_strings.c:58 msgid "One indata expected" msgstr "Une donnée d'entrée attendue" #: error_strings.c:65 msgid "Two indata expected" msgstr "Deux données d'entrée attendues" #: error_strings.c:72 msgid "Four indata expected" msgstr "Quatre données d'entrée attendues" #: error_strings.c:80 msgid "Number expected as indata" msgstr "Nombre attendu de données d'entrée" #: error_strings.c:88 msgid "Boolean expected as indata" msgstr "Booléen attendu comme donnée d'entrée" #: error_strings.c:96 msgid "String expected as indata" msgstr "Chaine de caractères attendue comme donnée d'entrée" #: error_strings.c:104 msgid "Integer greater than zero expected" msgstr "Un entier plus grand que zéro est attendu" #: error_strings.c:112 msgid "Could not find current viewport" msgstr "Impossible de trouver la fenêtre courante" #: error_strings.c:120 msgid "Setting viewport failed" msgstr "Le paramétrage de la fenêtre a échoué" devilspie2-0.31/po/nl.po0000644000175000017500000001052012207660372014445 0ustar gusnangusnan# Dutch translation of Devilspie2 # Copyright (C) 2011 Andreas Rönnquist # This file is distributed under the same license as the devilspie2 package. # Andreas Rönnquist , 2011. # # msgid "" msgstr "" "Project-Id-Version: devilspie2 0.16\n" "Report-Msgid-Bugs-To: gusnan@gusnan.se\n" "POT-Creation-Date: 2013-02-07 14:18+0100\n" "PO-Revision-Date: 2013-05-10 12:50+0100\n" "Last-Translator: Frans de Jonge \n" "Language-Team: Dutch\n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: config.c:188 #, c-format msgid "script_folder isn't a folder." msgstr "script_folder is geen map." #: config.c:200 #: script.c:216 #, c-format msgid "Error: %s" msgstr "Fout: %s" #: devilspie2.c:161 #, c-format msgid "Received signal:" msgstr "Ontvangen signaal:" #: devilspie2.c:205 #, c-format msgid "No script files found in the script folder - exiting." msgstr "Er werden geen scriptbestanden in de scriptmap gevonden — programma wordt afgesloten." #: devilspie2.c:212 #: devilspie2.c:219 #, c-format msgid "List of LUA files handling \"%s\" events in folder:" msgstr "Lijst van LUA-bestanden die worden uitgevoerd bij een \"%s\"-gebeurtenis in deze map:" #: devilspie2.c:284 msgid "Print debug info to stdout" msgstr "Print debuginformatie naar stdout" #: devilspie2.c:286 msgid "Don't apply any rules, only emulate execution" msgstr "Pas geen regels permanent toe; enkel emulatie van uitvoering" #: devilspie2.c:288 msgid "Search for scripts in this folder" msgstr "Zoek naar scripts in deze map" #: devilspie2.c:288 msgid "FOLDER" msgstr "MAP" #: devilspie2.c:290 msgid "Show Devilspie2 version and quit" msgstr "Toon Devilspie2 versie en sluit af" #: devilspie2.c:295 msgid "Show libwnck version and quit" msgstr "Toon libwnck versie en sluit af" #: devilspie2.c:313 msgid "apply rules on windows" msgstr "Pas regels toe op vensters" #: devilspie2.c:320 #, c-format msgid "option parsing failed: %s" msgstr "de volgende optie wordt niet begrepen: %s" #: devilspie2.c:341 #, c-format msgid "Couldn't create the default folder for devilspie2 scripts." msgstr "Kon geen standaardmap aanmaken voor devilspie2 scripts." #: devilspie2.c:368 #, c-format msgid "An X11 display is required for devilspie2." msgstr "Een X11-scherm is noodzakelijk voor devilspie2." #: devilspie2.c:376 #, c-format msgid "Couldn't init script error messages!" msgstr "Scriptfoutmeldingen konden niet geïnitialiseerd worden!" #: devilspie2.c:393 #, c-format msgid "Running devilspie2 in debug and emulate mode." msgstr "Devilspie2 draait in debug- en emuleringsmodus." #: devilspie2.c:395 #, c-format msgid "Running devilspie2 in debug mode." msgstr "Devilspie2 draait in debugmodus." #: devilspie2.c:400 #, c-format msgid "Using scripts from folder: %s" msgstr "Scripts uit deze map worden worden gebruikt: %s" #: devilspie2.c:416 #, c-format msgid "Couldn't create directory monitor!" msgstr "De map kon niet worden gemonitord!" #: script_functions.c:686 #: script_functions.c:732 #, c-format msgid "Workspace number %d does not exist!" msgstr "Werkruimte nummer %d bestaat niet!" #: script_functions.c:1596 msgid "Could not get workspace" msgstr "Kon werkruimte niet verkrijgen." #: xutils.c:180 #: xutils.c:198 #: error_strings.c:127 msgid "Failed!" msgstr "Mislukt!" #: error_strings.c:49 msgid "Couldn't allocate error string!" msgstr "Foutmeldingsreeks kon niet worden gealloceerd!" #: error_strings.c:51 msgid "No indata expected" msgstr "Geen indata verwacht" #: error_strings.c:58 msgid "One indata expected" msgstr "Eén indata verwacht" #: error_strings.c:65 msgid "Two indata expected" msgstr "Twee indata verwacht" #: error_strings.c:72 msgid "Four indata expected" msgstr "Vier indata verwacht" #: error_strings.c:80 msgid "Number expected as indata" msgstr "Nummer verwacht als indata" #: error_strings.c:88 msgid "Boolean expected as indata" msgstr "Boolean verwacht als indata" #: error_strings.c:96 msgid "String expected as indata" msgstr "String verwacht als indata" #: error_strings.c:104 msgid "Integer greater than zero expected" msgstr "Geheel getal groter dan nul verwacht" #: error_strings.c:112 msgid "Could not find current viewport" msgstr "Huidige viewport niet gevonden" #: error_strings.c:120 msgid "Setting viewport failed" msgstr "Viewport instellen mislukt" devilspie2-0.31/po/ru.po0000644000175000017500000001172012207660372014465 0ustar gusnangusnan# Russian translations for devilspie2 package. # Copyright (C) 2012 the devilspie2'S COPYRIGHT HOLDER # This file is distributed under the same license as the devilspie2 package. # Roman V. Nikolaev , 2012. # msgid "" msgstr "" "Project-Id-Version: devilspie2 0.22pre\n" "Report-Msgid-Bugs-To: gusnan@gusnan.se\n" "POT-Creation-Date: 2013-08-29 16:13+0400\n" "PO-Revision-Date: 2012-09-24 19:44+0400\n" "Last-Translator: Roman V. Nikolaev \n" "Language-Team: Russian\n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: config.c:188 msgid "script_folder isn't a folder." msgstr "script_folder не является директорией" #: config.c:200 script.c:228 #, c-format msgid "Error: %s" msgstr "Ошибка: %s" #: devilspie2.c:161 msgid "Received signal:" msgstr "Получен сигнал:" #: devilspie2.c:205 msgid "No script files found in the script folder - exiting." msgstr "В директории для скриптов нет скриптов - выходим." #: devilspie2.c:212 devilspie2.c:220 #, fuzzy, c-format msgid "List of LUA files handling \"%s\" events in folder:" msgstr "Список LUA файлов для \"%s\" событий в директории:" #: devilspie2.c:286 msgid "Print debug info to stdout" msgstr "Вывод отладочной информации в stdout" #: devilspie2.c:288 msgid "Don't apply any rules, only emulate execution" msgstr "Не применять правила, только эмулировать выполнение" #: devilspie2.c:290 msgid "Search for scripts in this folder" msgstr "Искать скрипты в заданной директории" #: devilspie2.c:290 msgid "FOLDER" msgstr "ДИРЕКТОРИЯ" #: devilspie2.c:292 msgid "Show Devilspie2 version and quit" msgstr "Показать версию Devilspie2 и выйти" #: devilspie2.c:297 msgid "Show libwnck version and quit" msgstr "Показать версию libwnck и выйти" #: devilspie2.c:315 msgid "apply rules on windows" msgstr "применить правила на окна" #: devilspie2.c:322 #, c-format msgid "option parsing failed: %s" msgstr "ошибка парсинга: %s" #: devilspie2.c:343 msgid "Couldn't create the default folder for devilspie2 scripts." msgstr "Не могу создать директорию по умолчанию для скриптов." #: devilspie2.c:370 msgid "An X11 display is required for devilspie2." msgstr "Для работы необходим дисплей X11" #: devilspie2.c:378 msgid "Couldn't init script error messages!" msgstr "Не удалось инициализировать сообщения об ошибке скрипта!" #: devilspie2.c:395 msgid "Running devilspie2 in debug and emulate mode." msgstr "Запустить devilspie2 в режиме отладки и эмуляции." #: devilspie2.c:397 msgid "Running devilspie2 in debug mode." msgstr "Запустить devilspie2 в режиме отладки." #: devilspie2.c:402 #, c-format msgid "Using scripts from folder: %s" msgstr "Используются скрипты из директории: %s" #: devilspie2.c:418 #, fuzzy msgid "Couldn't create directory monitor!" msgstr "Не удалось выделить память для сообщения об ошибке!" #: script_functions.c:692 script_functions.c:738 #, c-format msgid "Workspace number %d does not exist!" msgstr "Рабочий стол номер %d не найден!" #: script_functions.c:1606 #, fuzzy msgid "Could not get workspace" msgstr "Не могу найти рабочий стол" #: xutils.c:183 xutils.c:201 error_strings.c:127 msgid "Failed!" msgstr "Ошибка!" #: error_strings.c:49 msgid "Couldn't allocate error string!" msgstr "Не удалось выделить память для сообщения об ошибке!" #: error_strings.c:51 msgid "No indata expected" msgstr "Используется без параметров" #: error_strings.c:58 msgid "One indata expected" msgstr "Ожидается один параметр" #: error_strings.c:65 msgid "Two indata expected" msgstr "Ожидается два параметра" #: error_strings.c:72 msgid "Four indata expected" msgstr "Ожидается четыре параметра" #: error_strings.c:80 msgid "Number expected as indata" msgstr "Ожидается число" #: error_strings.c:88 msgid "Boolean expected as indata" msgstr "Ожидается boolean " #: error_strings.c:96 msgid "String expected as indata" msgstr "Ожидается строка" #: error_strings.c:104 msgid "Integer greater than zero expected" msgstr "Ожидается целое больше нуля" #: error_strings.c:112 msgid "Could not find current viewport" msgstr "Не могу найти текущее окно" #: error_strings.c:120 msgid "Setting viewport failed" msgstr "Ошибка настройки окна" devilspie2-0.31/po/devilspie2.pot0000644000175000017500000000623612207660372016277 0ustar gusnangusnan# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: devilspie2 0.28pre\n" "Report-Msgid-Bugs-To: gusnan@gusnan.se\n" "POT-Creation-Date: 2013-02-07 14:18+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: config.c:188 #, c-format msgid "script_folder isn't a folder." msgstr "" #: config.c:200 script.c:216 #, c-format msgid "Error: %s" msgstr "" #: devilspie2.c:161 #, c-format msgid "Received signal:" msgstr "" #: devilspie2.c:205 #, c-format msgid "No script files found in the script folder - exiting." msgstr "" #: devilspie2.c:212 devilspie2.c:219 #, c-format msgid "List of LUA files handling \"%s\" events in folder:" msgstr "" #: devilspie2.c:284 msgid "Print debug info to stdout" msgstr "" #: devilspie2.c:286 msgid "Don't apply any rules, only emulate execution" msgstr "" #: devilspie2.c:288 msgid "Search for scripts in this folder" msgstr "" #: devilspie2.c:288 msgid "FOLDER" msgstr "" #: devilspie2.c:290 msgid "Show Devilspie2 version and quit" msgstr "" #: devilspie2.c:295 msgid "Show libwnck version and quit" msgstr "" #: devilspie2.c:313 msgid "apply rules on windows" msgstr "" #: devilspie2.c:320 #, c-format msgid "option parsing failed: %s" msgstr "" #: devilspie2.c:341 #, c-format msgid "Couldn't create the default folder for devilspie2 scripts." msgstr "" #: devilspie2.c:368 #, c-format msgid "An X11 display is required for devilspie2." msgstr "" #: devilspie2.c:376 #, c-format msgid "Couldn't init script error messages!" msgstr "" #: devilspie2.c:393 #, c-format msgid "Running devilspie2 in debug and emulate mode." msgstr "" #: devilspie2.c:395 #, c-format msgid "Running devilspie2 in debug mode." msgstr "" #: devilspie2.c:400 #, c-format msgid "Using scripts from folder: %s" msgstr "" #: devilspie2.c:416 #, c-format msgid "Couldn't create directory monitor!" msgstr "" #: script_functions.c:686 script_functions.c:732 #, c-format msgid "Workspace number %d does not exist!" msgstr "" #: script_functions.c:1596 msgid "Could not get workspace" msgstr "" #: xutils.c:180 xutils.c:198 error_strings.c:127 msgid "Failed!" msgstr "" #: error_strings.c:49 msgid "Couldn't allocate error string!" msgstr "" #: error_strings.c:51 msgid "No indata expected" msgstr "" #: error_strings.c:58 msgid "One indata expected" msgstr "" #: error_strings.c:65 msgid "Two indata expected" msgstr "" #: error_strings.c:72 msgid "Four indata expected" msgstr "" #: error_strings.c:80 msgid "Number expected as indata" msgstr "" #: error_strings.c:88 msgid "Boolean expected as indata" msgstr "" #: error_strings.c:96 msgid "String expected as indata" msgstr "" #: error_strings.c:104 msgid "Integer greater than zero expected" msgstr "" #: error_strings.c:112 msgid "Could not find current viewport" msgstr "" #: error_strings.c:120 msgid "Setting viewport failed" msgstr "" devilspie2-0.31/COPYING0000644000175000017500000000007612207660372014116 0ustar gusnangusnan Devilspie2 is licensed under the GPL3 license. See GPL3.txt devilspie2-0.31/devilspie2.10000644000175000017500000000227512207660372015216 0ustar gusnangusnan.TH devilspie2 1 "29 August 2013" "Version 0.31" .SH NAME Devilspie2 - perform scripted actions on windows as they are created .SH Description .B Devilspie2 is a program that detects windows as they are created, and performs scripted actions on them. The scripts are written in LUA, allowing a great deal of customisation. More details in /usr/share/doc/devilspie2. .SH Options .IP "--version" Displays the version of Devilspie2. .IP "--folder folder" Sets the folder where the LUA scripts are loaded from. .IP "--debug" Shows debug information from the LUA scripts. If debug_print is used in the LUA scripts, that output will only be printed to stdout if this option is used. .IP "--emulate" Emulate script behaviour. Using this option only emulates a scripts behaviour, and doesn't affect the windows that the scripts otherwise would modify. .IP "--wnck-version" Show version of the libwnck used. (Only availible on GTK3 or later) .SH Script Commands .TP See the README or the manual linked from the homepage for a detailed description of the commands recognized by the LUA script. .SH Author .B Devilspie2 was written by Andreas Rönnquist , and is based on Devilspie by Ross Burton. devilspie2-0.31/README0000644000175000017500000002650712207660372013752 0ustar gusnangusnan Devilspie 2 ----------- Devilspie 2 is based on the excellent program Devil's Pie by Ross Burton, and takes a folder as indata, and checks that folder for LUA scripts. These scripts are run each time a window is opened, and the rules in them are applied on the window. Unfortunately the rules of the original Devils Pie are not supported. If you don't give devilspie2 any folder with --folder, it will read LUA scripts from the folder that it gets from the GLib function g_get_user_config_dir with devilspie2/ added to the end - g_get_user_config_dir returns the config directory as defined in the XDG Base Directory Specification. In most cases would be the ~/.config/devilspie2/ folder, and this folder will be created if it doesn't already exist. This folder is changeable with the --folder option. If devilspie2 doesn't find any LUA files in the folder, it will stop execution. Devilspie2 will load all the LUA files in this folder in alphabetical order. Devilspie2 takes some options: -h, --help Show help options -d, --debug Print debug information to stdout -e, --emulate Don't apply any rules, but only emulate execution -f, --folder From which folder should we load our LUA scripts -v, --version Print program version and quit -w, --wnck-version Show version of libwnck and quit Config ------- A config is read from the folder where we read all scripts, and is customizable by the --folder option. By default this folder is ~/.config/devilspie2/. If there is a file named devilspie2.lua in this folder, it is read and it is searched for a variable (a lua table of strings) named scripts_window_close - The filenames in the strings in the this table will be called when windows are closed. If these variables isn't present in this file, it will be called as a devilspie2 script file like any other. For example: -- scripts_window_close = { "file1.lua", "file2.lua" } This would make file1.lua and file2.lua interpreted on windows closing instead of on windows opening. Scripting --------- You can choose to have all script functionality in one file, or you can split it up into several, Devilspie2 runs on all LUA files in your requested devilspie2 folder, by default ~/.config/devilspie2 - that is all files with a .lua extension. The scripting language used is LUA (see www.lua.org) - See FAQ at www.lua.org/FAQ.html , documentation at www.lua.org/docs.html , and tutorials at http://lua-users.org/wiki/TutorialDirectory The following commands are recognized by the Devilspie2 LUA interpreter: First; a function to show some debug info debug_print(string) Debug helper that prints a string to stdout. The string is only printed to stdout if devilspie2 is run with the --debug option, otherwise nothing will be printed. Then, there's the functions to get the properties of a window, and related information: get_window_name() returns a string containing the name of the current window. get_window_has_name() return true or false depending on if the window has a name or not (from version 0.20) get_application_name() returns the application name of the current window. get_window_geometry() Returns the window geometry as four numbers - x-position, y-position, width and height. (from version 0.16) - for example you can do something like this: x, y, width, height = get_window_geometry(); print("X: "..x..", Y: "..y..", width: "..width..", height: "..height); get_window_client_geometry() returns the window geometry excluding the window manager borders as four numbers, x-position, y-position, width and height. (from version 0.16) - see get_window_geometry for an example on how to use this function. get_window_is_maximized() Returns true if the window is maximized, false otherwise. (available from version 0.21) get_window_is_maximized_vertically() Returns true if the window is vertically maximized, false otherwise. (available from version 0.21) get_window_is_maximized_horisontally() get_window_is_maximized_horizontally() Returns true if the window is horisontally maximized, false otherwise. (available from version 0.21) get_window_type() Returns the type of the window - The result type is a string, and can be one of the following: "WINDOW_TYPE_NORMAL" "WINDOW_TYPE_DESKTOP" "WINDOW_TYPE_DOCK" "WINDOW_TYPE_DIALOG" "WINDOW_TYPE_TOOLBAR" "WINDOW_TYPE_MENU" "WINDOW_TYPE_UTILITY" "WINDOW_TYPE_SPLASHSCREEN" or "WINDOW_TYPE_UNRECOGNIZED" if libwnck didn't recognize the type. If the function for some reason didn't have a window to work on the string result is "WINDOW_ERROR". (available from version 0.21) get_class_instance_name() Gets the class instance name from the WM_CLASS Property for the current window. Only available on libwnck 3+, and in devilspie2 version 0.21 or later. get_window_property(property) Returns the window property described in the property string. For a list of available properties, you should see the page http://standards.freedesktop.org/wm-spec/wm-spec-latest.html (Available from version 0.21) get_window_role Returns a string describing the current window role of the matched window as defined by it's WM_WINDOW_ROLE hint. get_window_xid Returns the X window id of the current window. get_window_class Returns a string representing the class of the current window. get_workspace_count Return the number of workspaces available (available from version 0.27) get_screen_geometry Returns the screen geometry (two numbers) for the screen of the current window (available from version 0.29) and the rest of the commands are used to modify the properties of the windows: set_window_position(xpos,ypos) Set the position of a window. set_window_position2(xpos,ypos) Set the position of a window - Compared to set_window_position, this function uses XMoveWindow instead of wnck_window_set_geometry which gives a slightly different result. (Available from version 0.21) set_window_size (xsize, ysize) Sets the size of a window - takes xsize and ysize as parameters. set_window_geometry (xpos, ypos, xsize, ysize) Sets both size and position of a window in one command. Takes four parameters, xpos, ypos, xsize and ysize. set_window_geometry2 (xpos, ypos, xsize, ysize) Sets the window geometry just as set_window_geometry, using XMoveResizeWindow instead of its libwnck alternative. This results in different coordinates than the set_window_geometry function, and results are more similar to the results of the original devilspie geometry function. (available from version 0.21) make_always_on_top() Sets a window always on top. set_on_top() sets a window on top of the others. (unlike make_always_on_top, it doesn't lock the window in this position.) shade() "Shades" a window, showing only the title-bar. unshade() Unshades a window - the opposite of "shade" maximize() maximizes a window unmaximize() unmaximizes a window maximize_vertically() maximizes the current window vertically. maximize_horisontally() maximize_horizontally() maximizes the current window horisontally. minimize() minimizes a window unminimize() unminimizes a window, that is bringing it back to screen from the minimized position/size. decorate_window() Shows all window decoration. undecorate_window() Removes all window decorations. close_window() Closes the window. (Available from 0.31) set_window_workspace(number) Moves a window to another workspace. The number variable starts counting at 1. change_workspace(number) Changes the current workspace to another. The number variable starts counting at 1. pin_window() asks the window manager to put the window on all workspaces. unpin_window() Asks the window manager to put window only in the currently active workspace. stick_window() Asks the window manager to keep the window's position fixed on the screen, even when the workspace or viewport scrolls. unstick_window() Asks the window manager to not have window's position fixed on the screen when the workspace or viewport scrolls. set_skip_tasklist(skip) Set this to true if you would like the window to skip listing in your tasklist. Takes a boolean(true or false) as value. (from version 0.16) set_skip_pager(skip) Set this to true if you would like the window to skip listing in your pager. Takes a boolean(true or false) as value. (from version 0.16) set_window_above() Set the current window above all normal windows. (available from version 0.21) set_window_below() Set the current window below all normal windows. (available from version 0.21) set_window_fullscreen(fullscreen) Asks the window manager to set the fullscreen state of the window according to the fullscreen boolean. (available from version 0.24) set_viewport(viewport) Moves the window to the requested viewport - Counting starts at number 1. (Available from version 0.25) center() Centers the current window on the current workspace. (Available from version 0.26) set_opacity(value) set_window_opacity(value) Sets the window opacity, takes a float value, 1.0 = completely opaque, 0.0, completely see-through. Both set_opacity and set_window_opacity will do the same thing. (Available from version 0.28, set_window_opacity from 0.29) set_window_type(type) Sets the window type, according to _NET_WM_WINDOW_TYPE. The allowed types are the standard _NET_WM ones (formatted as a string): "_NET_WM_WINDOW_TYPE_DESKTOP" "_NET_WM_WINDOW_TYPE_DOCK" "_NET_WM_WINDOW_TYPE_TOOLBAR" "_NET_WM_WINDOW_TYPE_MENU" "_NET_WM_WINDOW_TYPE_UTILITY" "_NET_WM_WINDOW_TYPE_SPLASH" "_NET_WM_WINDOW_TYPE_DIALOG" "_NET_WM_WINDOW_TYPE_NORMAL" or shorter versions of the same values "WINDOW_TYPE_DESKTOP" "WINDOW_TYPE_DOCK" "WINDOW_TYPE_TOOLBAR" "WINDOW_TYPE_MENU" "WINDOW_TYPE_UTILITY" "WINDOW_TYPE_SPLASH" "WINDOW_TYPE_DIALOG" "WINDOW_TYPE_NORMAL" (Function is available from version 0.28) focus() focus_window() Focuses the current window. (Function is available from version 0.30) Please note that strings comparisons are case sensitive, comparing "SomeProgram" with "someprogram" will not report equality. Simple script example --------------------- ---------------------8<--------------------- -- the debug_print command does only print anything to stdout -- if devilspie2 is run using the --debug option debug_print("Window Name: " .. get_window_name()); debug_print("Application name: " .. get_application_name()) -- I want my Xfce4-terminal to the right on the second screen of my two-monitor -- setup. (String comparison are case sensitive, please note this when -- creating rule scripts.) if (get_window_name()=="Terminal") then -- x,y, xsize, ysize set_window_geometry(1600,300,900,700); end -- Make Iceweasel always start maximized. if (get_application_name()=="Iceweasel") then maximize(); end --------------------->8--------------------- Translations ------------ Devilspie2 is now translatable using gettext - see README.translators for more information. Authors ------- see the AUTHORS file Contact ------- Author: Andreas Rönnquist E-mail: devilspie2 (at) gusnan (dot) se Homepage: http://www.gusnan.se/devilspie2 Google groups: http://groups.google.com/group/devilspie2 IRC: #devilspie2 on irc.freenode.net devilspie2-0.31/TODO0000644000175000017500000000003412207660372013545 0ustar gusnangusnan Nothing here at the moment